diff --git a/ChangeLog b/ChangeLog index 99ce993..03e1852 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2018-02-13 Maciej W. Rozycki + + * configure.ac (noconfigdirs): Add `ld'. + * configure: Regenerate. + +2018-01-30 Nick Clifton + + * src-release.sh (do_proto_toplev): Add patterns for more junk files + to delete before creating the tarball. + +2018-01-29 Nick Clifton + + * src-release.sh (do_proto_toplev): Strip patch remnant files from + the sources before creating the tarball. + +2018-01-13 Nick Clifton + + * src-release.sh: Update copyright notice. Change reference to devo + to be a reference to root. + 2018-01-10 Nick Clifton * config-ml.in: Sync with gcc sources. diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c310da6..6e20330 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,11 +1,1277 @@ -2018-01-27 Nick Clifton +2018-03-03 James Cowgill + Maciej W. Rozycki - This is the 2.30 release: + PR ld/21900 + * elfxx-mips.c (mips_elf_calculate_relocation): Only return + after calling `undefined_symbol' hook if this is an error + condition. Assume the value of 0 for the symbol requested + otherwise. - * version.m4 (BFD_VERSION): Set to 2.30 - * development.sh: Set to false. - * configure: Regenerate. - * po/bfd.pot: Regenerate. +2018-03-02 Jim Wilson + + PR 22903 + * elfnn-aarch64.c (_bfd_aarch64_resize_stubs): Add 8 bytes for branch + and nop instead of 4. + (elfNN_arch64_build_stubs): Add nop after branch. Increase size by + 8 instead of 4. + +2018-03-01 Jim Wilson + + PR 22756 + * elfnn-riscv.c (riscv_relax_delete_bytes): When adjust st_size, use + else if instead of if. + +2018-03-01 Alan Modra + + * elf32-ft32.c (ft32_info_to_howto_rela): Correct range test. + +2018-02-28 Alan Modra + + PR 22887 + * aoutx.h (swap_std_reloc_in): Correct r_index bound check. + +2018-02-28 Nick Clifton + + PR 22895 + PR 22893 + * dwarf2.c (read_n_bytes): Replace size parameter with dwarf_block + pointer. Drop unused abfd parameter. Check the size of the block + before initialising the data field. Return the end pointer if the + size is invalid. + (read_attribute_value): Adjust invocations of read_n_bytes. + + PR 22894 + * dwarf1.c (parse_die): Check the length of form blocks before + advancing the data pointer. + +2018-02-28 Alan Modra + + PR 22887 + * aoutx.h (translate_symbol_table): Print an error message and set + bfd_error on finding an invalid name string offset. + +2018-02-27 H.J. Lu + + * config.in: Regenerated. + * configure: Likewise. + * configure.ac: Add --enable-separate-code. + (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED. Default + to 1 for Linux/x86 targets, + * elf64-x86-64.c (ELF_MAXPAGESIZE): Set to 0x1000 if + DEFAULT_LD_Z_SEPARATE_CODE is 1. + +2018-02-27 Nick Clifton + + * aout-cris.c (swap_ext_reloc_out): Standadize error/warning + message. + * elf-hppa.h (elf_hppa_info_to_howto_rel): Likewise. + * elf32-i386.c (elf_i386_reloc_type_lookup): Likewise. + * elf32-xtensa.c (elf_xtensa_reloc_type_lookup): Likewise. + * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Likewise. + * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise. + * elf64-sh64.c (sh_elf64_info_to_howto): Likewise. + * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Likewise. + * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise. + + PR 22875 + * elf-bfd.h (struct elf_backend_data): Change the return type of + the elf_info_to_howto and elf_info_to_howto_rel function pointers + to bfd_boolean. + * elfcode.h (elf_slurp_reloc_table_from_section): Check the return + value from the info_to_howto function and fail if that function + failed. + * elf32-h8300.c (elf32_h8_relocate_section): Check return value + from the info_to_howto function. + (elf32_h8_relax_section): Likewise. + * elf32-lm32.c (lm32_elf_relocate_section): Likewise. + * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. + * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. + * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. + * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise. + * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise. + * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise. + * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise. + * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elfnn-riscv.c (riscv_elf_check_relocs): Likewise. + (riscv_elf_relocate_section): Likewise. + * elf-hppa.h (elf_hppa_info_to_howto): Change return type to + bfd_boolean. Issue an error message, set an error value and + return FALSE if the reloc is not recognized. + (elf_hppa_info_to_howto_rel): Likewise. + * elf-m10200.c (mn10200_info_to_howto): Likewise. + * elf-m10300.c (mn10300_info_to_howto): Likewise. + * elf.c (_bfd_elf_no_info_to_howto): Likewise. + * elf32-arc.c (arc_info_to_howto_rel): Likewise. + * elf32-arm.c (elf32_arm_info_to_howto): Likewise. + * elf32-avr.c (avr_info_to_howto_rela): Likewise. + * elf32-bfin.c (bfin_info_to_howto): Likewise. + * elf32-cr16.c (elf_cr16_info_to_howto): Likewise. + * elf32-cr16c.c (elf_cr16c_info_to_howto): Likewise. + * elf32-cris.c (elf_cr16c_info_to_howto_rel) + (cris_info_to_howto_rela): Likewise. + * elf32-crx.c (elf_crx_info_to_howto): Likewise. + * elf32-d10v.c (d10v_info_to_howto_rel): Likewise. + * elf32-d30v.c (d30v_info_to_howto_rel, d30v_info_to_howto_rela): + Likewise. + * elf32-dlx.c (dlx_rtype_to_howto, elf32_dlx_info_to_howto) + (elf32_dlx_info_to_howto_rel): Likewise. + * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise. + * elf32-fr30.c (fr30_info_to_howto_rela): Likewise. + * elf32-frv.c (frv_info_to_howto_rela) + (frvfdpic_info_to_howto_rel): Likewise. + * elf32-ft32.c (ft32_info_to_howto_rela): Likewise. + * elf32-gen.c (elf_generic_info_to_howto) + (elf_generic_info_to_howto_rel): Likewise. + * elf32-h8300.c (elf32_h8_info_to_howto) + (elf32_h8_info_to_howto_rel): Likewise. + * elf32-i370.c (i370_elf_info_to_howto): Likewise. + * elf32-i386.c (elf_i386_reloc_type_lookup) + (elf_i386_rtype_to_howto, elf_i386_info_to_howto_rel): Likewise. + * elf32-i860.c (lookup_howto, elf32_i860_info_to_howto_rela): + Likewise. + * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise. + * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise. + * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise. + * elf32-lm32.c (lm32_info_to_howto_rela): Likewise. + * elf32-m32c.c (m32c_info_to_howto_rela): Likewise. + * elf32-m32r.c (m32r_info_to_howto_rel, m32r_info_to_howto): + Likewise. + * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise. + * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise. + * elf32-m68k.c (rtype_to_howto): Likewise. + * elf32-mcore.c (mcore_elf_info_to_howto): Likewise. + * elf32-mep.c (mep_info_to_howto_rela): Likewise. + * elf32-metag.c (metag_info_to_howto_rela): Likewise. + * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise. + * elf32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela): + Likewise. + * elf32-moxie.c (moxie_info_to_howto_rela): Likewise. + * elf32-msp430.c (msp430_info_to_howto_rela): Likewise. + * elf32-mt.c (mt_info_to_howto_rela): Likewise. + * elf32-nds32.c (nds32_info_to_howto_rel, nds32_info_to_howto): + Likewise. + * elf32-nios2.c (nios2_elf32_info_to_howto): Likewise. + * elf32-or1k.c (or1k_info_to_howto_rela): Likewise. + * elf32-pj.c (pj_elf_info_to_howto): Likewise. + * elf32-ppc.c (ppc_elf_info_to_howto): Likewise. + * elf32-pru.c (pru_elf32_info_to_howto): Likewise. + * elf32-rl78.c (rl78_info_to_howto_rela): Likewise. + * elf32-rx.c (rx_info_to_howto_rela): Likewise. + * elf32-s390.c (elf_s390_info_to_howto): Likewise. + * elf32-score.c (s3_bfd_score_info_to_howto) + (_bfd_score_info_to_howto): Likewise. + * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise. + * elf32-sh.c (sh_elf_info_to_howto): Likewise. + * elf32-spu.c (spu_elf_info_to_howto): Likewise. + * elf32-tic6x.c (elf32_tic6x_info_to_howto) + (elf32_tic6x_info_to_howto_rel): Likewise. + * elf32-tilepro.c (tilepro_info_to_howto_rela): Likewise. + * elf32-v850.c (v850_elf_info_to_howto_rel) + (v850_elf_info_to_howto_rela, v800_elf_info_to_howto): Likewise. + * elf32-vax.c (rtype_to_howto): Likewise. + * elf32-visium.c (visium_info_to_howto_rela): Likewise. + * elf32-wasm32.c (elf32_wasm32_rtype_to_howto) + (elf32_wasm32_info_to_howto_rela): Likewise. + * elf32-xc16x.c (elf32_xc16x_info_to_howto): Likewise. + * elf32-xgate.c (xgate_info_to_howto_rel): Likewise. + * elf32-xstormy16.c (xstormy16_info_to_howto_rela): Likewise. + * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise. + * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise. + * elf64-gen.c (elf_generic_info_to_howto) + (elf_generic_info_to_howto_rel): Likewise. + * elf64-ia64-vms.c (elf64_ia64_info_to_howto): Likewise. + * elf64-mips.c (mips_elf64_info_to_howto_rela): Likewise. + * elf64-mmix.c (mmix_info_to_howto_rela): Likewise. + * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise. + * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise. + * elf64-sh64.c (elf_s390_info_to_howto, sh_elf64_info_to_howto): + Likewise. + * elf64-x86-64.c (elf_x86_64_info_to_howto): Likewise. + * elfn32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela): + Likewise. + * elfnn-aarch64.c (elfNN_aarch64_info_to_howto): Likewise. + * elfnn-ia64.c (elfNN_ia64_info_to_howto): Likewise. + * elfnn-riscv.c (riscv_info_to_howto_rela): Likewise. + * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise. + * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Likewise. + * elfxx-tilegx.c (tilegx_info_to_howto_rela): Likewise. + * elf32-score.h (s7_bfd_score_info_to_howto): Update prototype. + * elfxx-sparc.h (_bfd_sparc_elf_info_to_howto): Update prototype. + * elfxx-tilegx.h (tilegx_info_to_howto_rela): Update prototype. + * elfxx-target.h (elf_info_to_howto, elf_info_to_howto_rel): + Default to NULL. + +2018-02-26 Jim Wilson + Stephan Schreiber + + PR 15904 + * elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl + call, set changed_contents and changed_relocs. Likewise after + successful ia64_elf_relax_br call. + +2018-02-26 Alan Modra + + * elf.c (assign_file_positions_except_relocs): Don't segfault + when actual number of phdrs is less than allocated. Delete + outdated comment. Formatting. + +2018-02-26 Alan Modra + + * elf-m10300.c, * elf-s390-common.c, * elf32-arc.c, * elf32-cris.c, + * elf32-dlx.c, * elf32-frv.c, * elf32-i370.c, * elf32-lm32.c, + * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c, + * elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c, + * elf32-nios2.c, * elf32-or1k.c, * elf32-rl78.c, * elf32-rx.c, + * elf32-score.c, * elf32-score7.c, * elf32-sh-symbian.c, + * elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c, + * elf64-alpha.c, * elf64-ia64-vms.c, * elf64-mmix.c, + * elf64-sh64.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-tilegx.c, + * mmo.c, * osf-core.c, * srec.c, * vms-alpha.c: Standardize + error/warning messages. + +2018-02-26 Alan Modra + + * archive.c, * bfd.c, * linker.c, * reloc.c, * stabs.c, + * syms.c: Standardize error/warning messages. + +2018-02-26 Alan Modra + + * aout-adobe.c, * aout-cris.c, * i386linux.c, * m68klinux.c, + * sparclinux.c, * coff-alpha.c, * coff-arm.c, * coff-mcore.c, + * coffcode.h, * coffgen.c, * cofflink.c, * ecoff.c, * pe-mips.c, + * peXXigen.c, * peicode.h: Standardize error/warning messages. + +2018-02-26 Alan Modra + + * elf32-arm.c, * elfnn-aarch64.c: Standardize error/warning messages. + +2018-02-26 Alan Modra + + * elfxx-mips.c: Standardize error/warning messages. + +2018-02-26 Alan Modra + + * dwarf2.c, * elf-attrs.c, * elf-eh-frame.c, * elf.c, * elf32-gen.c, + * elflink.c: Standardize error/warning messages. Replace use of + linker callback einfo with _bfd_error_handler when possible. + +2018-02-26 Alan Modra + + * aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c, + * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, + * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c, + * elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c, + * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c, + * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c, + * elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c, + * elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c, + * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, + * elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c, + * elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c, + * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c, + * elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c, + * elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, + * elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c, + * elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c, + * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c, + * elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, + * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c, + * elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h, + * elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize + unrecognized/unsupported reloc message. + +2018-02-26 Alan Modra + + * elf32-ppc.c: Standardize error/warning messages. Use + _bfd_error_handler rather than einfo when einfo features not used. + * elf64-ppc.c: Likewise. + +2018-02-23 Alan Modra + + PR 22881 + * elf.c (assign_file_positions_for_non_load_sections): Remove RELRO + segment if no matching LOAD segment. + +2018-02-23 Kuan-Lin Chen + + * elf32-nds32.h: Define mask for ict_model. + +2018-02-20 Jason Duerstock + + * elfnn-ia64.c (elf_backend_can_gc_sections): Enable. + +2018-02-19 Maciej W. Rozycki + + Revert + 2018-01-12 Vlad Ivanov + + * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when + .reginfo section has wrong size. + +2018-02-19 Maciej W. Rozycki + + * elfxx-mips.c (_bfd_mips_elf_always_size_sections): Set + SEC_FIXED_SIZE and SEC_HAS_CONTENTS flags for `.reginfo' and + `.MIPS.abiflags' sections. + (_bfd_mips_elf_final_link): Avoid reading beyond `.reginfo' + section's end. + +2018-02-19 Maciej W. Rozycki + + * section.c (SEC_FIXED_SIZE): New macro. + * bfd-in2.h: Regenerate. + +2018-02-19 Maciej W. Rozycki + + * section.c (SEC_HAS_GOT_REF): Remove macro. + * bfd-in2.h: Regenerate. + +2018-02-19 Alan Modra + + * elf-attrs.c (_bfd_elf_parse_attributes): Correct _bfd_error_handler + arguments. + * elfxx-mips.c (_bfd_mips_elf_final_link): Likewise. + * elfnn-riscv.c (_bfd_riscv_relax_align): Likewise. + (_bfd_riscv_relax_pc): Likewise and fix typos. + * libbfd-in.h (_bfd_error_handler): Add attribute printf. + * libbfd.h: Regenerate. + +2018-02-19 Alan Modra + + * dwarf2.c (read_section): Don't use 'll' format modifier. + (find_abstract_instance): Likewise. + * elfcore.h (elf_core_file_p): Likewise. + +2018-02-19 Alan Modra + + * bfd-in.h: Include inttypes.h or if not available define + PRId64, PRIu64 and PRIx64. + * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Remove support for L + modifier to print bfd_vma. + * coff-arm.c, * coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, + * coff-sh.c, * coff-tic80.c, * coffcode.h, * coffgen.c, * cofflink.c, + * compress.c, * dwarf2.c, * elf-m10300.c, * elf.c, * elf32-arc.c, + * elf32-arm.c, * elf32-bfin.c, * elf32-cris.c, * elf32-hppa.c, + * elf32-i386.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32r.c, + * elf32-m68k.c, * elf32-metag.c, * elf32-nds32.c, * elf32-nios2.c, + * elf32-ppc.c, * elf32-rx.c, * elf32-s390.c, * elf32-score.c, + * elf32-score7.c, * elf32-sh.c, * elf32-sh64.c, * elf32-spu.c, + * elf32-tic6x.c, * elf32-tilepro.c, * elf32-v850.c, * elf32-vax.c, + * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, + * elf64-mmix.c, * elf64-s390.c, * elf64-sh64.c, * elf64-x86-64.c, + * elfcode.h, * elfcore.h, * elflink.c, * elfnn-aarch64.c, + * elfnn-ia64.c, * elfnn-riscv.c, * elfxx-mips.c, * elfxx-sparc.c, + * elfxx-tilegx.c, * ieee.c, * ihex.c, * mach-o.c, * merge.c, * mmo.c, + * peXXigen.c, * xcofflink.c: Replace use of Lx modifier with PRIx64, + and cast input to uint64_t, and similarly for Ld and Lu. + * bfd-in2.h: Regenerate. + +2018-02-19 Alan Modra + + * elf32-arm.c, * elf32-hppa.c, * elf32-lm32.c, * elf32-m32r.c, + * elf32-metag.c, * elf32-nds32.c, * elf32-or1k.c, * elf32-ppc.c, + * elf32-s390.c, * elf32-sh.c, * elf32-tic6x.c, * elf32-tilepro.c, + * elf64-ppc.c, * elf64-s390.c, * elflink.c, * elfnn-aarch64.c, + * elfnn-riscv.c, * elfxx-sparc.c, * elfxx-tilegx.c, * elfxx-x86.c, + * reloc.c: Replace use of %R and %T in format strings passed to + einfo and friends by %pR and %pT. + +2018-02-19 Alan Modra + + * bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Handle %pA and %pB in place + of %A and %B. + * aout-adobe.c: Update all messages using %A and %B. + * aout-cris.c: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * binary.c: Likewise. + * cache.c: Likewise. + * coff-alpha.c: Likewise. + * coff-arm.c: Likewise. + * coff-i860.c: Likewise. + * coff-mcore.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-tic4x.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-tic80.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cofflink.c: Likewise. + * coffswap.h: Likewise. + * compress.c: Likewise. + * cpu-arm.c: Likewise. + * ecoff.c: Likewise. + * elf-attrs.c: Likewise. + * elf-eh-frame.c: Likewise. + * elf-ifunc.c: Likewise. + * elf-m10300.c: Likewise. + * elf-properties.c: Likewise. + * elf-s390-common.c: Likewise. + * elf.c: Likewise. + * elf32-arc.c: Likewise. + * elf32-arm.c: Likewise. + * elf32-avr.c: Likewise. + * elf32-bfin.c: Likewise. + * elf32-cr16.c: Likewise. + * elf32-cr16c.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-crx.c: Likewise. + * elf32-d10v.c: Likewise. + * elf32-d30v.c: Likewise. + * elf32-epiphany.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-gen.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i960.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-iq2000.c: Likewise. + * elf32-lm32.c: Likewise. + * elf32-m32c.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mep.c: Likewise. + * elf32-metag.c: Likewise. + * elf32-microblaze.c: Likewise. + * elf32-moxie.c: Likewise. + * elf32-msp430.c: Likewise. + * elf32-mt.c: Likewise. + * elf32-nds32.c: Likewise. + * elf32-nios2.c: Likewise. + * elf32-or1k.c: Likewise. + * elf32-pj.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-rl78.c: Likewise. + * elf32-rx.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-score.c: Likewise. + * elf32-score7.c: Likewise. + * elf32-sh-symbian.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-spu.c: Likewise. + * elf32-tic6x.c: Likewise. + * elf32-tilepro.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-visium.c: Likewise. + * elf32-wasm32.c: Likewise. + * elf32-xgate.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-gen.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ia64-vms.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elfnn-aarch64.c: Likewise. + * elfnn-ia64.c: Likewise. + * elfnn-riscv.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-sparc.c: Likewise. + * elfxx-tilegx.c: Likewise. + * elfxx-x86.c: Likewise. + * hpux-core.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * libbfd.c: Likewise. + * linker.c: Likewise. + * mach-o.c: Likewise. + * merge.c: Likewise. + * mmo.c: Likewise. + * oasys.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peXXigen.c: Likewise. + * peicode.h: Likewise. + * reloc.c: Likewise. + * rs6000-core.c: Likewise. + * srec.c: Likewise. + * stabs.c: Likewise. + * vms-alpha.c: Likewise. + * xcofflink.c: Likewise. + +2018-02-19 Alan Modra + + PR 22845 + * elf.c (IS_TBSS): Define. + (_bfd_elf_map_sections_to_segments): Use IS_TBSS. + (assign_file_positions_for_non_load_sections): Revert last change. + Properly calculate load segment limits to compare against relro limits. + +2018-02-17 Alan Modra + + PR 22845 + * elf.c (assign_file_positions_for_non_load_sections): Ignore + degenerate zero size PT_LOAD segments when finding one overlapping + the PT_GNU_RELRO segment. + +2018-02-16 Alan Modra + + * libbfd.c (_bfd_bool_bfd_false_error): Rename from bfd_false. + (_bfd_bool_bfd_true): Rename from bfd_true. + (_bfd_ptr_bfd_null_error): Rename from bfd_nullvoidptr. + (_bfd_int_bfd_0): Rename from bfd_0. + (_bfd_uint_bfd_0): Rename from bfd_0u. + (_bfd_long_bfd_0): Rename from bfd_0l. + (_bfd_long_bfd_n1_error): Rename from _bfd_n1. + (_bfd_void_bfd): Rename from bfd_void. + (_bfd_bool_bfd_false, _bfd_bool_bfd_asymbol_false), + (_bfd_bool_bfd_link_false_error), + (_bfd_bool_bfd_link_true, _bfd_bool_bfd_bfd_true), + (_bfd_bool_bfd_uint_true, _bfd_bool_bfd_ptr_true), + (_bfd_bool_bfd_asection_bfd_asection_true), + (_bfd_bool_bfd_asymbol_bfd_asymbol_true), + (_bfd_void_bfd_link, _bfd_void_bfd_asection): New functions. + * archive.c (_bfd_noarchive_get_elt_at_index), + (_bfd_noarchive_openr_next_archived_file), + (_bfd_noarchive_construct_extended_name_table), + (_bfd_noarchive_write_ar_hdr, _bfd_noarchive_truncate_arname), + (_bfd_noarchive_write_armap): New functions. + * archures.c (_bfd_nowrite_set_arch_mach): New function. + * coff-alpha.c (alpha_ecoff_swap_coff_aux_in), + (alpha_ecoff_swap_coff_sym_in, alpha_ecoff_swap_coff_lineno_in), + (alpha_ecoff_swap_coff_aux_out, alpha_ecoff_swap_coff_sym_out), + (alpha_ecoff_swap_coff_lineno_out), + (alpha_ecoff_swap_coff_reloc_out): New functions. + * coff-mips.c (mips_ecoff_swap_coff_aux_in), + (mips_ecoff_swap_coff_sym_in, mips_ecoff_swap_coff_lineno_in), + (mips_ecoff_swap_coff_aux_out, mips_ecoff_swap_coff_sym_out), + (mips_ecoff_swap_coff_lineno_out), + (mips_ecoff_swap_coff_reloc_out): New functions. + * coffcode.h (coff_set_alignment_hook): Replace define with + new function. + (symname_in_debug_hook): Likewise. + * ecoff.c (_bfd_ecoff_set_alignment_hook): New function. + * elfxx-target.h (elf_backend_allow_non_load_phdr): Default to 0. + * elf.c (assign_file_positions_except_relocs): Test + elf_backend_allow_non_load_phdr for NULL. + * elflink.c (_bfd_elf_omit_section_dynsym_default): Rename from + _bfd_elf_link_omit_section_dynsym. Update uses. + (_bfd_elf_omit_section_dynsym_all): New function. + * elf-bfd.h (_bfd_elf_link_omit_section_dynsym): Delete. + (_bfd_elf_omit_section_dynsym_default): Declare. + (_bfd_elf_omit_section_dynsym_all): Declare. + * linker.c (_bfd_nolink_sizeof_headers, _bfd_nolink_bfd_relax_section), + (_bfd_nolink_bfd_get_relocated_section_contents), + (_bfd_nolink_bfd_lookup_section_flags), + (_bfd_nolink_bfd_is_group_section, _bfd_nolink_bfd_discard_group), + (_bfd_nolink_bfd_link_hash_table_create), + (_bfd_nolink_bfd_link_just_syms), + (_bfd_nolink_bfd_copy_link_hash_symbol_type), + (_bfd_nolink_bfd_link_split_section), + (_bfd_nolink_section_already_linked), + (_bfd_nolink_bfd_define_common_symbol), + (_bfd_nolink_bfd_define_start_stop): New functions. + * reloc.c (_bfd_norelocs_bfd_reloc_type_lookup), + (_bfd_norelocs_bfd_reloc_name_lookup), + (_bfd_nodynamic_canonicalize_dynamic_reloc): New functions. + * section.c (_bfd_nowrite_set_section_contents): New function. + * syms.c (_bfd_nosymbols_canonicalize_symtab), + (_bfd_nosymbols_print_symbol, _bfd_nosymbols_get_symbol_info), + (_bfd_nosymbols_get_symbol_version_string), + (_bfd_nosymbols_bfd_is_local_label_name), + (_bfd_nosymbols_get_lineno, _bfd_nosymbols_find_nearest_line), + (_bfd_nosymbols_find_line, _bfd_nosymbols_find_inliner_info), + (_bfd_nosymbols_bfd_make_debug_symbol), + ( _bfd_nosymbols_read_minisymbols), + ( _bfd_nosymbols_minisymbol_to_symbol), + (_bfd_nodynamic_get_synthetic_symtab): New functions. + * libbfd-in.h: Declare new functions. Update existing defines, + removing casts. + * aix386-core.c: Update to use new hooks. Formatting. + * aout-adobe.c: Likewise. + * aout-arm.c: Likewise. + * aout-target.h: Likewise. + * aout-tic30.c: Likewise. + * aoutf1.h: Likewise. + * binary.c: Likewise. + * bout.c: Likewise. + * cisco-core.c: Likewise. + * coff-alpha.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-ia64.c: Likewise. + * coff-mips.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-tic30.c: Likewise. + * coff-tic54x.c: Likewise. + * coff-x86_64.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * elf-m10300.c: Likewise. + * elf32-cr16.c: Likewise. + * elf32-lm32.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-metag.c: Likewise. + * elf32-score.c: Likewise. + * elf32-score7.c: Likewise. + * elf32-tilepro.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-ia64-vms.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-sh64.c: Likewise. + * elfnn-ia64.c: Likewise. + * elfxx-sparc.c: Likewise. + * elfxx-target.h: Likewise. + * elfxx-tilegx.c: Likewise. + * elfxx-x86.h: Likewise. + * hp300hpux.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + * i386msdos.c: Likewise. + * i386os9k.c: Likewise. + * ieee.c: Likewise. + * ihex.c: Likewise. + * irix-core.c: Likewise. + * libaout.h: Likewise. + * libecoff.h: Likewise. + * mach-o-target.c: Likewise. + * mach-o.c: Likewise. + * mipsbsd.c: Likewise. + * mmo.c: Likewise. + * netbsd-core.c: Likewise. + * nlm-target.h: Likewise. + * oasys.c: Likewise. + * osf-core.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * pe-x86_64.c: Likewise. + * pef.c: Likewise. + * plugin.c: Likewise. + * ppcboot.c: Likewise. + * ptrace-core.c: Likewise. + * sco5-core.c: Likewise. + * som.c: Likewise. + * sparclynx.c: Likewise. + * srec.c: Likewise. + * tekhex.c: Likewise. + * trad-core.c: Likewise. + * verilog.c: Likewise. + * versados.c: Likewise. + * vms-alpha.c: Likewise. + * vms-lib.c: Likewise. + * wasm-module.c: Likewise. + * xsym.c: Likewise. + * libbfd.h: Regenerate. + +2018-02-15 Jim Wilson + + * elfnn-riscv.c (_bfd_riscv_relax_section): Ifdef out check to ignore + symbols whose section address is zero. + + * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous + when pcrel_lo reloc has an addend. Use reloc_dangerous callback for + bfd_reloc_dangerous. Use einfo instead of warning callback for errors. + Add %X%P to error messages. + +2018-02-15 Eric Botcazou + + PR ld/22832 + * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) : + Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup + and assert that the result of the call is not NULL. + +2018-02-14 Nick Clifton + + PR 22823 + Revert previous delta. Add extra casts to avoid compile time + warnings instead. + * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra + cast to avoid warning from gcc v8 compiler. + (_bfd_generic_bfd_merge_private_bfd_data): Likewise. + (_bfd_generic_bfd_set_private_flags): Likewise. + (_bfd_generic_bfd_copy_private_section_data): Likewise. + (_bfd_generic_bfd_copy_private_symbol_data): Likewise. + (_bfd_generic_bfd_copy_private_header_data): Likewise. + (_bfd_generic_bfd_print_private_bfd_data): Likewise. + (_bfd_noarchive_construct_extended_name_table): Likewise. + (_bfd_noarchive_truncate_arname): Likewise. + (_bfd_noarchive_write_ar_hdr): Likewise. + (_bfd_noarchive_get_elt_at_index): Likewise. + (_bfd_nosymbols_canonicalize_symtab): Likewise. + (_bfd_nosymbols_print_symbol): Likewise. + (_bfd_nosymbols_get_symbol_info): Likewise. + (_bfd_nosymbols_get_symbol_version_string): Likewise. + (_bfd_nosymbols_bfd_is_local_label_name): Likewise. + (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise. + (_bfd_nosymbols_get_lineno): Likewise. + (_bfd_nosymbols_find_nearest_line): Likewise. + (_bfd_nosymbols_find_line): Likewise. + (_bfd_nosymbols_find_inliner_info): Likewise. + (_bfd_nosymbols_bfd_make_debug_symbol): Likewise. + (_bfd_nosymbols_read_minisymbols): Likewise. + (_bfd_nosymbols_minisymbol_to_symbol): Likewise. + (_bfd_norelocs_bfd_reloc_type_lookup): Likewise. + (_bfd_norelocs_bfd_reloc_name_lookup): Likewise. + (_bfd_nowrite_set_arch_mach): Likewise. + (_bfd_nowrite_set_section_contents): Likewise. + (_bfd_nolink_sizeof_headers): Likewise. + (_bfd_nolink_bfd_get_relocated_section_contents): Likewise. + (_bfd_nolink_bfd_relax_section): Likewise. + (_bfd_nolink_bfd_gc_sections): Likewise. + (_bfd_nolink_bfd_lookup_section_flags): Likewise. + (_bfd_nolink_bfd_merge_sections): Likewise. + (_bfd_nolink_bfd_is_group_section): Likewise. + (_bfd_nolink_bfd_discard_group): Likewise. + (_bfd_nolink_bfd_link_hash_table_create): Likewise. + (_bfd_nolink_bfd_link_add_symbols): Likewise. + (_bfd_nolink_bfd_link_just_syms): Likewise. + (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise. + (_bfd_nolink_bfd_final_link): Likewise. + (_bfd_nolink_bfd_link_split_section): Likewise. + (_bfd_nolink_section_already_linked): Likewise. + (_bfd_nolink_bfd_define_common_symbol): Likewise. + (_bfd_nolink_bfd_define_start_stop): Likewise. + (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise. + (_bfd_nodynamic_get_synthetic_symtab): Likewise. + (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise. + (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise. + * libbfd.c (bfd_false_any): Delete. + (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete. + (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete. + * libbfd.h (extern): Regenerate + * aout-target.h (MY_bfd_is_target_special_symbol): Add extra + cast to avoid warning from gcc v8 compiler. + * aout-tic30.c (tic30_aout_set_arch_mach): Likewise. + * binary.c (binary_get_symbol_info): Likewise. + * coff-alpha.c (alpha_ecoff_backend_data): Likewise. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * coffcode.h (coff_set_alignment_hook): Likewise. + (symname_in_debug_hook): Likewise. + (bfd_coff_backend_data bigobj_swap_table): Likewise. + * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-score.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise. + * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise. + * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise. + (bfd_elfNN_bfd_make_debug_symbol): Likewise. + (bfd_elfNN_bfd_merge_private_bfd_data): Likewise. + (bfd_elfNN_bfd_set_private_flags): Likewise. + (bfd_elfNN_bfd_is_target_special_symbol): Likewise. + (elf_backend_init_index_section): Likewise. + (elf_backend_allow_non_load_phdr): Likewise. + * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise. + * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise. + * ieee.c (ieee_construct_extended_name_table): Likewise. + (ieee_write_armap): Likewise. + (ieee_write_ar_hdr): Likewise. + (ieee_bfd_is_target_special_symbol): Likewise. + * ihex.c (ihex_canonicalize_symtab): Likewise. + (ihex_bfd_is_target_special_symbol): Likewise. + * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise. + * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise. + (_bfd_ecoff_set_alignment_hook): Likewise. + * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise. + * mmo.c (mmo_bfd_is_target_special_symbol): Likewise. + * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise. + * oasys.c (oasys_construct_extended_name_table): Likewise. + (oasys_write_armap): Likewise. + (oasys_write_ar_hdr): Likewise. + (oasys_bfd_is_target_special_symbol): Likewise. + * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise. + * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise. + * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise. + * som.c (som_bfd_is_target_special_symbol): Likewise. + * srec.c (srec_bfd_is_target_special_symbol): Likewise. + * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise. + * verilog.c (verilog_bfd_is_target_special_symbol): Likewise. + * versados.c (versados_bfd_is_target_special_symbol): Likewise. + (versados_bfd_reloc_name_lookup): Likewise. + * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise. + (vms_bfd_define_start_stop): Likewise. + (alpha_vms_bfd_is_target_special_symbol): Likewise. + * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise. + * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise. + +2018-02-14 H.J. Lu + + PR ld/22842 + * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non + PC-relative PLT to NEED_DYNAMIC_RELOCATION_P. + * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for + R_X86_64_PC32 reloc against dynamic function in data section. + Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P. + (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc + against dynamic function in data section. + * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as + function address only if pcrel_plt is true. + (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt. + * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for + PC-relative PLT. If PLT is PC-relative, don't generate dynamic + PC-relative relocation against a function definition in data + secton in PIE. Remove the obsolete comments. + (elf_x86_link_hash_table): Add pcrel_plt. + +2018-02-13 H.J. Lu + + * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll, + instead of bfd_link_pic, for building shared library. + +2018-02-13 H.J. Lu + + PR gas/22791 + * elf64-x86-64.c (is_32bit_relative_branch): Removed. + (elf_x86_64_relocate_section): Check PIC relocations in PIE. + Remove is_32bit_relative_branch usage. Disallow PC32 reloc + against protected function in shared object. + +2018-02-13 Sergei Trofimovich + + PR 22828 + * po/ru.po: Fix typo in Russian translation. + +2018-02-13 Maciej W. Rozycki + + * wasm-module.c (wasm_scan_name_function_section): Rename + `index' local variable to `idx'. + +2018-02-13 Nick Clifton + + PR 22823 + Fix compile time warnings generated by gcc version 8. + * libbfd-in.h: Remove extraneous text from prototypes. + Add prototypes for bfd_false_any, bfd_true_any, + bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any, + bfd_n1_any, bfd_void_any. + (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy + function. + (_bfd_generic_bfd_merge_private_bfd_data): Likewise. + (_bfd_generic_bfd_set_private_flags): Likewise. + (_bfd_generic_bfd_copy_private_section_data): Likewise. + (_bfd_generic_bfd_copy_private_symbol_data): Likewise. + (_bfd_generic_bfd_copy_private_header_data): Likewise. + (_bfd_generic_bfd_print_private_bfd_data): Likewise. + (_bfd_noarchive_construct_extended_name_table): Likewise. + (_bfd_noarchive_truncate_arname): Likewise. + (_bfd_noarchive_write_ar_hdr): Likewise. + (_bfd_noarchive_get_elt_at_index): Likewise. + (_bfd_nosymbols_canonicalize_symtab): Likewise. + (_bfd_nosymbols_print_symbol): Likewise. + (_bfd_nosymbols_get_symbol_info): Likewise. + (_bfd_nosymbols_get_symbol_version_string): Likewise. + (_bfd_nosymbols_bfd_is_local_label_name): Likewise. + (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise. + (_bfd_nosymbols_get_lineno): Likewise. + (_bfd_nosymbols_find_nearest_line): Likewise. + (_bfd_nosymbols_find_line): Likewise. + (_bfd_nosymbols_find_inliner_info): Likewise. + (_bfd_nosymbols_bfd_make_debug_symbol): Likewise. + (_bfd_nosymbols_read_minisymbols): Likewise. + (_bfd_nosymbols_minisymbol_to_symbol): Likewise. + (_bfd_norelocs_bfd_reloc_type_lookup): Likewise. + (_bfd_norelocs_bfd_reloc_name_lookup): Likewise. + (_bfd_nowrite_set_arch_mach): Likewise. + (_bfd_nowrite_set_section_contents): Likewise. + (_bfd_nolink_sizeof_headers): Likewise. + (_bfd_nolink_bfd_get_relocated_section_contents): Likewise. + (_bfd_nolink_bfd_relax_section): Likewise. + (_bfd_nolink_bfd_gc_sections): Likewise. + (_bfd_nolink_bfd_lookup_section_flags): Likewise. + (_bfd_nolink_bfd_merge_sections): Likewise. + (_bfd_nolink_bfd_is_group_section): Likewise. + (_bfd_nolink_bfd_discard_group): Likewise. + (_bfd_nolink_bfd_link_hash_table_create): Likewise. + (_bfd_nolink_bfd_link_add_symbols): Likewise. + (_bfd_nolink_bfd_link_just_syms): Likewise. + (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise. + (_bfd_nolink_bfd_final_link): Likewise. + (_bfd_nolink_bfd_link_split_section): Likewise. + (_bfd_nolink_section_already_linked): Likewise. + (_bfd_nolink_bfd_define_common_symbol): Likewise. + (_bfd_nolink_bfd_define_start_stop): Likewise. + (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise. + (_bfd_nodynamic_get_synthetic_symtab): Likewise. + (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise. + (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise. + * libbfd.c (bfd_false_any): New function. Like bfd_false but + accepts one or more arguments. + (bfd_true_any): Likewise. + (bfd_nullvoidptr_any): Likewise. + (bfd_0_any): Likewise. + (bfd_0u_any): Likewise. + (bfd_0l_any): Likewise. + (_bfd_n1_any): Likewise. + (bfd_void_any): Likewise. + * libbfd.h (extern): Regenerate + * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg + based dummy function. + * aout-tic30.c (tic30_aout_set_arch_mach): Likewise. + * binary.c (binary_get_symbol_info): Likewise. + * coff-alpha.c (alpha_ecoff_backend_data): Likewise. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + * coffcode.h (coff_set_alignment_hook): Likewise. + (symname_in_debug_hook): Likewise. + (bfd_coff_backend_data bigobj_swap_table): Likewise. + * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-score.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise. + * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise. + * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise. + * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise. + * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise. + (bfd_elfNN_bfd_make_debug_symbol): Likewise. + (bfd_elfNN_bfd_merge_private_bfd_data): Likewise. + (bfd_elfNN_bfd_set_private_flags): Likewise. + (bfd_elfNN_bfd_is_target_special_symbol): Likewise. + (elf_backend_init_index_section): Likewise. + (elf_backend_allow_non_load_phdr): Likewise. + * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise. + * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise. + * ieee.c (ieee_construct_extended_name_table): Likewise. + (ieee_write_armap): Likewise. + (ieee_write_ar_hdr): Likewise. + (ieee_bfd_is_target_special_symbol): Likewise. + * ihex.c (ihex_canonicalize_symtab): Likewise. + (ihex_bfd_is_target_special_symbol): Likewise. + * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise. + * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise. + (_bfd_ecoff_set_alignment_hook): Likewise. + * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise. + * mmo.c (mmo_bfd_is_target_special_symbol): Likewise. + * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise. + * oasys.c (oasys_construct_extended_name_table): Likewise. + (oasys_write_armap): Likewise. + (oasys_write_ar_hdr): Likewise. + (oasys_bfd_is_target_special_symbol): Likewise. + * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise. + * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise. + * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise. + * som.c (som_bfd_is_target_special_symbol): Likewise. + * srec.c (srec_bfd_is_target_special_symbol): Likewise. + * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise. + * verilog.c (verilog_bfd_is_target_special_symbol): Likewise. + * versados.c (versados_bfd_is_target_special_symbol): Likewise. + (versados_bfd_reloc_name_lookup): Likewise. + * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise. + (vms_bfd_define_start_stop): Likewise. + (alpha_vms_bfd_is_target_special_symbol): Likewise. + * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise. + * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise. + * elf32-arc.c (get_replace_function): Assign replacement function + to func pointer. + * elf32-i370.c (i370_noop): Update prototype. + +2018-02-13 Alan Modra + + PR 22836 + * elf.c (_bfd_elf_fixup_group_sections): Account for removed + relocation sections. If size reduces to just the flag word, + remove that too and mark with SEC_EXCLUDE. + * elflink.c (bfd_elf_final_link): Strip empty group sections. + +2018-02-13 Alan Modra + + PR 22829 + * elf.c (assign_file_positions_for_non_load_sections): Rewrite + PT_GNU_RELRO setup. + +2018-02-12 Zebediah Figura + + * i386msdos.c (msdos_mkobject); New function. + (msdos_object_p): New function. + (i386_msdos_vec): Use msdos_object_p as the check_format + function. + * peicode.h: Rename external_PEI_DOS_hdr, DOSMAGIC, and + NT_SIGNATURE to external_DOS_hdr, IMAGE_DOS_SIGNATURE, and + IMAGE_NT_SIGNATURE. + * peXXigen.c: Likewise. + * coff-ia64.c: Likewise. + +2018-02-12 Nick Clifton + + * elf32-nds32.c (nds32_elf_relax_longjump3): Remove redundant + assignment. + * elf32-arc.c (elf_arc_relocate_section): Likewise. + +2018-02-09 Eric Botcazou + + * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions. + (sparc_elf_append_rela): Assert that there is enough room in section. + (_bfd_sparc_elf_copy_indirect_symbol): Fix formatting. + (_bfd_sparc_elf_adjust_dynamic_symbol): Minor tweak. + (allocate_dynrelocs): Remove outdated comments and reorder conditions. + For a symbol subject to a GOT relocation, reserve a slot in the + relocation section if the symbol isn't dynamic and we are in PIC mode. + (_bfd_sparc_elf_relocate_section) : If relocation + is relaxed and a slot was reserved, generate a R_SPARC_NONE relocation. + : Adjust comments. + : Reorder conditions. Remove always-false assertion. + (_bfd_sparc_elf_finish_dynamic_symbol): Rename local_undefweak into + resolved_to_zero. Do not generate a dynamic GOT relocation for an + undefined weak symbol with non-default visibility. Remove superfluous + 'else' and fix formatting. + +2018-02-09 H.J. Lu + + * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle + is_solaris. + (i386_elf32_sol2_vec): Don't declare. + (elf_i386_link_setup_gnu_properties): Also handle is_solaris. + Don't set need_global_offset_table. + (elf_i386_solaris_arch_bed): New. + (elf_backend_arch_data): Set to elf_i386_solaris_arch_bed for + Solaris. + * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Check + target_os != is_nacl instead of target_os == is_normal. + (x86_64_elf64_sol2_vec): Don't declare. + (elf_x86_64_link_setup_gnu_properties): Check target_os != + is_nacl instead of target_os == is_normal. Don't set + need_global_offset_table. + (elf_x86_64_solaris_arch_bed): New. + (elf_backend_arch_data): Set to elf_x86_64_solaris_arch_bed for + Solaris. + * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep + _GLOBAL_OFFSET_TABLE_ for Solaris. + (_bfd_x86_elf_link_setup_gnu_properties): Don't copy + need_global_offset_table. + * elfxx-x86.h (elf_x86_target_os): Add is_solaris. + (elf_x86_link_hash_table): Remove need_global_offset_table. + (elf_x86_init_table): Likewise. + +2018-02-08 H.J. Lu + + * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields): + Remove prototype. + (i386_elf32_sol2_vec): Declared. + (elf_i386_link_setup_gnu_properties): Set + need_global_offset_table with info->output_bfd->xvec. + * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields): + Remove prototype. + (x86_64_elf64_sol2_vec): Declared. + (elf_x86_64_link_setup_gnu_properties): Set + need_global_offset_table with info->output_bfd->xvec. + +2018-02-08 H.J. Lu + + * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields): + New prototype. + (elf_i386_link_setup_gnu_properties): Set need_global_offset_table + for Solaris. + * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields): + New prototype. + (elf_x86_64_link_setup_gnu_properties): Set + need_global_offset_table for Solaris. + * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep the + unused _GLOBAL_OFFSET_TABLE_ for Solaris. + (_bfd_x86_elf_link_setup_gnu_properties): Copy + need_global_offset_table. + * elfxx-x86.h (elf_x86_link_hash_table): Add + need_global_offset_table. + (elf_x86_init_table): Likewise. + +2018-02-08 Jim Wilson + + * elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous + change. + +2018-02-08 Nick Clifton + + PR 22788 + * elf.c (elf_parse_notes): Reject notes with excessuively large + alignments. + +2018-02-07 Alan Modra + + Revert 2018-01-17 Alan Modra + * elf32-ppc.c: Remove speculation barrier support. + * elf32-ppc.h: Likewise. + * elf64-ppc.c: Likewise. + * elf64-ppc.h: Likewise. + +2018-02-06 Jim Wilson + + * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used + callback to report an error. + +2018-02-06 Eric Botcazou + + PR ld/22263 + * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic + into call to !bfd_link_executable and tidy up. + (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up. + : Turn call to bfd_link_pic into call to + !bfd_link_executable. + : Likewise. + : Remove useless code, tidy and merge related blocks. + : Turn call to bfd_link_pic into call to + !bfd_link_executable. + : Tidy up. + (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to + !bfd_link_executable. + (allocate_dynrelocs): Likewise. + (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up. + : Merge into... + : ...this. Adjust 4th argument in call to + sparc_elf_tls_transition and remove redundant code. + : Turn call to bfd_link_pic into call to + !bfd_link_executable. + : Likewise. + : Likewise. Tidy up. + : Likewise. + : Likewise. Tidy up. + : Likewise. + : Likewise. + : Likewise. + : Likewise. + +2018-02-06 Miloš Stojanović + + PR 22789 + * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf + functions failed to find the function name, try the generic elf + find function instead. + +2018-02-06 Sergio Durigan Junior + + * coff-rs6000.c (xcoff_write_archive_contents_old): Use + 'memcpy' instead of 'strncpy' when writing the magic number. + +2018-02-06 Nick Clifton + + PR 22794 + * opncls.c (bfd_get_debug_link_info_1): Check the size of the + section before attempting to read it in. + (bfd_get_alt_debug_link_info): Likewise. + +2018-02-06 Paul Carroll + + * bfd/dwarf2.c (find_abstract_name): Modified to return file and + line information in addition to name, if they can be found. + +2018-02-05 Renlin Li + + PR ld/22764 + * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the + R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the + check for writeable section as well. + +2018-02-05 H.J. Lu + + PR ld/22782 + * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if + _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve + undefined weak symbol to 0. + * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced + if _GLOBAL_OFFSET_TABLE_ is referenced. + * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check + got_referenced instead of ref_regular_nonweak. Remove the + unused _GLOBAL_OFFSET_TABLE_ from symbol table. + * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced. + +2018-02-05 Maciej W. Rozycki + + * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to + initialize `hi_reloc'. + +2018-02-05 Maciej W. Rozycki + + * elfxx-mips.c (_bfd_mips_elf_section_processing): For + SHT_MIPS_REGINFO sections don't assert the correct size and + report an error instead. + +2018-02-05 Maciej W. Rozycki + + * elf.c (_bfd_elf_write_object_contents): Propagate a failure + status from `->elf_backend_section_processing'. + +2018-02-02 Jim Wilson + + PR ld/22756 + * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info. + If link_info->wrap_hash, check for a duplicate symbol and ignore. + (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le): + Pass new argument to riscv_relax_delete_bytes. + (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise. Remove + ATTRIBUTE_UNUSED from link_info parameter. + +2018-02-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops + emitted for toc sequence optimization. Set and use "howto" later. + +2018-02-01 Simon Marchi + + * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer + arithmetic on NULL pointer. + * elflink.c (_bfd_elf_archive_symbol_lookup, + elf_link_add_archive_symbols): Likewise. + +2018-01-31 Michael Matz + + * elflink.c (bfd_elf_define_start_stop): Fix check of + def_dynamic. + +2018-01-31 H.J. Lu + + PR ld/21964 + * elflink.c (bfd_elf_define_start_stop): Check if __start and + __stop symbols are referenced by shared objects. + +2018-01-30 Alan Modra + + PR 22758 + * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new + segment when demand paged with lma on the same page. Test this + before load/non-load, executable/non-executable, + writable/non-writable tests and simplify. Delete bogus relro + condition in writable/non-writable test. Delete outdated + comment. Formatting. + +2018-01-30 Alan Modra + + * elflink.c (bfd_elf_define_start_stop): Make __start and __stop + symbols dynamic. + +2018-01-29 Alan Modra + + PR 22741 + * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in + range before converting to a symbol table pointer. 2018-01-27 Nick Clifton @@ -13,9 +1279,19 @@ 2018-01-26 Alan Modra + * elflink.c (bfd_elf_define_start_stop): Override symbols when + they are defined dynamically. + +2018-01-26 Alan Modra + * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when .branch_lt changes size. +2018-01-25 Alan Modra + + PR 22746 + * elfcode.h (elf_object_p): Avoid integer overflow. + 2018-01-25 Eric Botcazou PR ld/22727 @@ -33,10 +1309,34 @@ (allocate_dynrelocs): Likewise. (_bfd_sparc_elf_relocate_section): Likewise. -2018-01-23 Nick Clifton +2018-01-24 Renlin Li - * version.m4: Reset version number to 2.29.90. - * configure: Regenerate. + * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for + BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G3. + * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. + (_bfd_aarch64_elf_resolve_relocation): Likewise. + +2018-01-24 Renlin Li + + * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0, + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1, + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2, + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3. + * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for + BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G3. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2018-01-23 Maciej W. Rozycki + + * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale + `mips_elf32_section_processing' comment reference. 2018-01-20 H.J. Lu @@ -54,7 +1354,16 @@ * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align. (ppc64_elf_build_stubs): Likewise. -2018-01-18 Alan Modra +2018-01-17 Nick Clifton + + * po/ru.po: Updated Russian translation. + * po/uk/po: Updated Ukranian translation. + +2018-01-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning. + +2018-01-17 Alan Modra * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier. (CRSETEQ, BEQCTRM): Define. @@ -80,11 +1389,7 @@ (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub. * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps. -2018-01-18 Alan Modra - - * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning. - -2018-01-18 Alan Modra +2018-01-17 Alan Modra * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle __tls_get_addr_opt, and alignment sizing. @@ -121,20 +1426,18 @@ Build lazy link stubs out to end of section. Build global entry stubs in new section. -2018-01-17 Nick Clifton - - * po/ru.po: Updated Russian translation. - * po/uk/po: Updated Ukranian translation. - 2018-01-15 Nick Clifton * po/uk.po: Updated Ukranian translation. 2018-01-13 Nick Clifton - * version.m4 (BFD_VERSION): Change to 2.30.0. + * po/bfd.pot: Regenerated. + +2018-01-13 Nick Clifton + + * version.m4: Bump version to 2.30.51 * configure: Regenerate. - * po/bfd.pot: Regenerate. 2018-01-13 Nick Clifton @@ -183,7 +1486,7 @@ * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY, INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section. -2017-09-27 Kuan-Lin Chen +2018-01-09 Kuan-Lin Chen PR 22662 * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error. diff --git a/bfd/aix386-core.c b/bfd/aix386-core.c index 77d068f..de3afd5 100644 --- a/bfd/aix386-core.c +++ b/bfd/aix386-core.c @@ -246,12 +246,24 @@ const bfd_target core_aix386_vec = NO_GET, NO_GETS, NO_PUT, NO_GET, NO_GETS, NO_PUT, /* hdrs */ - {_bfd_dummy_target, _bfd_dummy_target, - _bfd_dummy_target, aix386_core_file_p}, - {bfd_false, bfd_false, /* bfd_create_object */ - bfd_false, bfd_false}, - {bfd_false, bfd_false, /* bfd_write_contents */ - bfd_false, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + _bfd_dummy_target, + _bfd_dummy_target, + aix386_core_file_p + }, + { /* bfd_create_object */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), BFD_JUMP_TABLE_COPY (_bfd_generic), diff --git a/bfd/aout-adobe.c b/bfd/aout-adobe.c index 4063a8a..48189d8 100644 --- a/bfd/aout-adobe.c +++ b/bfd/aout-adobe.c @@ -123,7 +123,7 @@ aout_adobe_callback (bfd *abfd) default: _bfd_error_handler /* xgettext:c-format */ - (_("%B: Unknown section type in a.out.adobe file: %x\n"), + (_("%pB: unknown section type in a.out.adobe file: %x"), abfd, ext->e_type[0]); goto no_more_sections; } @@ -500,12 +500,24 @@ const bfd_target aout_adobe_vec = bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */ - {_bfd_dummy_target, aout_adobe_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, aout_adobe_mkobject, /* bfd_set_format. */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, aout_adobe_write_object_contents,/* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format. */ + _bfd_dummy_target, + aout_adobe_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + aout_adobe_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + aout_adobe_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (aout_32), BFD_JUMP_TABLE_COPY (_bfd_generic), diff --git a/bfd/aout-arm.c b/bfd/aout-arm.c index ac05b93..211f51f 100644 --- a/bfd/aout-arm.c +++ b/bfd/aout-arm.c @@ -483,12 +483,25 @@ const bfd_target arm_aout_le_vec = bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Headers. */ - {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format. */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, + + { /* bfd_check_format. */ + _bfd_dummy_target, + MY_object_p, + bfd_generic_archive_p, + MY_core_file_p + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + MY_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + MY_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (MY), BFD_JUMP_TABLE_COPY (MY), @@ -525,12 +538,25 @@ const bfd_target arm_aout_be_vec = bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */ - {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format. */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, + + { /* bfd_check_format. */ + _bfd_dummy_target, + MY_object_p, + bfd_generic_archive_p, + MY_core_file_p + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + MY_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + MY_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (MY), BFD_JUMP_TABLE_COPY (MY), diff --git a/bfd/aout-cris.c b/bfd/aout-cris.c index d1a2366..2b150cd 100644 --- a/bfd/aout-cris.c +++ b/bfd/aout-cris.c @@ -197,7 +197,7 @@ MY (swap_ext_reloc_out) (bfd *abfd, if (r_type > 2) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: Invalid relocation type exported: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type exported: %#x"), abfd, r_type); bfd_set_error (bfd_error_wrong_format); @@ -241,7 +241,7 @@ MY (swap_ext_reloc_in) (bfd *abfd, if (r_type > 2) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: Invalid relocation type imported: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type imported: %#x"), abfd, r_type); bfd_set_error (bfd_error_wrong_format); @@ -253,7 +253,7 @@ MY (swap_ext_reloc_in) (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Bad relocation record imported: %d"), abfd, r_index); + (_("%pB: bad relocation record imported: %d"), abfd, r_index); bfd_set_error (bfd_error_wrong_format); diff --git a/bfd/aout-target.h b/bfd/aout-target.h index cb14b98..f245b1e 100644 --- a/bfd/aout-target.h +++ b/bfd/aout-target.h @@ -407,14 +407,13 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #endif #ifndef MY_bfd_debug_info_start -#define MY_bfd_debug_info_start bfd_void +#define MY_bfd_debug_info_start _bfd_void_bfd #endif #ifndef MY_bfd_debug_info_end -#define MY_bfd_debug_info_end bfd_void +#define MY_bfd_debug_info_end _bfd_void_bfd #endif #ifndef MY_bfd_debug_info_accumulate -#define MY_bfd_debug_info_accumulate \ - (void (*) (bfd *, struct bfd_section *)) bfd_void +#define MY_bfd_debug_info_accumulate _bfd_void_bfd_asection #endif #ifndef MY_core_file_failing_command @@ -581,7 +580,7 @@ MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info) #endif #ifndef MY_bfd_is_target_special_symbol -#define MY_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define MY_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #endif #ifndef MY_bfd_free_cached_info @@ -669,12 +668,24 @@ const bfd_target MY (vec) = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Headers. */ #endif - {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format. */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format. */ + _bfd_dummy_target, + MY_object_p, + bfd_generic_archive_p, + MY_core_file_p + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + MY_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + MY_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (MY), BFD_JUMP_TABLE_COPY (MY), diff --git a/bfd/aout-tic30.c b/bfd/aout-tic30.c index d8ad415..31248ec 100644 --- a/bfd/aout-tic30.c +++ b/bfd/aout-tic30.c @@ -862,14 +862,13 @@ tic30_aout_set_arch_mach (bfd *abfd, #endif #ifndef MY_bfd_debug_info_start -#define MY_bfd_debug_info_start bfd_void +#define MY_bfd_debug_info_start _bfd_void_bfd #endif #ifndef MY_bfd_debug_info_end -#define MY_bfd_debug_info_end bfd_void +#define MY_bfd_debug_info_end _bfd_void_bfd #endif #ifndef MY_bfd_debug_info_accumulate -#define MY_bfd_debug_info_accumulate \ - (void (*) (bfd*, struct bfd_section *)) bfd_void +#define MY_bfd_debug_info_accumulate _bfd_void_bfd_asection #endif #ifndef MY_core_file_failing_command @@ -1036,8 +1035,7 @@ tic30_aout_set_arch_mach (bfd *abfd, #endif #ifndef MY_bfd_is_target_special_symbol -#define MY_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define MY_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #endif #ifndef MY_bfd_free_cached_info @@ -1099,12 +1097,24 @@ const bfd_target tic30_aout_vec = bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */ - {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format. */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format. */ + _bfd_dummy_target, + MY_object_p, + bfd_generic_archive_p, + MY_core_file_p + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + MY_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + MY_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (MY), BFD_JUMP_TABLE_COPY (MY), diff --git a/bfd/aoutf1.h b/bfd/aoutf1.h index 88ecf1e..b039d6a 100644 --- a/bfd/aoutf1.h +++ b/bfd/aoutf1.h @@ -779,9 +779,9 @@ static const struct aout_backend_data sunos4_aout_backend = #define MY_core_file_failing_signal sunos4_core_file_failing_signal #define MY_core_file_matches_executable_p sunos4_core_file_matches_executable_p -#define MY_bfd_debug_info_start bfd_void -#define MY_bfd_debug_info_end bfd_void -#define MY_bfd_debug_info_accumulate (void (*) (bfd *, struct bfd_section *)) bfd_void +#define MY_bfd_debug_info_start _bfd_void_bfd +#define MY_bfd_debug_info_end _bfd_void_bfd +#define MY_bfd_debug_info_accumulate _bfd_void_bfd_asection #define MY_core_file_p sunos4_core_file_p #define MY_write_object_contents NAME(aout, sunos4_write_object_contents) #define MY_backend_data & sunos4_aout_backend diff --git a/bfd/aoutx.h b/bfd/aoutx.h index eec9c4a..525e560 100644 --- a/bfd/aoutx.h +++ b/bfd/aoutx.h @@ -1281,7 +1281,7 @@ NAME (aout, set_section_contents) (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: can not represent section `%A' in a.out object file format"), + (_("%pB: can not represent section `%pA' in a.out object file format"), abfd, section); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -1597,7 +1597,7 @@ translate_to_native_sym_flags (bfd *abfd, file. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: can not represent section for symbol `%s' in a.out " + (_("%pB: can not represent section for symbol `%s' in a.out " "object file format"), abfd, cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*")); @@ -1633,7 +1633,7 @@ translate_to_native_sym_flags (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: can not represent section `%A' in a.out object file format"), + (_("%pB: can not represent section `%pA' in a.out object file format"), abfd, sec); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -1734,7 +1734,13 @@ NAME (aout, translate_symbol_table) (bfd *abfd, else if (x < strsize) in->symbol.name = str + x; else - return FALSE; + { + _bfd_error_handler + (_("%pB: invalid string offset %" PRIu64 " >= %" PRIu64), + abfd, (uint64_t) x, (uint64_t) strsize); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } in->symbol.value = GET_SWORD (abfd, ext->e_value); in->desc = H_GET_16 (abfd, ext->e_desc); @@ -2283,10 +2289,12 @@ NAME (aout, swap_std_reloc_in) (bfd *abfd, if (r_baserel) r_extern = 1; - if (r_extern && r_index > symcount) + if (r_extern && r_index >= symcount) { /* We could arrange to return an error, but it might be useful - to see the file even if it is bad. */ + to see the file even if it is bad. FIXME: Of course this + means that objdump -r *doesn't* see the actual reloc, and + objcopy silently writes a different reloc. */ r_extern = 0; r_index = N_ABS; } @@ -2420,7 +2428,7 @@ NAME (aout, squirt_out_relocs) (bfd *abfd, asection *section) { bfd_set_error (bfd_error_invalid_operation); _bfd_error_handler (_("\ -%B: attempt to write out unknown reloc type"), abfd); +%pB: attempt to write out unknown reloc type"), abfd); return FALSE; } MY_swap_ext_reloc_out (abfd, *generic, @@ -2438,7 +2446,7 @@ NAME (aout, squirt_out_relocs) (bfd *abfd, asection *section) { bfd_set_error (bfd_error_invalid_operation); _bfd_error_handler (_("\ -%B: attempt to write out unknown reloc type"), abfd); +%pB: attempt to write out unknown reloc type"), abfd); return FALSE; } MY_swap_std_reloc_out (abfd, *generic, @@ -4089,8 +4097,8 @@ aout_link_input_section_std (struct aout_final_link_info *flaginfo, if (howto == NULL) { - (*flaginfo->info->callbacks->einfo) - (_("%P: %B: unexpected relocation type\n"), input_bfd); + _bfd_error_handler (_("%pB: unsupported relocation type"), + input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -4410,8 +4418,8 @@ aout_link_input_section_ext (struct aout_final_link_info *flaginfo, if (r_type >= TABLE_SIZE (howto_table_ext)) { - (*flaginfo->info->callbacks->einfo) - (_("%P: %B: unexpected relocation type\n"), input_bfd); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + input_bfd, r_type); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -5437,7 +5445,7 @@ NAME (aout, final_link) (bfd *abfd, by the reloc size. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocatable link from %s to %s not supported"), + (_("%pB: relocatable link from %s to %s not supported"), abfd, sub->xvec->name, abfd->xvec->name); bfd_set_error (bfd_error_invalid_operation); goto error_return; diff --git a/bfd/archive.c b/bfd/archive.c index de08b19..d58f172 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -754,6 +754,13 @@ _bfd_generic_get_elt_at_index (bfd *abfd, symindex sym_index) return _bfd_get_elt_at_filepos (abfd, entry->file_offset); } +bfd * +_bfd_noarchive_get_elt_at_index (bfd *abfd, + symindex sym_index ATTRIBUTE_UNUSED) +{ + return (bfd *) _bfd_ptr_bfd_null_error (abfd); +} + /* FUNCTION bfd_openr_next_archived_file @@ -816,6 +823,13 @@ bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file) return _bfd_get_elt_at_filepos (archive, filestart); } +bfd * +_bfd_noarchive_openr_next_archived_file (bfd *archive, + bfd *last_file ATTRIBUTE_UNUSED) +{ + return (bfd *) _bfd_ptr_bfd_null_error (archive); +} + const bfd_target * bfd_generic_archive_p (bfd *abfd) { @@ -1586,6 +1600,15 @@ _bfd_archive_coff_construct_extended_name_table (bfd *abfd, return _bfd_construct_extended_name_table (abfd, TRUE, tabloc, tablen); } +bfd_boolean +_bfd_noarchive_construct_extended_name_table (bfd *abfd ATTRIBUTE_UNUSED, + char **tabloc ATTRIBUTE_UNUSED, + bfd_size_type *len ATTRIBUTE_UNUSED, + const char **name ATTRIBUTE_UNUSED) +{ + return TRUE; +} + /* Follows archive_head and produces an extended name table if necessary. Returns (in tabloc) a pointer to an extended name table, and in tablen the length of the table. If it makes an entry @@ -1884,6 +1907,12 @@ _bfd_bsd44_write_ar_hdr (bfd *archive, bfd *abfd) } return TRUE; } + +bfd_boolean +_bfd_noarchive_write_ar_hdr (bfd *archive, bfd *abfd ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (archive); +} /* A couple of functions for creating ar_hdrs. */ @@ -2154,6 +2183,13 @@ bfd_gnu_truncate_arname (bfd *abfd, const char *pathname, char *arhdr) if (length < 16) (hdr->ar_name)[length] = ar_padchar (abfd); } + +void +_bfd_noarchive_truncate_arname (bfd *abfd ATTRIBUTE_UNUSED, + const char *pathname ATTRIBUTE_UNUSED, + char *arhdr ATTRIBUTE_UNUSED) +{ +} /* The BFD is open for write and has its format set to bfd_archive. */ @@ -2302,7 +2338,7 @@ _bfd_write_archive_contents (bfd *arch) if (bfd_update_armap_timestamp (arch)) break; _bfd_error_handler - (_("Warning: writing archive was slow: rewriting timestamp\n")); + (_("warning: writing archive was slow: rewriting timestamp")); } while (++tries < 6); } @@ -2418,7 +2454,7 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) + (syms[src_count]->name[2] == '_'), "__gnu_lto_slim") == 0) _bfd_error_handler - (_("%B: plugin needed to handle lto object"), + (_("%pB: plugin needed to handle lto object"), current); namelen = strlen (syms[src_count]->name); amt = sizeof (char *); @@ -2834,6 +2870,17 @@ _bfd_coff_write_armap (bfd *arch, return TRUE; } +bfd_boolean +_bfd_noarchive_write_armap + (bfd *arch ATTRIBUTE_UNUSED, + unsigned int elength ATTRIBUTE_UNUSED, + struct orl *map ATTRIBUTE_UNUSED, + unsigned int orl_count ATTRIBUTE_UNUSED, + int stridx ATTRIBUTE_UNUSED) +{ + return TRUE; +} + static int archive_close_worker (void **slot, void *inf ATTRIBUTE_UNUSED) { diff --git a/bfd/archures.c b/bfd/archures.c index e83c57a..7327f5f 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -1452,3 +1452,11 @@ bfd_arch_default_fill (bfd_size_type count, memset (fill, 0, count); return fill; } + +bfd_boolean +_bfd_nowrite_set_arch_mach (bfd *abfd, + enum bfd_architecture arch ATTRIBUTE_UNUSED, + unsigned long mach ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 2195ce3..a06cd74 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -91,6 +91,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index f4b3720..c158f43 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -98,6 +98,24 @@ typedef BFD_HOST_64_BIT bfd_int64_t; typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif +#ifdef HAVE_INTTYPES_H +# include +#else +# if BFD_HOST_64BIT_LONG +# define BFD_PRI64 "l" +# elif defined (__MSVCRT__) +# define BFD_PRI64 "I64" +# else +# define BFD_PRI64 "ll" +# endif +# undef PRId64 +# define PRId64 BFD_PRI64 "d" +# undef PRIu64 +# define PRIu64 BFD_PRI64 "u" +# undef PRIx64 +# define PRIx64 BFD_PRI64 "x" +#endif + #if BFD_ARCH_SIZE >= 64 #define BFD64 #endif @@ -1324,13 +1342,10 @@ typedef struct bfd_section /* The section contains thread local data. */ #define SEC_THREAD_LOCAL 0x400 - /* The section has GOT references. This flag is only for the - linker, and is currently only used by the elf32-hppa back end. - It will be set if global offset table references were detected - in this section, which indicate to the linker that the section - contains PIC code, and must be handled specially when doing a - static link. */ -#define SEC_HAS_GOT_REF 0x800 + /* The section's size is fixed. Generic linker code will not + recalculate it and it is up to whoever has set this flag to + get the size right. */ +#define SEC_FIXED_SIZE 0x800 /* The section contains common symbols (symbols may be defined multiple times, the value of a symbol is the amount of @@ -4137,6 +4152,9 @@ and shift left by 1 for use in lhi.gp, shi.gp... */ and shift left by 0 for use in lbi.gp, sbi.gp... */ BFD_RELOC_NDS32_SDA19S0, +/* This is a 24-bit reloc for security check sum. */ + BFD_RELOC_NDS32_SECURITY_16, + /* for PIC */ BFD_RELOC_NDS32_GOT20, BFD_RELOC_NDS32_9_PLTREL, @@ -4248,18 +4266,43 @@ This is a 5 bit absolute address. */ /* For TLS. */ BFD_RELOC_NDS32_TPOFF, + BFD_RELOC_NDS32_GOTTPOFF, BFD_RELOC_NDS32_TLS_LE_HI20, BFD_RELOC_NDS32_TLS_LE_LO12, - BFD_RELOC_NDS32_TLS_LE_ADD, - BFD_RELOC_NDS32_TLS_LE_LS, - BFD_RELOC_NDS32_GOTTPOFF, - BFD_RELOC_NDS32_TLS_IE_HI20, - BFD_RELOC_NDS32_TLS_IE_LO12S2, - BFD_RELOC_NDS32_TLS_TPOFF, BFD_RELOC_NDS32_TLS_LE_20, BFD_RELOC_NDS32_TLS_LE_15S0, BFD_RELOC_NDS32_TLS_LE_15S1, BFD_RELOC_NDS32_TLS_LE_15S2, + BFD_RELOC_NDS32_TLS_LE_ADD, + BFD_RELOC_NDS32_TLS_LE_LS, + BFD_RELOC_NDS32_TLS_IE_HI20, + BFD_RELOC_NDS32_TLS_IE_LO12, + BFD_RELOC_NDS32_TLS_IE_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_HI20, + BFD_RELOC_NDS32_TLS_IEGP_LO12, + BFD_RELOC_NDS32_TLS_IEGP_LO12S2, + BFD_RELOC_NDS32_TLS_IEGP_LW, + BFD_RELOC_NDS32_TLS_DESC, + BFD_RELOC_NDS32_TLS_DESC_HI20, + BFD_RELOC_NDS32_TLS_DESC_LO12, + BFD_RELOC_NDS32_TLS_DESC_20, + BFD_RELOC_NDS32_TLS_DESC_SDA17S2, + BFD_RELOC_NDS32_TLS_DESC_ADD, + BFD_RELOC_NDS32_TLS_DESC_FUNC, + BFD_RELOC_NDS32_TLS_DESC_CALL, + BFD_RELOC_NDS32_TLS_DESC_MEM, + BFD_RELOC_NDS32_REMOVE, + BFD_RELOC_NDS32_GROUP, + +/* Jump-patch table relative relocations. */ + BFD_RELOC_NDS32_ICT, + BFD_RELOC_NDS32_ICT_HI20, + BFD_RELOC_NDS32_ICT_LO12, + BFD_RELOC_NDS32_ICT_25PC, + BFD_RELOC_NDS32_ICT_LO12S2, + +/* For bug 12566. */ + BFD_RELOC_NDS32_LSI, /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -5957,6 +6000,36 @@ of a signed value. Changes instruction to MOVZ or MOVN depending on the value's sign. */ BFD_RELOC_AARCH64_MOVW_G2_S, +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0, + +/* AArch64 MOV[NZ] instruction with most significant bits 0 to 15 +of a signed value. Changes instruction to MOVZ or MOVN depending on the +value's sign. */ + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1, + +/* AArch64 MOVK instruction with most significant bits 16 to 31 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2, + +/* AArch64 MOVK instruction with most significant bits 32 to 47 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + +/* AArch64 MOVK instruction with most significant bits 47 to 63 +of a signed value. */ + BFD_RELOC_AARCH64_MOVW_PREL_G3, + /* AArch64 Load Literal instruction, holding a 19 bit pc-relative word offset. The lowest two bits must be zero and are not stored in the instruction, giving a 21 bit signed byte offset. */ diff --git a/bfd/bfd.c b/bfd/bfd.c index 985c825..288b5b1 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -451,28 +451,28 @@ static bfd_error_type input_error = bfd_error_no_error; const char *const bfd_errmsgs[] = { - N_("No error"), - N_("System call error"), - N_("Invalid bfd target"), - N_("File in wrong format"), - N_("Archive object file in wrong format"), - N_("Invalid operation"), - N_("Memory exhausted"), - N_("No symbols"), - N_("Archive has no index; run ranlib to add one"), - N_("No more archived files"), - N_("Malformed archive"), + N_("no error"), + N_("system call error"), + N_("invalid bfd target"), + N_("file in wrong format"), + N_("archive object file in wrong format"), + N_("invalid operation"), + N_("memory exhausted"), + N_("no symbols"), + N_("archive has no index; run ranlib to add one"), + N_("no more archived files"), + N_("malformed archive"), N_("DSO missing from command line"), - N_("File format not recognized"), - N_("File format is ambiguous"), - N_("Section has no contents"), - N_("Nonrepresentable section on output"), - N_("Symbol needs debug section which does not exist"), - N_("Bad value"), - N_("File truncated"), - N_("File too big"), - N_("Error reading %s: %s"), - N_("#") + N_("file format not recognized"), + N_("file format is ambiguous"), + N_("section has no contents"), + N_("nonrepresentable section on output"), + N_("symbol needs debug section which does not exist"), + N_("bad value"), + N_("file truncated"), + N_("file too big"), + N_("error reading %s: %s"), + N_("#") }; /* @@ -649,10 +649,7 @@ union _bfd_doprnt_args }; /* This macro and _bfd_doprnt taken from libiberty _doprnt.c, tidied a - little and extended to handle '%A', '%B' and positional parameters. - 'L' as a modifer for integer formats is used for bfd_vma and - bfd_size_type args, which vary in size depending on BFD - configuration. */ + little and extended to handle '%pA', '%pB' and positional parameters. */ #define PRINT_TYPE(TYPE, FIELD) \ do \ @@ -800,21 +797,6 @@ _bfd_doprnt (FILE *stream, const char *format, union _bfd_doprnt_args *args) PRINT_TYPE (int, i); else { - /* L modifier for bfd_vma or bfd_size_type may be - either long long or long. */ - if (ptr[-2] == 'L') - { - sptr[-2] = 'l'; - if (BFD_ARCH_SIZE < 64 || BFD_HOST_64BIT_LONG) - wide_width = 1; - else - { - sptr[-1] = 'l'; - *sptr++ = ptr[-1]; - *sptr = '\0'; - } - } - switch (wide_width) { case 0: @@ -866,53 +848,55 @@ _bfd_doprnt (FILE *stream, const char *format, union _bfd_doprnt_args *args) PRINT_TYPE (char *, p); break; case 'p': - PRINT_TYPE (void *, p); - break; - case 'A': - { - asection *sec; - bfd *abfd; - const char *group = NULL; - struct coff_comdat_info *ci; - - sec = (asection *) args[arg_no].p; - if (sec == NULL) - /* Invoking %A with a null section pointer is an - internal error. */ - abort (); - abfd = sec->owner; - if (abfd != NULL - && bfd_get_flavour (abfd) == bfd_target_elf_flavour - && elf_next_in_group (sec) != NULL - && (sec->flags & SEC_GROUP) == 0) - group = elf_group_name (sec); - else if (abfd != NULL - && bfd_get_flavour (abfd) == bfd_target_coff_flavour - && (ci = bfd_coff_get_comdat_section (sec->owner, - sec)) != NULL) - group = ci->name; - if (group != NULL) - result = fprintf (stream, "%s[%s]", sec->name, group); - else - result = fprintf (stream, "%s", sec->name); - } - break; - case 'B': - { - bfd *abfd; - - abfd = (bfd *) args[arg_no].p; - if (abfd == NULL) - /* Invoking %B with a null bfd pointer is an - internal error. */ - abort (); - else if (abfd->my_archive - && !bfd_is_thin_archive (abfd->my_archive)) - result = fprintf (stream, "%s(%s)", - abfd->my_archive->filename, abfd->filename); - else - result = fprintf (stream, "%s", abfd->filename); - } + if (*ptr == 'A') + { + asection *sec; + bfd *abfd; + const char *group = NULL; + struct coff_comdat_info *ci; + + ptr++; + sec = (asection *) args[arg_no].p; + if (sec == NULL) + /* Invoking %pA with a null section pointer is an + internal error. */ + abort (); + abfd = sec->owner; + if (abfd != NULL + && bfd_get_flavour (abfd) == bfd_target_elf_flavour + && elf_next_in_group (sec) != NULL + && (sec->flags & SEC_GROUP) == 0) + group = elf_group_name (sec); + else if (abfd != NULL + && bfd_get_flavour (abfd) == bfd_target_coff_flavour + && (ci = bfd_coff_get_comdat_section (sec->owner, + sec)) != NULL) + group = ci->name; + if (group != NULL) + result = fprintf (stream, "%s[%s]", sec->name, group); + else + result = fprintf (stream, "%s", sec->name); + } + else if (*ptr == 'B') + { + bfd *abfd; + + ptr++; + abfd = (bfd *) args[arg_no].p; + if (abfd == NULL) + /* Invoking %pB with a null bfd pointer is an + internal error. */ + abort (); + else if (abfd->my_archive + && !bfd_is_thin_archive (abfd->my_archive)) + result = fprintf (stream, "%s(%s)", + abfd->my_archive->filename, + abfd->filename); + else + result = fprintf (stream, "%s", abfd->filename); + } + else + PRINT_TYPE (void *, p); break; default: abort(); @@ -1049,12 +1033,6 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args) arg_type = Int; else { - if (ptr[-2] == 'L') - { - if (BFD_ARCH_SIZE < 64 || BFD_HOST_64BIT_LONG) - wide_width = 1; - } - switch (wide_width) { case 0: @@ -1094,9 +1072,11 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args) } break; case 's': + arg_type = Ptr; + break; case 'p': - case 'A': - case 'B': + if (*ptr == 'A' || *ptr == 'B') + ptr++; arg_type = Ptr; break; default: @@ -1116,8 +1096,8 @@ _bfd_doprnt_scan (const char *format, union _bfd_doprnt_args *args) /* This is the default routine to handle BFD error messages. Like fprintf (stderr, ...), but also handles some extra format specifiers. - %A section name from section. For group components, prints group name too. - %B file name from bfd. For archive components, prints archive too. + %pA section name from section. For group components, prints group name too. + %pB file name from bfd. For archive components, prints archive too. Beware: Only supports a maximum of 9 format arguments. */ diff --git a/bfd/binary.c b/bfd/binary.c index 518b845..0713f5a 100644 --- a/bfd/binary.c +++ b/bfd/binary.c @@ -211,7 +211,7 @@ binary_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, #define binary_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define binary_read_minisymbols _bfd_generic_read_minisymbols #define binary_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol -#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define binary_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false /* Set the architecture of a binary file. */ #define binary_set_arch_mach _bfd_generic_set_arch_mach @@ -273,7 +273,7 @@ binary_set_section_contents (bfd *abfd, if (s->filepos < 0) _bfd_error_handler /* xgettext:c-format */ - (_("warning: writing section `%A' at huge (ie negative) " + (_("warning: writing section `%pA' at huge (ie negative) " "file offset"), s); } @@ -346,16 +346,16 @@ const bfd_target binary_vec = _bfd_dummy_target, }, { /* bfd_set_format */ - bfd_false, + _bfd_bool_bfd_false_error, binary_mkobject, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents */ - bfd_false, - bfd_true, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_true, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (binary), diff --git a/bfd/bout.c b/bfd/bout.c index 1098cf9..c766633 100644 --- a/bfd/bout.c +++ b/bfd/bout.c @@ -1417,24 +1417,37 @@ const bfd_target bout_be_vec = bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers. */ - {_bfd_dummy_target, b_out_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, b_out_mkobject, /* bfd_set_format. */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, b_out_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (aout_32), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), - BFD_JUMP_TABLE_SYMBOLS (aout_32), - BFD_JUMP_TABLE_RELOCS (b_out), - BFD_JUMP_TABLE_WRITE (b_out), - BFD_JUMP_TABLE_LINK (b_out), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - & bout_le_vec, + + { /* bfd_check_format. */ + _bfd_dummy_target, + b_out_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + b_out_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + b_out_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (b_out), + BFD_JUMP_TABLE_WRITE (b_out), + BFD_JUMP_TABLE_LINK (b_out), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &bout_le_vec, NULL }; @@ -1460,24 +1473,36 @@ const bfd_target bout_le_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Headers. */ - {_bfd_dummy_target, b_out_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, b_out_mkobject, /* bfd_set_format. */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, b_out_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (aout_32), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), - BFD_JUMP_TABLE_SYMBOLS (aout_32), - BFD_JUMP_TABLE_RELOCS (b_out), - BFD_JUMP_TABLE_WRITE (b_out), - BFD_JUMP_TABLE_LINK (b_out), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - & bout_be_vec, + { /* bfd_check_format. */ + _bfd_dummy_target, + b_out_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + b_out_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + b_out_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (b_out), + BFD_JUMP_TABLE_WRITE (b_out), + BFD_JUMP_TABLE_LINK (b_out), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &bout_be_vec, NULL }; diff --git a/bfd/cache.c b/bfd/cache.c index d33301f..4b14043 100644 --- a/bfd/cache.c +++ b/bfd/cache.c @@ -270,7 +270,7 @@ bfd_cache_lookup_worker (bfd *abfd, enum cache_flag flag) return (FILE *) abfd->iostream; /* xgettext:c-format */ - _bfd_error_handler (_("reopening %B: %s\n"), + _bfd_error_handler (_("reopening %pB: %s\n"), orig_bfd, bfd_errmsg (bfd_get_error ())); return NULL; } diff --git a/bfd/cisco-core.c b/bfd/cisco-core.c index e591ef6..7c0654b 100644 --- a/bfd/cisco-core.c +++ b/bfd/cisco-core.c @@ -317,102 +317,110 @@ extern const bfd_target core_cisco_le_vec; const bfd_target core_cisco_be_vec = { - "cisco-ios-core-big", - bfd_target_unknown_flavour, - BFD_ENDIAN_BIG, /* target byte order */ - BFD_ENDIAN_BIG, /* target headers byte order */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* symbol prefix */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ - 0, /* match priority. */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - { /* bfd_check_format */ - _bfd_dummy_target, /* unknown format */ - _bfd_dummy_target, /* object file */ - _bfd_dummy_target, /* archive */ - cisco_core_file_p /* a core file */ - }, - { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false - }, - { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false - }, - - BFD_JUMP_TABLE_GENERIC (_bfd_generic), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (cisco), - BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), - BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), - BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), - BFD_JUMP_TABLE_WRITE (_bfd_generic), - BFD_JUMP_TABLE_LINK (_bfd_nolink), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - & core_cisco_le_vec, - - NULL /* backend_data */ + "cisco-ios-core-big", + bfd_target_unknown_flavour, + BFD_ENDIAN_BIG, /* target byte order */ + BFD_ENDIAN_BIG, /* target headers byte order */ + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + 0, /* symbol prefix */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + 0, /* match priority. */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + { /* bfd_check_format */ + _bfd_dummy_target, /* unknown format */ + _bfd_dummy_target, /* object file */ + _bfd_dummy_target, /* archive */ + cisco_core_file_p /* a core file */ + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (cisco), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &core_cisco_le_vec, + + NULL /* backend_data */ }; const bfd_target core_cisco_le_vec = { - "cisco-ios-core-little", - bfd_target_unknown_flavour, - BFD_ENDIAN_LITTLE, /* target byte order */ - BFD_ENDIAN_LITTLE, /* target headers byte order */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* symbol prefix */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ - 0, /* match_priority */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ - bfd_getl64, bfd_getl_signed_64, bfd_putl64, - bfd_getl32, bfd_getl_signed_32, bfd_putl32, - bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - - { /* bfd_check_format */ - _bfd_dummy_target, /* unknown format */ - _bfd_dummy_target, /* object file */ - _bfd_dummy_target, /* archive */ - cisco_core_file_p /* a core file */ - }, - { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false - }, - { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false - }, - - BFD_JUMP_TABLE_GENERIC (_bfd_generic), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (cisco), - BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), - BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), - BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), - BFD_JUMP_TABLE_WRITE (_bfd_generic), - BFD_JUMP_TABLE_LINK (_bfd_nolink), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - &core_cisco_be_vec, - - NULL /* backend_data */ + "cisco-ios-core-little", + bfd_target_unknown_flavour, + BFD_ENDIAN_LITTLE, /* target byte order */ + BFD_ENDIAN_LITTLE, /* target headers byte order */ + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + 0, /* symbol prefix */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + 0, /* match_priority */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + + { /* bfd_check_format */ + _bfd_dummy_target, /* unknown format */ + _bfd_dummy_target, /* object file */ + _bfd_dummy_target, /* archive */ + cisco_core_file_p /* a core file */ + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (cisco), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &core_cisco_be_vec, + + NULL /* backend_data */ }; diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index fe8669f..0e39f31 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -447,8 +447,8 @@ alpha_ecoff_bad_format_hook (bfd *abfd ATTRIBUTE_UNUSED, if (ALPHA_ECOFF_COMPRESSEDMAG (*internal_f)) _bfd_error_handler - (_("%B: Cannot handle compressed Alpha binaries.\n" - " Use compiler flags, or objZ, to generate uncompressed binaries."), + (_("%pB: cannot handle compressed Alpha binaries; " + "use compiler flags, or objZ, to generate uncompressed binaries"), abfd); return FALSE; @@ -598,9 +598,8 @@ alpha_adjust_reloc_in (bfd *abfd, if (intern->r_type > ALPHA_R_GPVALUE) { /* xgettext:c-format */ - _bfd_error_handler - (_("%B: unknown/unsupported relocation type %d"), - abfd, intern->r_type); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, intern->r_type); bfd_set_error (bfd_error_bad_value); rptr->addend = 0; rptr->howto = NULL; @@ -1499,24 +1498,21 @@ alpha_relocate_section (bfd *output_bfd, switch (r_type) { case ALPHA_R_GPRELHIGH: - _bfd_error_handler - (_("%B: unsupported relocation: ALPHA_R_GPRELHIGH"), - input_bfd); + _bfd_error_handler (_("%pB: %s unsupported"), + input_bfd, "ALPHA_R_GPRELHIGH"); bfd_set_error (bfd_error_bad_value); continue; case ALPHA_R_GPRELLOW: - _bfd_error_handler - (_("%B: unsupported relocation: ALPHA_R_GPRELLOW"), - input_bfd); + _bfd_error_handler (_("%pB: %s unsupported"), + input_bfd, "ALPHA_R_GPRELLOW"); bfd_set_error (bfd_error_bad_value); continue; default: - _bfd_error_handler - /* xgettext:c-format */ - (_("%B: unknown relocation type %d"), - input_bfd, (int) r_type); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); continue; @@ -2218,6 +2214,67 @@ alpha_ecoff_get_elt_at_index (bfd *abfd, symindex sym_index) entry = bfd_ardata (abfd)->symdefs + sym_index; return alpha_ecoff_get_elt_at_filepos (abfd, entry->file_offset); } + +static void +alpha_ecoff_swap_coff_aux_in (bfd *abfd ATTRIBUTE_UNUSED, + void *ext1 ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED, + int in_class ATTRIBUTE_UNUSED, + int indx ATTRIBUTE_UNUSED, + int numaux ATTRIBUTE_UNUSED, + void *in1 ATTRIBUTE_UNUSED) +{ +} + +static void +alpha_ecoff_swap_coff_sym_in (bfd *abfd ATTRIBUTE_UNUSED, + void *ext1 ATTRIBUTE_UNUSED, + void *in1 ATTRIBUTE_UNUSED) +{ +} + +static void +alpha_ecoff_swap_coff_lineno_in (bfd *abfd ATTRIBUTE_UNUSED, + void *ext1 ATTRIBUTE_UNUSED, + void *in1 ATTRIBUTE_UNUSED) +{ +} + +static unsigned int +alpha_ecoff_swap_coff_aux_out (bfd *abfd ATTRIBUTE_UNUSED, + void *inp ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED, + int in_class ATTRIBUTE_UNUSED, + int indx ATTRIBUTE_UNUSED, + int numaux ATTRIBUTE_UNUSED, + void *extp ATTRIBUTE_UNUSED) +{ + return 0; +} + +static unsigned int +alpha_ecoff_swap_coff_sym_out (bfd *abfd ATTRIBUTE_UNUSED, + void *inp ATTRIBUTE_UNUSED, + void *extp ATTRIBUTE_UNUSED) +{ + return 0; +} + +static unsigned int +alpha_ecoff_swap_coff_lineno_out (bfd *abfd ATTRIBUTE_UNUSED, + void *inp ATTRIBUTE_UNUSED, + void *extp ATTRIBUTE_UNUSED) +{ + return 0; +} + +static unsigned int +alpha_ecoff_swap_coff_reloc_out (bfd *abfd ATTRIBUTE_UNUSED, + void *inp ATTRIBUTE_UNUSED, + void *extp ATTRIBUTE_UNUSED) +{ + return 0; +} /* This is the ECOFF backend structure. The backend field of the target vector points to this. */ @@ -2226,13 +2283,10 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = { /* COFF backend structure. */ { - (void (*) (bfd *,void *,int,int,int,int,void *)) bfd_void, /* aux_in */ - (void (*) (bfd *,void *,void *)) bfd_void, /* sym_in */ - (void (*) (bfd *,void *,void *)) bfd_void, /* lineno_in */ - (unsigned (*) (bfd *,void *,int,int,int,int,void *)) bfd_void,/*aux_out*/ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* sym_out */ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* lineno_out */ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* reloc_out */ + alpha_ecoff_swap_coff_aux_in, alpha_ecoff_swap_coff_sym_in, + alpha_ecoff_swap_coff_lineno_in, alpha_ecoff_swap_coff_aux_out, + alpha_ecoff_swap_coff_sym_out, alpha_ecoff_swap_coff_lineno_out, + alpha_ecoff_swap_coff_reloc_out, alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out, alpha_ecoff_swap_scnhdr_out, FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, @@ -2353,9 +2407,9 @@ const bfd_target alpha_ecoff_le_vec = BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), 0, /* leading underscore */ @@ -2369,24 +2423,36 @@ const bfd_target alpha_ecoff_le_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, alpha_ecoff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, _bfd_ecoff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), - BFD_JUMP_TABLE_COPY (_bfd_ecoff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (alpha_ecoff), - BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), - BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), - BFD_JUMP_TABLE_WRITE (_bfd_ecoff), - BFD_JUMP_TABLE_LINK (_bfd_ecoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { /* bfd_check_format */ + _bfd_dummy_target, + alpha_ecoff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + _bfd_ecoff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + _bfd_ecoff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), + BFD_JUMP_TABLE_COPY (_bfd_ecoff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (alpha_ecoff), + BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), + BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), + BFD_JUMP_TABLE_WRITE (_bfd_ecoff), + BFD_JUMP_TABLE_LINK (_bfd_ecoff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - & alpha_ecoff_backend_data + &alpha_ecoff_backend_data }; diff --git a/bfd/coff-arm.c b/bfd/coff-arm.c index 4e80a59..ca107b1 100644 --- a/bfd/coff-arm.c +++ b/bfd/coff-arm.c @@ -1034,7 +1034,7 @@ find_thumb_glue (struct bfd_link_info *info, if (myh == NULL) /* xgettext:c-format */ - _bfd_error_handler (_("%B: unable to find THUMB glue '%s' for `%s'"), + _bfd_error_handler (_("%pB: unable to find THUMB glue '%s' for `%s'"), input_bfd, tmp_name, name); free (tmp_name); @@ -1063,7 +1063,7 @@ find_arm_glue (struct bfd_link_info *info, if (myh == NULL) /* xgettext:c-format */ - _bfd_error_handler (_("%B: unable to find ARM glue '%s' for `%s'"), + _bfd_error_handler (_("%pB: unable to find ARM glue '%s' for `%s'"), input_bfd, tmp_name, name); free (tmp_name); @@ -1365,8 +1365,8 @@ coff_arm_relocate_section (bfd *output_bfd, && ! INTERWORK_FLAG (h_sec->owner)) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%s): warning: interworking not enabled.\n" - " first occurrence: %B: arm call to thumb"), + (_("%pB(%s): warning: interworking not enabled; " + "first occurrence: %pB: arm call to thumb"), h_sec->owner, name, input_bfd); --my_offset; @@ -1455,9 +1455,10 @@ coff_arm_relocate_section (bfd *output_bfd, && ! globals->support_old_code) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%s): warning: interworking not enabled.\n" - " first occurrence: %B: thumb call to arm\n" - " consider relinking with --support-old-code enabled"), + (_("%pB(%s): warning: interworking not enabled; " + "first occurrence: %pB: thumb call to arm; " + "consider relinking with --support-old-code " + "enabled"), h_sec->owner, name, input_bfd); -- my_offset; @@ -1748,8 +1749,8 @@ coff_arm_relocate_section (bfd *output_bfd, case bfd_reloc_outofrange: _bfd_error_handler /* xgettext:c-format */ - (_("%B: bad reloc address %#Lx in section `%A'"), - input_bfd, rel->r_vaddr, input_section); + (_("%pB: bad reloc address %#" PRIx64 " in section `%pA'"), + input_bfd, (uint64_t) rel->r_vaddr, input_section); return FALSE; case bfd_reloc_overflow: { @@ -2073,7 +2074,7 @@ bfd_arm_process_before_allocation (bfd * abfd, if (symndx >= obj_conv_table_size (abfd)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: illegal symbol index in reloc: %ld"), + _bfd_error_handler (_("%pB: illegal symbol index in reloc: %ld"), abfd, symndx); continue; } @@ -2205,7 +2206,7 @@ coff_arm_merge_private_bfd_data (bfd * ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext: c-format */ - (_("error: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"), + (_("error: %pB is compiled for APCS-%d, whereas %pB is compiled for APCS-%d"), ibfd, APCS_26_FLAG (ibfd) ? 26 : 32, obfd, APCS_26_FLAG (obfd) ? 26 : 32 ); @@ -2219,12 +2220,12 @@ coff_arm_merge_private_bfd_data (bfd * ibfd, struct bfd_link_info *info) if (APCS_FLOAT_FLAG (ibfd)) /* xgettext: c-format */ _bfd_error_handler (_("\ -error: %B passes floats in float registers, whereas %B passes them in integer registers"), +error: %pB passes floats in float registers, whereas %pB passes them in integer registers"), ibfd, obfd); else /* xgettext: c-format */ _bfd_error_handler (_("\ -error: %B passes floats in integer registers, whereas %B passes them in float registers"), +error: %pB passes floats in integer registers, whereas %pB passes them in float registers"), ibfd, obfd); bfd_set_error (bfd_error_wrong_format); @@ -2236,12 +2237,12 @@ error: %B passes floats in integer registers, whereas %B passes them in float re if (PIC_FLAG (ibfd)) /* xgettext: c-format */ _bfd_error_handler (_("\ -error: %B is compiled as position independent code, whereas target %B is absolute position"), +error: %pB is compiled as position independent code, whereas target %pB is absolute position"), ibfd, obfd); else /* xgettext: c-format */ _bfd_error_handler (_("\ -error: %B is compiled as absolute position code, whereas target %B is position independent"), +error: %pB is compiled as absolute position code, whereas target %pB is position independent"), ibfd, obfd); bfd_set_error (bfd_error_wrong_format); @@ -2268,12 +2269,12 @@ error: %B is compiled as absolute position code, whereas target %B is position i if (INTERWORK_FLAG (ibfd)) /* xgettext: c-format */ _bfd_error_handler (_("\ -Warning: %B supports interworking, whereas %B does not"), +warning: %pB supports interworking, whereas %pB does not"), ibfd, obfd); else /* xgettext: c-format */ _bfd_error_handler (_("\ -Warning: %B does not support interworking, whereas %B does"), +warning: %pB does not support interworking, whereas %pB does"), ibfd, obfd); } } @@ -2363,10 +2364,10 @@ _bfd_coff_arm_set_private_flags (bfd * abfd, flagword flags) if (INTERWORK_SET (abfd) && (INTERWORK_FLAG (abfd) != flag)) { if (flag) - _bfd_error_handler (_("Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"), + _bfd_error_handler (_("warning: not setting interworking flag of %pB since it has already been specified as non-interworking"), abfd); else - _bfd_error_handler (_("Warning: Clearing the interworking flag of %B due to outside request"), + _bfd_error_handler (_("warning: clearing the interworking flag of %pB due to outside request"), abfd); flag = 0; } @@ -2424,7 +2425,7 @@ coff_arm_copy_private_bfd_data (bfd * src, bfd * dest) { /* xgettext:c-format */ _bfd_error_handler (_("\ -Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"), +warning: clearing the interworking flag of %pB because non-interworking code in %pB has been linked with it"), dest, src); } diff --git a/bfd/coff-i386.c b/bfd/coff-i386.c index 8b8f601..9782206 100644 --- a/bfd/coff-i386.c +++ b/bfd/coff-i386.c @@ -661,27 +661,44 @@ const bfd_target bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ /* Note that we allow an object file to be treated as a core file as well. */ - /* bfd_check_format */ + #ifdef COFF_CHECK_FORMAT - {_bfd_dummy_target, COFF_CHECK_FORMAT, - bfd_generic_archive_p, COFF_CHECK_FORMAT}, + { /* bfd_check_format */ + _bfd_dummy_target, + COFF_CHECK_FORMAT, + bfd_generic_archive_p, + COFF_CHECK_FORMAT + }, #else - {_bfd_dummy_target, coff_object_p, bfd_generic_archive_p, coff_object_p}, + { + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + coff_object_p + }, #endif - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, diff --git a/bfd/coff-i860.c b/bfd/coff-i860.c index 13c84af..9ff96ea 100644 --- a/bfd/coff-i860.c +++ b/bfd/coff-i860.c @@ -139,7 +139,7 @@ coff_i860_reloc (bfd *abfd, these relocations. */ static bfd_reloc_status_type -coff_i860_reloc_nyi (bfd *abfd ATTRIBUTE_UNUSED, +coff_i860_reloc_nyi (bfd *abfd, arelent *reloc_entry, asymbol *symbol ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED, @@ -148,7 +148,7 @@ coff_i860_reloc_nyi (bfd *abfd ATTRIBUTE_UNUSED, char **error_message ATTRIBUTE_UNUSED) { reloc_howto_type *howto = reloc_entry->howto; - _bfd_error_handler (_("relocation `%s' not yet implemented"), howto->name); + _bfd_error_handler (_("%pB: %s unsupported"), abfd, howto->name); return bfd_reloc_notsupported; } @@ -610,7 +610,7 @@ i860_reloc_processing (arelent *cache_ptr, struct internal_reloc *dst, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: warning: illegal symbol index %ld in relocs"), + (_("%pB: warning: illegal symbol index %ld in relocs"), abfd, dst->r_symndx); cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; ptr = NULL; @@ -677,9 +677,9 @@ const bfd_target BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading underscore */ @@ -695,22 +695,34 @@ const bfd_target bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ /* Note that we allow an object file to be treated as a core file as well. */ - {_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, i3coff_object_p}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { /* bfd_check_format */ + _bfd_dummy_target, + i3coff_object_p, + bfd_generic_archive_p, + i3coff_object_p + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, diff --git a/bfd/coff-i960.c b/bfd/coff-i960.c index 8b91bfe..4e68d44 100644 --- a/bfd/coff-i960.c +++ b/bfd/coff-i960.c @@ -614,9 +614,9 @@ const bfd_target icoff_be_vec = BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading underscore */ @@ -624,31 +624,43 @@ const bfd_target icoff_be_vec = 15, /* ar_max_namelen */ 0, /* match priority. */ -bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ -bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - & icoff_le_vec, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &icoff_le_vec, COFF_SWAP_TABLE }; diff --git a/bfd/coff-ia64.c b/bfd/coff-ia64.c index 56100dd..dfe8d94 100644 --- a/bfd/coff-ia64.c +++ b/bfd/coff-ia64.c @@ -72,7 +72,7 @@ ia64coff_object_p (bfd *abfd) { #ifdef COFF_IMAGE_WITH_PE { - struct external_PEI_DOS_hdr dos_hdr; + struct external_DOS_hdr dos_hdr; struct external_PEI_IMAGE_hdr image_hdr; file_ptr offset; @@ -87,7 +87,7 @@ ia64coff_object_p (bfd *abfd) /* There are really two magic numbers involved; the magic number that says this is a NT executable (PEI) and the magic number - that determines the architecture. The former is DOSMAGIC, + that determines the architecture. The former is IMAGE_DOS_SIGNATURE, stored in the e_magic field. The latter is stored in the f_magic field. If the NT magic number isn't valid, the architecture magic number could be mimicked by some other @@ -95,7 +95,7 @@ ia64coff_object_p (bfd *abfd) this routine can only be called correctly for a PEI file, check the e_magic number here, and, if it doesn't match, clobber the f_magic number so that we don't get a false match. */ - if (H_GET_16 (abfd, dos_hdr.e_magic) != DOSMAGIC) + if (H_GET_16 (abfd, dos_hdr.e_magic) != IMAGE_DOS_SIGNATURE) { bfd_set_error (bfd_error_wrong_format); return NULL; @@ -149,9 +149,9 @@ const bfd_target BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), #ifndef COFF_WITH_PE (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ @@ -179,22 +179,34 @@ const bfd_target bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ /* Note that we allow an object file to be treated as a core file as well. */ - {_bfd_dummy_target, ia64coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, ia64coff_object_p}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (coff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { /* bfd_check_format */ + _bfd_dummy_target, + ia64coff_object_p, + bfd_generic_archive_p, + ia64coff_object_p + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c index 0fbff22..f7777a1 100644 --- a/bfd/coff-m68k.c +++ b/bfd/coff-m68k.c @@ -485,7 +485,7 @@ bfd_m68k_coff_create_embedded_relocs (bfd *abfd, /* We can only relocate absolute longword relocs at run time. */ if (irel->r_type != R_RELLONG) { - *errmsg = _("unsupported reloc type"); + *errmsg = _("unsupported relocation type"); bfd_set_error (bfd_error_bad_value); return FALSE; } diff --git a/bfd/coff-mcore.c b/bfd/coff-mcore.c index 80432d1..2327d72 100644 --- a/bfd/coff-mcore.c +++ b/bfd/coff-mcore.c @@ -242,7 +242,7 @@ mcore_coff_unsupported_reloc (bfd * abfd, BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0); /* xgettext: c-format */ - _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"), + _bfd_error_handler (_("%pB: Relocation %s (%d) is not currently supported.\n"), abfd, reloc_entry->howto->name, reloc_entry->howto->type); @@ -368,7 +368,7 @@ coff_mcore_relocate_section (bfd * output_bfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: compiled for a %s system and target is %s.\n"), + (_("%pB: compiled for a %s system and target is %s.\n"), input_bfd, bfd_big_endian (input_bfd) ? _("big endian") : _("little endian"), bfd_big_endian (output_bfd) ? _("big endian") : _("little endian")); @@ -470,7 +470,7 @@ coff_mcore_relocate_section (bfd * output_bfd, { default: /* xgettext: c-format */ - _bfd_error_handler (_("%B: unsupported relocation type 0x%02x"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), input_bfd, r_type); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -478,10 +478,11 @@ coff_mcore_relocate_section (bfd * output_bfd, case IMAGE_REL_MCORE_ABSOLUTE: _bfd_error_handler /* xgettext: c-format */ - (_("Warning: unsupported reloc %s \n" - "sym %ld (%s), r_vaddr %Ld (%#Lx)"), + (_("warning: unsupported reloc %s \n" + "sym %ld (%s), r_vaddr %" PRId64 " (%#" PRIx64 ")"), howto->name, input_bfd, input_section, - rel->r_symndx, my_name, rel->r_vaddr, rel->r_vaddr); + rel->r_symndx, my_name, (int64_t) rel->r_vaddr, + (uint64_t) rel->r_vaddr); break; case IMAGE_REL_MCORE_PCREL_IMM8BY4: diff --git a/bfd/coff-mips.c b/bfd/coff-mips.c index 2891133..3a0163a 100644 --- a/bfd/coff-mips.c +++ b/bfd/coff-mips.c @@ -1236,6 +1236,67 @@ mips_relocate_section (bfd *output_bfd, return TRUE; } + +static void +mips_ecoff_swap_coff_aux_in (bfd *abfd ATTRIBUTE_UNUSED, + void *ext1 ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED, + int in_class ATTRIBUTE_UNUSED, + int indx ATTRIBUTE_UNUSED, + int numaux ATTRIBUTE_UNUSED, + void *in1 ATTRIBUTE_UNUSED) +{ +} + +static void +mips_ecoff_swap_coff_sym_in (bfd *abfd ATTRIBUTE_UNUSED, + void *ext1 ATTRIBUTE_UNUSED, + void *in1 ATTRIBUTE_UNUSED) +{ +} + +static void +mips_ecoff_swap_coff_lineno_in (bfd *abfd ATTRIBUTE_UNUSED, + void *ext1 ATTRIBUTE_UNUSED, + void *in1 ATTRIBUTE_UNUSED) +{ +} + +static unsigned int +mips_ecoff_swap_coff_aux_out (bfd *abfd ATTRIBUTE_UNUSED, + void *inp ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED, + int in_class ATTRIBUTE_UNUSED, + int indx ATTRIBUTE_UNUSED, + int numaux ATTRIBUTE_UNUSED, + void *extp ATTRIBUTE_UNUSED) +{ + return 0; +} + +static unsigned int +mips_ecoff_swap_coff_sym_out (bfd *abfd ATTRIBUTE_UNUSED, + void *inp ATTRIBUTE_UNUSED, + void *extp ATTRIBUTE_UNUSED) +{ + return 0; +} + +static unsigned int +mips_ecoff_swap_coff_lineno_out (bfd *abfd ATTRIBUTE_UNUSED, + void *inp ATTRIBUTE_UNUSED, + void *extp ATTRIBUTE_UNUSED) +{ + return 0; +} + +static unsigned int +mips_ecoff_swap_coff_reloc_out (bfd *abfd ATTRIBUTE_UNUSED, + void *inp ATTRIBUTE_UNUSED, + void *extp ATTRIBUTE_UNUSED) +{ + return 0; +} /* This is the ECOFF backend structure. The backend field of the target vector points to this. */ @@ -1244,13 +1305,10 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = { /* COFF backend structure. */ { - (void (*) (bfd *,void *,int,int,int,int,void *)) bfd_void, /* aux_in */ - (void (*) (bfd *,void *,void *)) bfd_void, /* sym_in */ - (void (*) (bfd *,void *,void *)) bfd_void, /* lineno_in */ - (unsigned (*) (bfd *,void *,int,int,int,int,void *)) bfd_void,/*aux_out*/ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* sym_out */ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* lineno_out */ - (unsigned (*) (bfd *,void *,void *)) bfd_void, /* reloc_out */ + mips_ecoff_swap_coff_aux_in, mips_ecoff_swap_coff_sym_in, + mips_ecoff_swap_coff_lineno_in, mips_ecoff_swap_coff_aux_out, + mips_ecoff_swap_coff_sym_out, mips_ecoff_swap_coff_lineno_out, + mips_ecoff_swap_coff_reloc_out, mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out, mips_ecoff_swap_scnhdr_out, FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE, @@ -1374,9 +1432,9 @@ const bfd_target mips_ecoff_le_vec = BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), 0, /* leading underscore */ @@ -1390,26 +1448,38 @@ const bfd_target mips_ecoff_le_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, _bfd_ecoff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), - BFD_JUMP_TABLE_COPY (_bfd_ecoff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), - BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), - BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), - BFD_JUMP_TABLE_WRITE (_bfd_ecoff), - BFD_JUMP_TABLE_LINK (_bfd_ecoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - & mips_ecoff_be_vec, - - & mips_ecoff_backend_data + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + _bfd_ecoff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + _bfd_ecoff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), + BFD_JUMP_TABLE_COPY (_bfd_ecoff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), + BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), + BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), + BFD_JUMP_TABLE_WRITE (_bfd_ecoff), + BFD_JUMP_TABLE_LINK (_bfd_ecoff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &mips_ecoff_be_vec, + + &mips_ecoff_backend_data }; const bfd_target mips_ecoff_be_vec = @@ -1419,9 +1489,9 @@ const bfd_target mips_ecoff_be_vec = BFD_ENDIAN_BIG, /* data byte order is big */ BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), 0, /* leading underscore */ @@ -1434,26 +1504,39 @@ const bfd_target mips_ecoff_be_vec = bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, _bfd_ecoff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), - BFD_JUMP_TABLE_COPY (_bfd_ecoff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), - BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), - BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), - BFD_JUMP_TABLE_WRITE (_bfd_ecoff), - BFD_JUMP_TABLE_LINK (_bfd_ecoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - - & mips_ecoff_le_vec, - - & mips_ecoff_backend_data + + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + _bfd_ecoff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + _bfd_ecoff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), + BFD_JUMP_TABLE_COPY (_bfd_ecoff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), + BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), + BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), + BFD_JUMP_TABLE_WRITE (_bfd_ecoff), + BFD_JUMP_TABLE_LINK (_bfd_ecoff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &mips_ecoff_le_vec, + + &mips_ecoff_backend_data }; const bfd_target mips_ecoff_bele_vec = @@ -1463,9 +1546,9 @@ const bfd_target mips_ecoff_bele_vec = BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), 0, /* leading underscore */ @@ -1479,24 +1562,36 @@ const bfd_target mips_ecoff_bele_vec = bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, _bfd_ecoff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, _bfd_ecoff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), - BFD_JUMP_TABLE_COPY (_bfd_ecoff), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), - BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), - BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), - BFD_JUMP_TABLE_WRITE (_bfd_ecoff), - BFD_JUMP_TABLE_LINK (_bfd_ecoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + _bfd_ecoff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + _bfd_ecoff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (_bfd_ecoff), + BFD_JUMP_TABLE_COPY (_bfd_ecoff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_ecoff), + BFD_JUMP_TABLE_SYMBOLS (_bfd_ecoff), + BFD_JUMP_TABLE_RELOCS (_bfd_ecoff), + BFD_JUMP_TABLE_WRITE (_bfd_ecoff), + BFD_JUMP_TABLE_LINK (_bfd_ecoff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - & mips_ecoff_backend_data + &mips_ecoff_backend_data }; diff --git a/bfd/coff-ppc.c b/bfd/coff-ppc.c index 74f93d5..375ed18 100644 --- a/bfd/coff-ppc.c +++ b/bfd/coff-ppc.c @@ -1038,9 +1038,9 @@ coff_ppc_relocate_section (bfd *output_bfd, switch (r_type) { default: - _bfd_error_handler - /* xgettext: c-format */ - (_("%B: unsupported relocation type 0x%02x"), input_bfd, r_type); + /* xgettext: c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + input_bfd, r_type); bfd_set_error (bfd_error_bad_value); return FALSE; case IMAGE_REL_PPC_TOCREL16: @@ -1131,9 +1131,9 @@ coff_ppc_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: Relocation for %s of %#Lx exceeds " + (_("%pB: Relocation for %s of %#" PRIx64 " exceeds " "Toc size limit"), - input_bfd, name, our_toc_offset); + input_bfd, name, (uint64_t) our_toc_offset); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1185,8 +1185,8 @@ coff_ppc_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: Relocation exceeds allocated TOC (%#Lx)"), - input_bfd, toc_section->size); + (_("%pB: Relocation exceeds allocated TOC (%#" PRIx64 ")"), + input_bfd, (uint64_t) toc_section->size); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1240,10 +1240,11 @@ coff_ppc_relocate_section (bfd *output_bfd, _bfd_error_handler /* xgettext: c-format */ - (_("Warning: unsupported reloc %s \n" - "sym %ld (%s), r_vaddr %Ld (%#Lx)"), + (_("warning: unsupported reloc %s \n" + "sym %ld (%s), r_vaddr %" PRId64 " (%#" PRIx64 ")"), howto->name, input_bfd, input_section, - rel->r_symndx, my_name, rel->r_vaddr, rel->r_vaddr); + rel->r_symndx, my_name, + (int64_t) rel->r_vaddr, (uint64_t) rel->r_vaddr); } break; case IMAGE_REL_PPC_IMGLUE: @@ -1258,7 +1259,7 @@ coff_ppc_relocate_section (bfd *output_bfd, _bfd_error_handler /* xgettext: c-format */ - (_("%B: Out of order IMGLUE reloc for %s"), input_bfd, my_name); + (_("%pB: Out of order IMGLUE reloc for %s"), input_bfd, my_name); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2480,9 +2481,9 @@ const bfd_target TARGET_LITTLE_SYM = BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little */ - (HAS_RELOC | EXEC_P | /* FIXME: object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* FIXME: object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), #ifndef COFF_WITH_PE (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY @@ -2505,12 +2506,24 @@ const bfd_target TARGET_LITTLE_SYM = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p }, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + coff_object_p + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), @@ -2524,7 +2537,7 @@ const bfd_target TARGET_LITTLE_SYM = /* Alternative_target. */ #ifdef TARGET_BIG_SYM - & TARGET_BIG_SYM, + &TARGET_BIG_SYM, #else NULL, #endif @@ -2541,9 +2554,9 @@ const bfd_target TARGET_BIG_SYM = BFD_ENDIAN_BIG, /* data byte order is big */ BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* FIXME: object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* FIXME: object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), #ifndef COFF_WITH_PE (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_READONLY @@ -2566,12 +2579,24 @@ const bfd_target TARGET_BIG_SYM = bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p }, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + coff_object_p + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), @@ -2585,7 +2610,7 @@ const bfd_target TARGET_BIG_SYM = /* Alternative_target. */ #ifdef TARGET_LITTLE_SYM - & TARGET_LITTLE_SYM, + &TARGET_LITTLE_SYM, #else NULL, #endif diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 2fc1feb..d8db1f3 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -2090,7 +2090,7 @@ xcoff_write_archive_contents_old (bfd *abfd) char decbuf[XCOFFARMAG_ELEMENT_SIZE + 1]; memset (&fhdr, 0, sizeof fhdr); - (void) strncpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG); + (void) memcpy (fhdr.magic, XCOFFARMAG, SXCOFFARMAG); sprintf (fhdr.firstmemoff, "%d", SIZEOF_AR_FILE_HDR); sprintf (fhdr.freeoff, "%d", 0); @@ -2770,7 +2770,7 @@ xcoff_reloc_type_fail (bfd *input_bfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: unsupported relocation type 0x%02x"), + (_("%pB: unsupported relocation type %#x"), input_bfd, (unsigned int) rel->r_type); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -2856,8 +2856,8 @@ xcoff_reloc_type_toc (bfd *input_bfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: TOC reloc at %#Lx to symbol `%s' with no TOC entry"), - input_bfd, rel->r_vaddr, h->root.root.string); + (_("%pB: TOC reloc at %#" PRIx64 " to symbol `%s' with no TOC entry"), + input_bfd, (uint64_t) rel->r_vaddr, h->root.root.string); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3602,7 +3602,7 @@ xcoff_create_csect_from_smclas (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: symbol `%s' has unrecognized smclas %d"), + (_("%pB: symbol `%s' has unrecognized smclas %d"), abfd, symbol_name, aux->x_csect.x_smclas); bfd_set_error (bfd_error_bad_value); } @@ -3970,7 +3970,7 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { /* For generic entry points. */ #define _bfd_xcoff_close_and_cleanup _bfd_archive_close_and_cleanup -#define _bfd_xcoff_bfd_free_cached_info bfd_true +#define _bfd_xcoff_bfd_free_cached_info _bfd_bool_bfd_true #define _bfd_xcoff_new_section_hook coff_new_section_hook #define _bfd_xcoff_get_section_contents _bfd_generic_get_section_contents #define _bfd_xcoff_get_section_contents_in_window \ @@ -4001,7 +4001,7 @@ const struct xcoff_dwsect_name xcoff_dwsect_names[] = { #define _bfd_xcoff_write_ar_hdr _bfd_generic_write_ar_hdr #define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index #define _bfd_xcoff_generic_stat_arch_elt _bfd_xcoff_stat_arch_elt -#define _bfd_xcoff_update_armap_timestamp bfd_true +#define _bfd_xcoff_update_armap_timestamp _bfd_bool_bfd_true /* For symbols entry points. */ #define _bfd_xcoff_get_symtab_upper_bound coff_get_symtab_upper_bound @@ -4195,17 +4195,17 @@ const bfd_target rs6000_xcoff_vec = }, { /* bfd_set_format */ - bfd_false, + _bfd_bool_bfd_false_error, coff_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, {/* bfd_write_contents */ - bfd_false, + _bfd_bool_bfd_false_error, coff_write_object_contents, _bfd_xcoff_write_archive_contents, - bfd_false + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_xcoff), @@ -4376,17 +4376,17 @@ const bfd_target powerpc_xcoff_vec = }, { /* bfd_set_format */ - bfd_false, + _bfd_bool_bfd_false_error, coff_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, {/* bfd_write_contents */ - bfd_false, + _bfd_bool_bfd_false_error, coff_write_object_contents, _bfd_xcoff_write_archive_contents, - bfd_false + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_xcoff), diff --git a/bfd/coff-sh.c b/bfd/coff-sh.c index 3a921fd..3251d41 100644 --- a/bfd/coff-sh.c +++ b/bfd/coff-sh.c @@ -492,7 +492,7 @@ static const struct shcoff_reloc_map sh_reloc_map[] = #define coff_bfd_reloc_name_lookup sh_coff_reloc_name_lookup static reloc_howto_type * -sh_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, +sh_coff_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { unsigned int i; @@ -501,7 +501,8 @@ sh_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, if (sh_reloc_map[i].bfd_reloc_val == code) return &sh_coff_howtos[(int) sh_reloc_map[i].shcoff_reloc_val]; - _bfd_error_handler (_("SH Error: unknown reloc type %d"), code); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, (unsigned int) code); return NULL; } @@ -775,8 +776,9 @@ sh_relax_section (bfd *abfd, if (laddr >= sec->size) { /* xgettext: c-format */ - _bfd_error_handler (_("%B: %#Lx: warning: bad R_SH_USES offset"), - abfd, irel->r_vaddr); + _bfd_error_handler + (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES offset"), + abfd, (uint64_t) irel->r_vaddr); continue; } insn = bfd_get_16 (abfd, contents + laddr); @@ -786,8 +788,8 @@ sh_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: %#Lx: warning: R_SH_USES points to unrecognized insn %#x"), - abfd, irel->r_vaddr, insn); + (_("%pB: %#" PRIx64 ": warning: R_SH_USES points to unrecognized insn %#x"), + abfd, (uint64_t) irel->r_vaddr, insn); continue; } @@ -804,8 +806,8 @@ sh_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: %#Lx: warning: bad R_SH_USES load offset"), - abfd, irel->r_vaddr); + (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES load offset"), + abfd, (uint64_t) irel->r_vaddr); continue; } @@ -829,8 +831,8 @@ sh_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: %#Lx: warning: could not find expected reloc"), - abfd, paddr); + (_("%pB: %#" PRIx64 ": warning: could not find expected reloc"), + abfd, (uint64_t) paddr); continue; } @@ -846,8 +848,8 @@ sh_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: %#Lx: warning: symbol in unexpected section"), - abfd, paddr); + (_("%pB: %#" PRIx64 ": warning: symbol in unexpected section"), + abfd, (uint64_t) paddr); continue; } @@ -972,8 +974,8 @@ sh_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: %#Lx: warning: could not find expected COUNT reloc"), - abfd, paddr); + (_("%pB: %#" PRIx64 ": warning: could not find expected COUNT reloc"), + abfd, (uint64_t) paddr); continue; } @@ -982,8 +984,8 @@ sh_relax_section (bfd *abfd, if (irelcount->r_offset == 0) { /* xgettext: c-format */ - _bfd_error_handler (_("%B: %#Lx: warning: bad count"), - abfd, paddr); + _bfd_error_handler (_("%pB: %#" PRIx64 ": warning: bad count"), + abfd, (uint64_t) paddr); continue; } @@ -1354,8 +1356,8 @@ sh_relax_delete_bytes (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: %#Lx: fatal: reloc overflow while relaxing"), - abfd, irel->r_vaddr); + (_("%pB: %#" PRIx64 ": fatal: reloc overflow while relaxing"), + abfd, (uint64_t) irel->r_vaddr); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1449,7 +1451,7 @@ sh_relax_delete_bytes (bfd *abfd, || obj_raw_syments (abfd) != NULL) { _bfd_error_handler - (_("%B: fatal: generic symbols retrieved before relaxing"), abfd); + (_("%pB: fatal: generic symbols retrieved before relaxing"), abfd); bfd_set_error (bfd_error_invalid_operation); return FALSE; } @@ -2642,8 +2644,8 @@ sh_swap_insns (bfd * abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: %#Lx: fatal: reloc overflow while relaxing"), - abfd, irel->r_vaddr); + (_("%pB: %#" PRIx64 ": fatal: reloc overflow while relaxing"), + abfd, (uint64_t) irel->r_vaddr); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2780,7 +2782,7 @@ sh_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: illegal symbol index %ld in relocs"), + (_("%pB: illegal symbol index %ld in relocs"), input_bfd, symndx); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3130,9 +3132,9 @@ const bfd_target sh_coff_small_vec = BFD_ENDIAN_BIG, /* data byte order is big */ BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), '_', /* leading symbol underscore */ @@ -3146,12 +3148,24 @@ const bfd_target sh_coff_small_vec = bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_small_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff_small), BFD_JUMP_TABLE_COPY (coff), @@ -3163,9 +3177,9 @@ const bfd_target sh_coff_small_vec = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & sh_coff_small_le_vec, + &sh_coff_small_le_vec, - & bfd_coff_small_swap_table + &bfd_coff_small_swap_table }; const bfd_target sh_coff_small_le_vec = @@ -3175,9 +3189,9 @@ const bfd_target sh_coff_small_le_vec = BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little endian too*/ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), '_', /* leading symbol underscore */ @@ -3191,12 +3205,24 @@ const bfd_target sh_coff_small_le_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_small_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff_small), BFD_JUMP_TABLE_COPY (coff), @@ -3208,8 +3234,8 @@ const bfd_target sh_coff_small_le_vec = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & sh_coff_small_vec, + &sh_coff_small_vec, - & bfd_coff_small_swap_table + &bfd_coff_small_swap_table }; #endif diff --git a/bfd/coff-tic30.c b/bfd/coff-tic30.c index f597a28..79d2ba1 100644 --- a/bfd/coff-tic30.c +++ b/bfd/coff-tic30.c @@ -183,9 +183,9 @@ const bfd_target tic30_coff_vec = BFD_ENDIAN_BIG, /* data byte order is big */ BFD_ENDIAN_LITTLE, /* header byte order is little */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ '_', /* leading symbol underscore */ @@ -199,12 +199,24 @@ const bfd_target tic30_coff_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), diff --git a/bfd/coff-tic4x.c b/bfd/coff-tic4x.c index 660b519..cb0f6a4 100644 --- a/bfd/coff-tic4x.c +++ b/bfd/coff-tic4x.c @@ -165,7 +165,8 @@ tic4x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, Called after some initial checking by the tic4x_rtype_to_howto fn below. */ static void -tic4x_lookup_howto (arelent *internal, +tic4x_lookup_howto (bfd *abfd, + arelent *internal, struct internal_reloc *dst) { unsigned int i; @@ -180,13 +181,13 @@ tic4x_lookup_howto (arelent *internal, } } - _bfd_error_handler (_("Unrecognized reloc type 0x%x"), - (unsigned int) dst->r_type); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, (unsigned int) dst->r_type); abort(); } static reloc_howto_type * -coff_tic4x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +coff_tic4x_rtype_to_howto (bfd *abfd, asection *sec, struct internal_reloc *rel, struct coff_link_hash_entry *h ATTRIBUTE_UNUSED, @@ -201,7 +202,7 @@ coff_tic4x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, in the output section. */ *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma; - tic4x_lookup_howto (&genrel, rel); + tic4x_lookup_howto (abfd, &genrel, rel); return genrel.howto; } @@ -224,7 +225,7 @@ tic4x_reloc_processing (arelent *relent, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: warning: illegal symbol index %ld in relocs"), + (_("%pB: warning: illegal symbol index %ld in relocs"), abfd, reloc->r_symndx); relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; ptr = NULL; @@ -256,7 +257,7 @@ tic4x_reloc_processing (arelent *relent, /* !! relent->section = (asection *) NULL; */ /* Fill in the relent->howto field from reloc->r_type. */ - tic4x_lookup_howto (relent, reloc); + tic4x_lookup_howto (abfd, relent, reloc); } diff --git a/bfd/coff-tic54x.c b/bfd/coff-tic54x.c index 0b6848f..75b9fb8 100644 --- a/bfd/coff-tic54x.c +++ b/bfd/coff-tic54x.c @@ -260,7 +260,8 @@ tic54x_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, Called after some initial checking by the tic54x_rtype_to_howto fn below. */ static void -tic54x_lookup_howto (arelent *internal, +tic54x_lookup_howto (bfd *abfd, + arelent *internal, struct internal_reloc *dst) { unsigned i; @@ -275,8 +276,8 @@ tic54x_lookup_howto (arelent *internal, } } - _bfd_error_handler (_("Unrecognized reloc type 0x%x"), - (unsigned int) dst->r_type); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, (unsigned int) dst->r_type); abort (); } @@ -286,7 +287,7 @@ tic54x_lookup_howto (arelent *internal, #define coff_rtype_to_howto coff_tic54x_rtype_to_howto static reloc_howto_type * -coff_tic54x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +coff_tic54x_rtype_to_howto (bfd *abfd, asection *sec, struct internal_reloc *rel, struct coff_link_hash_entry *h ATTRIBUTE_UNUSED, @@ -303,7 +304,7 @@ coff_tic54x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma; } - tic54x_lookup_howto (&genrel, rel); + tic54x_lookup_howto (abfd, &genrel, rel); return genrel.howto; } @@ -362,7 +363,7 @@ tic54x_reloc_processing (arelent *relent, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: warning: illegal symbol index %ld in relocs"), + (_("%pB: warning: illegal symbol index %ld in relocs"), abfd, reloc->r_symndx); relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; ptr = NULL; @@ -394,24 +395,24 @@ tic54x_reloc_processing (arelent *relent, /* !! relent->section = (asection *) NULL;*/ /* Fill in the relent->howto field from reloc->r_type. */ - tic54x_lookup_howto (relent, reloc); + tic54x_lookup_howto (abfd, relent, reloc); } /* TI COFF v0, DOS tools (little-endian headers). */ const bfd_target tic54x_coff0_vec = { - "coff0-c54x", /* name */ + "coff0-c54x", /* name */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, @@ -421,12 +422,24 @@ const bfd_target tic54x_coff0_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), @@ -439,24 +452,24 @@ const bfd_target tic54x_coff0_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - & ticoff0_swap_table + &ticoff0_swap_table }; /* TI COFF v0, SPARC tools (big-endian headers). */ const bfd_target tic54x_coff0_beh_vec = { - "coff0-beh-c54x", /* name */ + "coff0-beh-c54x", /* name */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, @@ -466,12 +479,24 @@ const bfd_target tic54x_coff0_beh_vec = bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), @@ -483,26 +508,26 @@ const bfd_target tic54x_coff0_beh_vec = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & tic54x_coff0_vec, + &tic54x_coff0_vec, - & ticoff0_swap_table + &ticoff0_swap_table }; /* TI COFF v1, DOS tools (little-endian headers). */ const bfd_target tic54x_coff1_vec = { - "coff1-c54x", /* name */ + "coff1-c54x", /* name */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, @@ -512,12 +537,24 @@ const bfd_target tic54x_coff1_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), @@ -529,26 +566,26 @@ const bfd_target tic54x_coff1_vec = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & tic54x_coff0_beh_vec, + &tic54x_coff0_beh_vec, - & ticoff1_swap_table + &ticoff1_swap_table }; /* TI COFF v1, SPARC tools (big-endian headers). */ const bfd_target tic54x_coff1_beh_vec = { - "coff1-beh-c54x", /* name */ + "coff1-beh-c54x", /* name */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, @@ -558,12 +595,24 @@ const bfd_target tic54x_coff1_beh_vec = bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), @@ -575,26 +624,26 @@ const bfd_target tic54x_coff1_beh_vec = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & tic54x_coff1_vec, + &tic54x_coff1_vec, - & ticoff1_swap_table + &ticoff1_swap_table }; /* TI COFF v2, TI DOS tools output (little-endian headers). */ const bfd_target tic54x_coff2_vec = { - "coff2-c54x", /* name */ + "coff2-c54x", /* name */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, @@ -604,12 +653,24 @@ const bfd_target tic54x_coff2_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), @@ -621,7 +682,7 @@ const bfd_target tic54x_coff2_vec = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & tic54x_coff1_beh_vec, + &tic54x_coff1_beh_vec, COFF_SWAP_TABLE }; @@ -629,18 +690,18 @@ const bfd_target tic54x_coff2_vec = /* TI COFF v2, TI SPARC tools output (big-endian headers). */ const bfd_target tic54x_coff2_beh_vec = { - "coff2-beh-c54x", /* name */ + "coff2-beh-c54x", /* name */ bfd_target_coff_flavour, BFD_ENDIAN_LITTLE, /* data byte order is little */ BFD_ENDIAN_BIG, /* header byte order is big */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT ), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT ), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - '_', /* leading symbol underscore */ - '/', /* ar_pad_char */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, @@ -650,12 +711,24 @@ const bfd_target tic54x_coff2_beh_vec = bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), @@ -667,7 +740,7 @@ const bfd_target tic54x_coff2_beh_vec = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & tic54x_coff2_vec, + &tic54x_coff2_vec, COFF_SWAP_TABLE }; diff --git a/bfd/coff-tic80.c b/bfd/coff-tic80.c index 3496a05..4120b60 100644 --- a/bfd/coff-tic80.c +++ b/bfd/coff-tic80.c @@ -438,7 +438,7 @@ rtype2howto (arelent *cache_ptr, struct internal_reloc *dst) } } - _bfd_error_handler (_("Unrecognized reloc type 0x%x"), + _bfd_error_handler (_("unsupported relocation type %#x"), (unsigned int) dst->r_type); cache_ptr->howto = tic80_howto_table + 0; } @@ -669,8 +669,8 @@ coff_tic80_relocate_section (bfd *output_bfd, case bfd_reloc_outofrange: _bfd_error_handler /* xgettext: c-format */ - (_("%B: bad reloc address %#Lx in section `%A'"), - input_bfd, rel->r_vaddr, input_section); + (_("%pB: bad reloc address %#" PRIx64 " in section `%pA'"), + input_bfd, (uint64_t) rel->r_vaddr, input_section); return FALSE; case bfd_reloc_overflow: { diff --git a/bfd/coff-w65.c b/bfd/coff-w65.c index c9c58f7..68b2c94 100644 --- a/bfd/coff-w65.c +++ b/bfd/coff-w65.c @@ -349,7 +349,7 @@ w65_reloc16_extra_cases (bfd *abfd, } break; default: - printf (_("ignoring reloc %s\n"), reloc->howto->name); + _bfd_error_handler (_("%pB: %s unsupported"), abfd, reloc->howto->name); break; } diff --git a/bfd/coff-x86_64.c b/bfd/coff-x86_64.c index 25e9883..f0108ea 100644 --- a/bfd/coff-x86_64.c +++ b/bfd/coff-x86_64.c @@ -761,9 +761,9 @@ const bfd_target BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_LITTLE, /* Header byte order is little. */ - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS), + (HAS_RELOC | EXEC_P /* Object flags. */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags. */ #if defined(COFF_WITH_PE) @@ -788,12 +788,24 @@ const bfd_target bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Hdrs. */ /* Note that we allow an object file to be treated as a core file as well. */ - { _bfd_dummy_target, amd64coff_object_p, /* BFD_check_format. */ - bfd_generic_archive_p, amd64coff_object_p }, - { bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format. */ - bfd_false }, - { bfd_false, coff_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false }, + { /* bfd_check_format. */ + _bfd_dummy_target, + amd64coff_object_p, + bfd_generic_archive_p, + amd64coff_object_p + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), diff --git a/bfd/coff64-rs6000.c b/bfd/coff64-rs6000.c index 884d82a..78f14a0 100644 --- a/bfd/coff64-rs6000.c +++ b/bfd/coff64-rs6000.c @@ -2147,7 +2147,7 @@ xcoff64_create_csect_from_smclas (bfd *abfd, union internal_auxent *aux, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: symbol `%s' has unrecognized smclas %d"), + (_("%pB: symbol `%s' has unrecognized smclas %d"), abfd, symbol_name, aux->x_csect.x_smclas); bfd_set_error (bfd_error_bad_value); } @@ -2694,22 +2694,22 @@ const bfd_target rs6000_xcoff64_vec = }, { /* bfd_set_format */ - bfd_false, + _bfd_bool_bfd_false_error, coff_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, {/* bfd_write_contents */ - bfd_false, + _bfd_bool_bfd_false_error, xcoff64_write_object_contents, _bfd_xcoff_write_archive_contents, - bfd_false + _bfd_bool_bfd_false_error }, /* Generic */ _bfd_archive_close_and_cleanup, - bfd_true, + _bfd_bool_bfd_true, coff_new_section_hook, _bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window, @@ -2738,7 +2738,7 @@ const bfd_target rs6000_xcoff64_vec = xcoff64_openr_next_archived_file, _bfd_generic_get_elt_at_index, _bfd_xcoff_stat_arch_elt, - bfd_true, + _bfd_bool_bfd_true, /* Symbols */ coff_get_symtab_upper_bound, @@ -2955,22 +2955,22 @@ const bfd_target rs6000_xcoff64_aix_vec = }, { /* bfd_set_format */ - bfd_false, + _bfd_bool_bfd_false_error, coff_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, {/* bfd_write_contents */ - bfd_false, + _bfd_bool_bfd_false_error, xcoff64_write_object_contents, _bfd_xcoff_write_archive_contents, - bfd_false + _bfd_bool_bfd_false_error }, /* Generic */ _bfd_archive_close_and_cleanup, - bfd_true, + _bfd_bool_bfd_true, coff_new_section_hook, _bfd_generic_get_section_contents, _bfd_generic_get_section_contents_in_window, @@ -2999,7 +2999,7 @@ const bfd_target rs6000_xcoff64_aix_vec = xcoff64_openr_next_archived_file, _bfd_generic_get_elt_at_index, _bfd_xcoff_stat_arch_elt, - bfd_true, + _bfd_bool_bfd_true, /* Symbols */ coff_get_symtab_upper_bound, diff --git a/bfd/coffcode.h b/bfd/coffcode.h index ec0103e..caa8bcb 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -965,7 +965,7 @@ handle_COMDAT (bfd * abfd, /* PR 17512 file: 078-11867-0.004 */ if (symname == NULL) { - _bfd_error_handler (_("%B: unable to load COMDAT section name"), + _bfd_error_handler (_("%pB: unable to load COMDAT section name"), abfd); break; } @@ -1000,7 +1000,7 @@ handle_COMDAT (bfd * abfd, { /* Malformed input files can trigger this test. cf PR 21781. */ - _bfd_error_handler (_("%B: error: unexpected symbol '%s' in COMDAT section"), + _bfd_error_handler (_("%pB: error: unexpected symbol '%s' in COMDAT section"), abfd, symname); goto breakloop; } @@ -1012,7 +1012,7 @@ handle_COMDAT (bfd * abfd, if (isym.n_sclass == C_STAT && strcmp (name, symname) != 0) /* xgettext:c-format */ - _bfd_error_handler (_("%B: warning: COMDAT symbol '%s'" + _bfd_error_handler (_("%pB: warning: COMDAT symbol '%s'" " does not match section name '%s'"), abfd, symname, name); @@ -1022,7 +1022,7 @@ handle_COMDAT (bfd * abfd, if (esym + bfd_coff_symesz (abfd) >= esymend) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: warning: No symbol for" + _bfd_error_handler (_("%pB: warning: no symbol for" " section '%s' found"), abfd, symname); break; @@ -1248,9 +1248,9 @@ styp_to_sec_flags (bfd *abfd, variable as this will allow some .sys files generate by other toolchains to be processed. See bugzilla issue 196. */ /* xgettext:c-format */ - _bfd_error_handler (_("%B: Warning: Ignoring section flag" - " IMAGE_SCN_MEM_NOT_PAGED in section %s"), - abfd, name); + _bfd_error_handler (_("%pB: warning: ignoring section flag" + " %s in section %s"), + abfd, "IMAGE_SCN_MEM_NOT_PAGED", name); break; case IMAGE_SCN_MEM_EXECUTE: sec_flags |= SEC_CODE; @@ -1317,7 +1317,7 @@ styp_to_sec_flags (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B (%s): Section flag %s (%#lx) ignored"), + (_("%pB (%s): section flag %s (%#lx) ignored"), abfd, name, unhandled, flag); result = FALSE; } @@ -1947,7 +1947,7 @@ coff_set_alignment_hook (bfd * abfd ATTRIBUTE_UNUSED, } else if (hdr->s_nreloc == 0xffff) _bfd_error_handler - (_("%B: warning: claims to have 0xffff relocs, without overflow"), + (_("%pB: warning: claims to have 0xffff relocs, without overflow"), abfd); } #undef ALIGN_SET @@ -1985,8 +1985,12 @@ coff_set_alignment_hook (bfd *abfd, asection *section, void * scnhdr) #else /* ! RS6000COFF_C */ -#define coff_set_alignment_hook \ - ((void (*) (bfd *, asection *, void *)) bfd_void) +static void +coff_set_alignment_hook (bfd *abfd ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + void *scnhdr ATTRIBUTE_UNUSED) +{ +} #endif /* ! RS6000COFF_C */ #endif /* ! COFF_WITH_PE */ @@ -2463,7 +2467,7 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr) default: arch = bfd_arch_obscure; _bfd_error_handler - (_("Unrecognized TI COFF target id '0x%x'"), + (_("unrecognized TI COFF target id '0x%x'"), internal_f->f_target_id); break; } @@ -2497,20 +2501,16 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr) return TRUE; } -#ifdef SYMNAME_IN_DEBUG - static bfd_boolean -symname_in_debug_hook (bfd * abfd ATTRIBUTE_UNUSED, struct internal_syment *sym) +symname_in_debug_hook (bfd *abfd ATTRIBUTE_UNUSED, + struct internal_syment *sym ATTRIBUTE_UNUSED) { +#ifdef SYMNAME_IN_DEBUG return SYMNAME_IN_DEBUG (sym) != 0; -} - #else - -#define symname_in_debug_hook \ - (bfd_boolean (*) (bfd *, struct internal_syment *)) bfd_false - + return FALSE; #endif +} #ifdef RS6000COFF_C @@ -2781,7 +2781,7 @@ coff_write_relocs (bfd * abfd, int first_undef) { bfd_set_error (bfd_error_bad_value); /* xgettext:c-format */ - _bfd_error_handler (_("%B: reloc against a non-existent" + _bfd_error_handler (_("%pB: reloc against a non-existent" " symbol index: %ld"), abfd, n.r_symndx); return FALSE; @@ -3184,7 +3184,7 @@ coff_compute_section_file_positions (bfd * abfd) bfd_set_error (bfd_error_file_too_big); _bfd_error_handler /* xgettext:c-format */ - (_("%B: page size is too large (0x%x)"), abfd, page_size); + (_("%pB: page size is too large (0x%x)"), abfd, page_size); return FALSE; } } @@ -3344,7 +3344,7 @@ coff_compute_section_file_positions (bfd * abfd) bfd_set_error (bfd_error_file_too_big); _bfd_error_handler /* xgettext:c-format */ - (_("%B: too many sections (%d)"), abfd, target_index); + (_("%pB: too many sections (%d)"), abfd, target_index); return FALSE; } @@ -3765,7 +3765,7 @@ coff_write_object_contents (bfd * abfd) bfd_set_error (bfd_error_file_too_big); _bfd_error_handler /* xgettext:c-format */ - (_("%B: section %A: string table overflow at offset %ld"), + (_("%pB: section %pA: string table overflow at offset %ld"), abfd, current, (unsigned long) string_size); return FALSE; } @@ -3870,7 +3870,7 @@ coff_write_object_contents (bfd * abfd) _bfd_error_handler /* xgettext:c-format */ - (_("%B:%s section %s: alignment 2**%u not representable"), + (_("%pB:%s section %s: alignment 2**%u not representable"), abfd, warn ? " warning:" : "", current->name, current->alignment_power); if (!warn) @@ -4589,7 +4589,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect) if (asect->lineno_count > asect->size) { _bfd_error_handler - (_("%B: warning: line number count (%#lx) exceeds section size (%#lx)"), + (_("%pB: warning: line number count (%#lx) exceeds section size (%#lx)"), abfd, (unsigned long) asect->lineno_count, (unsigned long) asect->size); return FALSE; } @@ -4604,7 +4604,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect) if (native_lineno == NULL) { _bfd_error_handler - (_("%B: warning: line number table read failed"), abfd); + (_("%pB: warning: line number table read failed"), abfd); bfd_release (abfd, lineno_cache); return FALSE; } @@ -4638,7 +4638,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: illegal symbol index 0x%lx in line number entry %d"), + (_("%pB: warning: illegal symbol index 0x%lx in line number entry %d"), abfd, symndx, counter); cache_ptr->line_number = -1; ret = FALSE; @@ -4652,7 +4652,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: illegal symbol index 0x%lx in line number entry %d"), + (_("%pB: warning: illegal symbol index 0x%lx in line number entry %d"), abfd, symndx, counter); cache_ptr->line_number = -1; ret = FALSE; @@ -4666,7 +4666,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: illegal symbol in line number entry %d"), + (_("%pB: warning: illegal symbol in line number entry %d"), abfd, counter); cache_ptr->line_number = -1; ret = FALSE; @@ -4679,7 +4679,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect) if (sym->lineno != NULL) _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: duplicate line number information for `%s'"), + (_("%pB: warning: duplicate line number information for `%s'"), abfd, bfd_asymbol_name (&sym->symbol)); sym->lineno = cache_ptr; @@ -5100,7 +5100,7 @@ coff_slurp_symbol_table (bfd * abfd) default: _bfd_error_handler /* xgettext:c-format */ - (_("%B: Unrecognized storage class %d for %s symbol `%s'"), + (_("%pB: unrecognized storage class %d for %s symbol `%s'"), abfd, src->u.syment.n_sclass, dst->symbol.section->name, dst->symbol.name); ret = FALSE; @@ -5233,7 +5233,7 @@ coff_classify_symbol (bfd *abfd, _bfd_error_handler /* xgettext:c-format */ - (_("warning: %B: local symbol `%s' has no section"), + (_("warning: %pB: local symbol `%s' has no section"), abfd, _bfd_coff_internal_syment_name (abfd, syment, buf)); } @@ -5340,7 +5340,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: illegal symbol index %ld in relocs"), + (_("%pB: warning: illegal symbol index %ld in relocs"), abfd, dst.r_symndx); cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; ptr = NULL; @@ -5380,8 +5380,8 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect, asymbol ** symbols) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: illegal relocation type %d at address %#Lx"), - abfd, dst.r_type, dst.r_vaddr); + (_("%pB: illegal relocation type %d at address %#" PRIx64), + abfd, dst.r_type, (uint64_t) dst.r_vaddr); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -6024,7 +6024,7 @@ static bfd_coff_backend_data bigobj_swap_table = #endif #ifndef coff_bfd_is_target_special_symbol -#define coff_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define coff_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #endif #ifndef coff_read_minisymbols @@ -6113,14 +6113,24 @@ const bfd_target VAR = \ bfd_getb32, bfd_getb_signed_32, bfd_putb32, \ bfd_getb16, bfd_getb_signed_16, bfd_putb16, \ \ - /* bfd_check_format. */ \ - { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, \ - _bfd_dummy_target }, \ - /* bfd_set_format. */ \ - { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false }, \ - /* bfd_write_contents. */ \ - { bfd_false, coff_write_object_contents, _bfd_write_archive_contents, \ - bfd_false }, \ + { /* bfd_check_format. */ \ + _bfd_dummy_target, \ + coff_object_p, \ + bfd_generic_archive_p, \ + _bfd_dummy_target \ + }, \ + { /* bfd_set_format. */ \ + _bfd_bool_bfd_false_error, \ + coff_mkobject, \ + _bfd_generic_mkarchive, \ + _bfd_bool_bfd_false_error \ + }, \ + { /* bfd_write_contents. */ \ + _bfd_bool_bfd_false_error, \ + coff_write_object_contents, \ + _bfd_write_archive_contents, \ + _bfd_bool_bfd_false_error \ + }, \ \ BFD_JUMP_TABLE_GENERIC (coff), \ BFD_JUMP_TABLE_COPY (coff), \ @@ -6164,14 +6174,24 @@ const bfd_target VAR = \ bfd_getb32, bfd_getb_signed_32, bfd_putb32, \ bfd_getb16, bfd_getb_signed_16, bfd_putb16, \ \ - /* bfd_check_format. */ \ - { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, \ - _bfd_dummy_target }, \ - /* bfd_set_format. */ \ - { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false }, \ - /* bfd_write_contents. */ \ - { bfd_false, coff_write_object_contents, _bfd_write_archive_contents, \ - bfd_false }, \ + { /* bfd_check_format. */ \ + _bfd_dummy_target, \ + coff_object_p, \ + bfd_generic_archive_p, \ + _bfd_dummy_target \ + }, \ + { /* bfd_set_format. */ \ + _bfd_bool_bfd_false_error, \ + coff_mkobject, \ + _bfd_generic_mkarchive, \ + _bfd_bool_bfd_false_error \ + }, \ + { /* bfd_write_contents. */ \ + _bfd_bool_bfd_false_error, \ + coff_write_object_contents, \ + _bfd_write_archive_contents, \ + _bfd_bool_bfd_false_error \ + }, \ \ BFD_JUMP_TABLE_GENERIC (coff), \ BFD_JUMP_TABLE_COPY (coff), \ @@ -6213,14 +6233,25 @@ const bfd_target VAR = \ bfd_getl64, bfd_getl_signed_64, bfd_putl64, \ bfd_getl32, bfd_getl_signed_32, bfd_putl32, \ bfd_getl16, bfd_getl_signed_16, bfd_putl16, \ - /* bfd_check_format. */ \ - { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, \ - _bfd_dummy_target }, \ - /* bfd_set_format. */ \ - { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false }, \ - /* bfd_write_contents. */ \ - { bfd_false, coff_write_object_contents, _bfd_write_archive_contents, \ - bfd_false }, \ + \ + { /* bfd_check_format. */ \ + _bfd_dummy_target, \ + coff_object_p, \ + bfd_generic_archive_p, \ + _bfd_dummy_target \ + }, \ + { /* bfd_set_format. */ \ + _bfd_bool_bfd_false_error, \ + coff_mkobject, \ + _bfd_generic_mkarchive, \ + _bfd_bool_bfd_false_error \ + }, \ + { /* bfd_write_contents. */ \ + _bfd_bool_bfd_false_error, \ + coff_write_object_contents, \ + _bfd_write_archive_contents, \ + _bfd_bool_bfd_false_error \ + }, \ \ BFD_JUMP_TABLE_GENERIC (coff), \ BFD_JUMP_TABLE_COPY (coff), \ diff --git a/bfd/coffgen.c b/bfd/coffgen.c index b241087..ff445d2 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -175,7 +175,7 @@ make_a_section_from_file (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: unable to initialize compress status for section %s"), + (_("%pB: unable to initialize compress status for section %s"), abfd, name); return FALSE; } @@ -199,7 +199,7 @@ make_a_section_from_file (bfd *abfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: unable to initialize decompress status for section %s"), + (_("%pB: unable to initialize decompress status for section %s"), abfd, name); return FALSE; } @@ -1555,7 +1555,8 @@ coff_pointerize_aux (bfd *abfd, } /* A negative tagndx is meaningless, but the SCO 3.2v4 cc can generate one, so we must be careful to ignore it. */ - if (auxent->u.auxent.x_sym.x_tagndx.l > 0) + if ((unsigned long) auxent->u.auxent.x_sym.x_tagndx.l + < obj_raw_syment_count (abfd)) { auxent->u.auxent.x_sym.x_tagndx.p = table_base + auxent->u.auxent.x_sym.x_tagndx.l; @@ -1646,8 +1647,8 @@ _bfd_coff_get_external_symbols (bfd *abfd) && size > bfd_get_file_size (abfd))) { - _bfd_error_handler (_("%B: corrupt symbol count: %#Lx"), - abfd, obj_raw_syment_count (abfd)); + _bfd_error_handler (_("%pB: corrupt symbol count: %#" PRIx64 ""), + abfd, (uint64_t) obj_raw_syment_count (abfd)); return FALSE; } @@ -1655,8 +1656,10 @@ _bfd_coff_get_external_symbols (bfd *abfd) if (syms == NULL) { /* PR 21013: Provide an error message when the alloc fails. */ - _bfd_error_handler (_("%B: not enough memory to allocate space for %#Lx symbols of size %#Lx"), - abfd, obj_raw_syment_count (abfd), symesz); + _bfd_error_handler (_("%pB: not enough memory to allocate space " + "for %#" PRIx64 " symbols of size %#" PRIx64), + abfd, (uint64_t) obj_raw_syment_count (abfd), + (uint64_t) symesz); return FALSE; } @@ -1722,7 +1725,7 @@ _bfd_coff_read_string_table (bfd *abfd) { _bfd_error_handler /* xgettext: c-format */ - (_("%B: bad string table size %Lu"), abfd, strsize); + (_("%pB: bad string table size %" PRIu64), abfd, (uint64_t) strsize); bfd_set_error (bfd_error_bad_value); return NULL; } @@ -3021,7 +3024,7 @@ coff_gc_sweep (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) if (info->print_gc_sections && o->size != 0) /* xgettext: c-format */ - _bfd_error_handler (_("Removing unused section '%A' in file '%B'"), + _bfd_error_handler (_("removing unused section '%pA' in file '%pB'"), o, sub); #if 0 @@ -3098,7 +3101,7 @@ bfd_coff_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) if (!bed->can_gc_sections || !is_coff_hash_table (info->hash)) { - _bfd_error_handler(_("Warning: gc-sections option ignored")); + _bfd_error_handler(_("warning: gc-sections option ignored")); return TRUE; } #endif diff --git a/bfd/cofflink.c b/bfd/cofflink.c index beff5cd..fb1696a 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -349,7 +349,7 @@ coff_link_add_symbols (bfd *abfd, && (*sym_hash)->root.type != bfd_link_hash_undefined && (*sym_hash)->root.type != bfd_link_hash_undefweak) _bfd_error_handler - (_("Warning: symbol `%s' is both section and non-section"), + (_("warning: symbol `%s' is both section and non-section"), name); addit = FALSE; @@ -451,8 +451,8 @@ coff_link_add_symbols (bfd *abfd, || BTYPE (sym.n_type) == T_NULL))) _bfd_error_handler /* xgettext: c-format */ - (_("Warning: type of symbol `%s' changed" - " from %d to %d in %B"), + (_("warning: type of symbol `%s' changed" + " from %d to %d in %pB"), name, (*sym_hash)->type, sym.n_type, abfd); /* We don't want to change from a meaningful @@ -2370,7 +2370,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd) { _bfd_error_handler /* xgettext: c-format */ - (_("%B: relocs in section `%A', but it has no contents"), + (_("%pB: relocs in section `%pA', but it has no contents"), input_bfd, o); bfd_set_error (bfd_error_no_contents); return FALSE; @@ -2433,8 +2433,8 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd) if (ps->flags & SEC_EXCLUDE) (*flaginfo->info->callbacks->einfo) /* xgettext: c-format */ - (_("%X`%s' referenced in section `%A' of %B: " - "defined in discarded section `%A' of %B\n"), + (_("%X`%s' referenced in section `%pA' of %pB: " + "defined in discarded section `%pA' of %pB\n"), h->root.root.string, o, input_bfd, ps, ps->owner); } @@ -2731,7 +2731,7 @@ _bfd_coff_write_global_sym (struct bfd_hash_entry *bh, void *data) || bfd_link_relocatable (flaginfo->info))) _bfd_error_handler /* xgettext: c-format */ - (_("%B: %A: reloc overflow: %#x > 0xffff"), + (_("%pB: %pA: reloc overflow: %#x > 0xffff"), output_bfd, sec, sec->reloc_count); if (sec->lineno_count > 0xffff @@ -2739,7 +2739,7 @@ _bfd_coff_write_global_sym (struct bfd_hash_entry *bh, void *data) || bfd_link_relocatable (flaginfo->info))) _bfd_error_handler /* xgettext: c-format */ - (_("%B: warning: %A: line number overflow: %#x > 0xffff"), + (_("%pB: warning: %pA: line number overflow: %#x > 0xffff"), output_bfd, sec, sec->lineno_count); auxp->x_scn.x_nreloc = sec->reloc_count; @@ -2962,7 +2962,7 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext: c-format */ - (_("%B: illegal symbol index %ld in relocs"), input_bfd, symndx); + (_("%pB: illegal symbol index %ld in relocs"), input_bfd, symndx); return FALSE; } else @@ -3124,8 +3124,8 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd, case bfd_reloc_outofrange: _bfd_error_handler /* xgettext: c-format */ - (_("%B: bad reloc address %#Lx in section `%A'"), - input_bfd, rel->r_vaddr, input_section); + (_("%pB: bad reloc address %#" PRIx64 " in section `%pA'"), + input_bfd, (uint64_t) rel->r_vaddr, input_section); return FALSE; case bfd_reloc_overflow: { diff --git a/bfd/coffswap.h b/bfd/coffswap.h index 8375af5..7b000e0 100644 --- a/bfd/coffswap.h +++ b/bfd/coffswap.h @@ -808,7 +808,7 @@ coff_swap_scnhdr_out (bfd * abfd, void * in, void * out) buf[sizeof (scnhdr_int->s_name)] = '\0'; _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: %s: line number overflow: 0x%lx > 0xffff"), + (_("%pB: warning: %s: line number overflow: 0x%lx > 0xffff"), abfd, buf, scnhdr_int->s_nlnno); PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno); } @@ -822,7 +822,7 @@ coff_swap_scnhdr_out (bfd * abfd, void * in, void * out) memcpy (buf, scnhdr_int->s_name, sizeof (scnhdr_int->s_name)); buf[sizeof (scnhdr_int->s_name)] = '\0'; /* xgettext:c-format */ - _bfd_error_handler (_("%B: %s: reloc overflow: 0x%lx > 0xffff"), + _bfd_error_handler (_("%pB: %s: reloc overflow: 0x%lx > 0xffff"), abfd, buf, scnhdr_int->s_nreloc); bfd_set_error (bfd_error_file_truncated); PUT_SCNHDR_NRELOC (abfd, 0xffff, scnhdr_ext->s_nreloc); diff --git a/bfd/compress.c b/bfd/compress.c index 1a531ea..53e566e 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -252,8 +252,8 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) if (bfd_get_error () == bfd_error_no_memory) _bfd_error_handler /* xgettext:c-format */ - (_("error: %B(%A) is too large (%#Lx bytes)"), - abfd, sec, sz); + (_("error: %pB(%pA) is too large (%#" PRIx64 " bytes)"), + abfd, sec, (uint64_t) sz); return FALSE; } } diff --git a/bfd/config.bfd b/bfd/config.bfd index f04a993..9aa2fc6 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -1260,11 +1260,13 @@ case "${targ}" in nds32*le-*-linux*) targ_defvec=nds32_elf32_linux_le_vec targ_selvecs=nds32_elf32_linux_be_vec + targ_cflags=-DNDS32_LINUX_TOOLCHAIN ;; nds32*be-*-linux*) targ_defvec=nds32_elf32_linux_be_vec targ_selvecs=nds32_elf32_linux_le_vec + targ_cflags=-DNDS32_LINUX_TOOLCHAIN ;; nds32*le-*-*) diff --git a/bfd/config.in b/bfd/config.in index 75a5ff0..186741d 100644 --- a/bfd/config.in +++ b/bfd/config.in @@ -10,6 +10,10 @@ /* Name of host specific core header file to include in elf.c. */ #undef CORE_HEADER +/* Define to 1 if you want to enable -z separate-code in ELF linker by + default. */ +#undef DEFAULT_LD_Z_SEPARATE_CODE + /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS diff --git a/bfd/configure b/bfd/configure index 1f51789..d1fe335 100755 --- a/bfd/configure +++ b/bfd/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for bfd 2.30. +# Generated by GNU Autoconf 2.64 for bfd 2.30.51. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bfd' PACKAGE_TARNAME='bfd' -PACKAGE_VERSION='2.30' -PACKAGE_STRING='bfd 2.30' +PACKAGE_VERSION='2.30.51' +PACKAGE_STRING='bfd 2.30.51' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -793,6 +793,7 @@ enable_targets enable_64_bit_archive with_mmap enable_secureplt +enable_separate_code enable_leading_mingw64_underscores with_separate_debug_dir with_pkgversion @@ -1354,7 +1355,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bfd 2.30 to adapt to many kinds of systems. +\`configure' configures bfd 2.30.51 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1425,7 +1426,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bfd 2.30:";; + short | recursive ) echo "Configuration of bfd 2.30.51:";; esac cat <<\_ACEOF @@ -1446,6 +1447,7 @@ Optional Features: --enable-targets alternative target configurations --enable-64-bit-archive force 64-bit archives --enable-secureplt Default to creating read-only plt entries + --enable-separate-code enable -z separate-code in ELF linker by default --enable-leading-mingw64-underscores Enable leading underscores on 64 bit mingw targets --enable-werror treat compile warnings as errors @@ -1546,7 +1548,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bfd configure 2.30 +bfd configure 2.30.51 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2188,7 +2190,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bfd $as_me 2.30, which was +It was created by bfd $as_me 2.30.51, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -3997,7 +3999,7 @@ fi # Define the identity of the package. PACKAGE='bfd' - VERSION='2.30' + VERSION='2.30.51' cat >>confdefs.h <<_ACEOF @@ -11428,7 +11430,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11431 "configure" +#line 11433 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11534,7 +11536,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11537 "configure" +#line 11539 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12171,6 +12173,33 @@ $as_echo "#define USE_SECUREPLT 1" >>confdefs.h fi +# Decide if -z separate-code should be enabled in ELF linker by default. +ac_default_ld_z_separate_code=unset +# Check whether --enable-separate-code was given. +if test "${enable_separate_code+set}" = set; then : + enableval=$enable_separate_code; case "${enableval}" in + yes) ac_default_ld_z_separate_code=1 ;; + no) ac_default_ld_z_separate_code=0 ;; +esac +fi + +# Enable -z separate-code by default for Linux/x86. +case "${target}" in +i3-786-*-linux-* | x86_64-*-linux-*) + if test ${ac_default_ld_z_separate_code} = unset; then + ac_default_ld_z_separate_code=1 + fi + ;; +esac +if test "${ac_default_ld_z_separate_code}" = unset; then + ac_default_ld_z_separate_code=0 +fi + +cat >>confdefs.h <<_ACEOF +#define DEFAULT_LD_Z_SEPARATE_CODE $ac_default_ld_z_separate_code +_ACEOF + + # Check whether --enable-leading-mingw64-underscores was given. if test "${enable_leading_mingw64_underscores+set}" = set; then : enableval=$enable_leading_mingw64_underscores; @@ -16666,7 +16695,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bfd $as_me 2.30, which was +This file was extended by bfd $as_me 2.30.51, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16730,7 +16759,7 @@ Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -bfd config.status 2.30 +bfd config.status 2.30.51 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/bfd/configure.ac b/bfd/configure.ac index 2342f3f..20e2c02 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -97,6 +97,30 @@ if test $use_secureplt = true; then [Define if we should default to creating read-only plt entries]) fi +# Decide if -z separate-code should be enabled in ELF linker by default. +ac_default_ld_z_separate_code=unset +AC_ARG_ENABLE(separate-code, + AS_HELP_STRING([--enable-separate-code], + [enable -z separate-code in ELF linker by default]), +[case "${enableval}" in + yes) ac_default_ld_z_separate_code=1 ;; + no) ac_default_ld_z_separate_code=0 ;; +esac]) +# Enable -z separate-code by default for Linux/x86. +case "${target}" in +i[3-7]86-*-linux-* | x86_64-*-linux-*) + if test ${ac_default_ld_z_separate_code} = unset; then + ac_default_ld_z_separate_code=1 + fi + ;; +esac +if test "${ac_default_ld_z_separate_code}" = unset; then + ac_default_ld_z_separate_code=0 +fi +AC_DEFINE_UNQUOTED(DEFAULT_LD_Z_SEPARATE_CODE, + $ac_default_ld_z_separate_code, + [Define to 1 if you want to enable -z separate-code in ELF linker by default.]) + AC_ARG_ENABLE(leading-mingw64-underscores, AS_HELP_STRING([--enable-leading-mingw64-underscores], [Enable leading underscores on 64 bit mingw targets]), diff --git a/bfd/cpu-arm.c b/bfd/cpu-arm.c index 151f273..c6682d4 100644 --- a/bfd/cpu-arm.c +++ b/bfd/cpu-arm.c @@ -190,7 +190,7 @@ bfd_arm_merge_machines (bfd *ibfd, bfd *obfd) { /* xgettext: c-format */ _bfd_error_handler (_("\ -error: %B is compiled for the EP9312, whereas %B is compiled for XScale"), +error: %pB is compiled for the EP9312, whereas %pB is compiled for XScale"), ibfd, obfd); bfd_set_error (bfd_error_wrong_format); return FALSE; @@ -202,7 +202,7 @@ error: %B is compiled for the EP9312, whereas %B is compiled for XScale"), { /* xgettext: c-format */ _bfd_error_handler (_("\ -error: %B is compiled for the EP9312, whereas %B is compiled for XScale"), +error: %pB is compiled for the EP9312, whereas %pB is compiled for XScale"), obfd, ibfd); bfd_set_error (bfd_error_wrong_format); return FALSE; @@ -335,7 +335,7 @@ bfd_arm_update_notes (bfd *abfd, const char *note_section) { _bfd_error_handler /* xgettext: c-format */ - (_("warning: unable to update contents of %s section in %B"), + (_("warning: unable to update contents of %s section in %pB"), note_section, abfd); goto FAIL; } diff --git a/bfd/development.sh b/bfd/development.sh index 918150f..27a7150 100644 --- a/bfd/development.sh +++ b/bfd/development.sh @@ -16,4 +16,4 @@ # along with this program. If not, see . # Controls whether to enable development-mode features by default. -development=false +development=true diff --git a/bfd/dwarf1.c b/bfd/dwarf1.c index 71bc57b..f272ea8 100644 --- a/bfd/dwarf1.c +++ b/bfd/dwarf1.c @@ -213,6 +213,7 @@ parse_die (bfd * abfd, /* Then the attributes. */ while (xptr + 2 <= aDiePtrEnd) { + unsigned int block_len; unsigned short attr; /* Parse the attribute based on its form. This section @@ -255,12 +256,24 @@ parse_die (bfd * abfd, break; case FORM_BLOCK2: if (xptr + 2 <= aDiePtrEnd) - xptr += bfd_get_16 (abfd, xptr); + { + block_len = bfd_get_16 (abfd, xptr); + if (xptr + block_len > aDiePtrEnd + || xptr + block_len < xptr) + return FALSE; + xptr += block_len; + } xptr += 2; break; case FORM_BLOCK4: if (xptr + 4 <= aDiePtrEnd) - xptr += bfd_get_32 (abfd, xptr); + { + block_len = bfd_get_32 (abfd, xptr); + if (xptr + block_len > aDiePtrEnd + || xptr + block_len < xptr) + return FALSE; + xptr += block_len; + } xptr += 4; break; case FORM_STRING: diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c index a4a0dda..ca22db7 100644 --- a/bfd/dwarf2.c +++ b/bfd/dwarf2.c @@ -540,7 +540,7 @@ read_section (bfd * abfd, } if (! msec) { - _bfd_error_handler (_("Dwarf Error: Can't find %s section."), + _bfd_error_handler (_("DWARF error: can't find %s section."), sec->uncompressed_name); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -569,9 +569,10 @@ read_section (bfd * abfd, if (offset != 0 && offset >= *section_size) { /* xgettext: c-format */ - _bfd_error_handler (_("Dwarf Error: Offset (%llu)" - " greater than or equal to %s size (%Lu)."), - (long long) offset, section_name, *section_size); + _bfd_error_handler (_("DWARF error: offset (%" PRIu64 ")" + " greater than or equal to %s size (%" PRIu64 ")"), + (uint64_t) offset, section_name, + (uint64_t) *section_size); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -622,14 +623,24 @@ read_8_bytes (bfd *abfd, bfd_byte *buf, bfd_byte *end) } static bfd_byte * -read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED, - bfd_byte *buf, - bfd_byte *end, - unsigned int size ATTRIBUTE_UNUSED) +read_n_bytes (bfd_byte * buf, + bfd_byte * end, + struct dwarf_block * block) { - if (buf + size > end) - return NULL; - return buf; + unsigned int size = block->size; + bfd_byte * block_end = buf + size; + + if (block_end > end || block_end < buf) + { + block->data = NULL; + block->size = 0; + return end; + } + else + { + block->data = buf; + return block_end; + } } /* Scans a NUL terminated string starting at BUF, returning a pointer to it. @@ -1086,7 +1097,7 @@ read_attribute_value (struct attribute * attr, if (info_ptr >= info_ptr_end && form != DW_FORM_flag_present) { - _bfd_error_handler (_("Dwarf Error: Info pointer extends beyond end of attributes")); + _bfd_error_handler (_("DWARF error: info pointer extends beyond end of attributes")); bfd_set_error (bfd_error_bad_value); return info_ptr; } @@ -1127,8 +1138,7 @@ read_attribute_value (struct attribute * attr, return NULL; blk->size = read_2_bytes (abfd, info_ptr, info_ptr_end); info_ptr += 2; - blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size); - info_ptr += blk->size; + info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk); attr->u.blk = blk; break; case DW_FORM_block4: @@ -1138,8 +1148,7 @@ read_attribute_value (struct attribute * attr, return NULL; blk->size = read_4_bytes (abfd, info_ptr, info_ptr_end); info_ptr += 4; - blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size); - info_ptr += blk->size; + info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk); attr->u.blk = blk; break; case DW_FORM_data2: @@ -1179,8 +1188,7 @@ read_attribute_value (struct attribute * attr, blk->size = _bfd_safe_read_leb128 (abfd, info_ptr, &bytes_read, FALSE, info_ptr_end); info_ptr += bytes_read; - blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size); - info_ptr += blk->size; + info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk); attr->u.blk = blk; break; case DW_FORM_block1: @@ -1190,8 +1198,7 @@ read_attribute_value (struct attribute * attr, return NULL; blk->size = read_1_byte (abfd, info_ptr, info_ptr_end); info_ptr += 1; - blk->data = read_n_bytes (abfd, info_ptr, info_ptr_end, blk->size); - info_ptr += blk->size; + info_ptr = read_n_bytes (info_ptr, info_ptr_end, blk); attr->u.blk = blk; break; case DW_FORM_data1: @@ -1258,7 +1265,7 @@ read_attribute_value (struct attribute * attr, attr->u.sval = implicit_const; break; default: - _bfd_error_handler (_("Dwarf Error: Invalid or unhandled FORM value: %#x."), + _bfd_error_handler (_("DWARF error: invalid or unhandled FORM value: %#x"), form); bfd_set_error (bfd_error_bad_value); return NULL; @@ -1564,7 +1571,7 @@ concat_filename (struct line_info_table *table, unsigned int file) /* FILE == 0 means unknown. */ if (file) _bfd_error_handler - (_("Dwarf Error: mangled line number section (bad file number).")); + (_("DWARF error: mangled line number section (bad file number)")); return strdup (""); } @@ -1909,7 +1916,7 @@ read_formatted_entries (struct comp_unit *unit, bfd_byte **bufp, buf += bytes_read; if (format_count == 0 && data_count != 0) { - _bfd_error_handler (_("Dwarf Error: Zero format count.")); + _bfd_error_handler (_("DWARF error: zero format count")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1918,8 +1925,9 @@ read_formatted_entries (struct comp_unit *unit, bfd_byte **bufp, if we know that we are going to run out of buffer. */ if (data_count > (bfd_vma) (buf_end - buf)) { - _bfd_error_handler (_("Dwarf Error: data count (%Lx) larger than buffer size."), - data_count); + _bfd_error_handler + (_("DWARF error: data count (%" PRIx64 ") larger than buffer size"), + (uint64_t) data_count); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1959,8 +1967,8 @@ read_formatted_entries (struct comp_unit *unit, bfd_byte **bufp, break; default: _bfd_error_handler - (_("Dwarf Error: Unknown format content type %Lu."), - content_type); + (_("DWARF error: unknown format content type %" PRIu64), + (uint64_t) content_type); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2039,8 +2047,8 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) if (stash->dwarf_line_size < 16) { _bfd_error_handler - (_("Dwarf Error: Line info section is too small (%Ld)"), - stash->dwarf_line_size); + (_("DWARF error: line info section is too small (%" PRId64 ")"), + (int64_t) stash->dwarf_line_size); bfd_set_error (bfd_error_bad_value); return NULL; } @@ -2069,9 +2077,9 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) { _bfd_error_handler /* xgettext: c-format */ - (_("Dwarf Error: Line info data is bigger (%#Lx)" + (_("DWARF error: line info data is bigger (%#" PRIx64 ")" " than the space remaining in the section (%#lx)"), - lh.total_length, (unsigned long) (line_end - line_ptr)); + (uint64_t) lh.total_length, (unsigned long) (line_end - line_ptr)); bfd_set_error (bfd_error_bad_value); return NULL; } @@ -2082,7 +2090,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) if (lh.version < 2 || lh.version > 5) { _bfd_error_handler - (_("Dwarf Error: Unhandled .debug_line version %d."), lh.version); + (_("DWARF error: unhandled .debug_line version %d"), lh.version); bfd_set_error (bfd_error_bad_value); return NULL; } @@ -2092,7 +2100,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) >= line_end) { _bfd_error_handler - (_("Dwarf Error: Ran out of room reading prologue")); + (_("DWARF error: ran out of room reading prologue")); bfd_set_error (bfd_error_bad_value); return NULL; } @@ -2110,7 +2118,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) if (segment_selector_size != 0) { _bfd_error_handler - (_("Dwarf Error: Line info unsupported segment selector size %u."), + (_("DWARF error: line info unsupported segment selector size %u"), segment_selector_size); bfd_set_error (bfd_error_bad_value); return NULL; @@ -2137,7 +2145,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) if (lh.maximum_ops_per_insn == 0) { _bfd_error_handler - (_("Dwarf Error: Invalid maximum operations per instruction.")); + (_("DWARF error: invalid maximum operations per instruction")); bfd_set_error (bfd_error_bad_value); return NULL; } @@ -2156,7 +2164,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) if (line_ptr + (lh.opcode_base - 1) >= line_end) { - _bfd_error_handler (_("Dwarf Error: Ran out of room reading opcodes")); + _bfd_error_handler (_("DWARF error: ran out of room reading opcodes")); bfd_set_error (bfd_error_bad_value); return NULL; } @@ -2329,7 +2337,7 @@ decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) break; default: _bfd_error_handler - (_("Dwarf Error: mangled line number section.")); + (_("DWARF error: mangled line number section")); bfd_set_error (bfd_error_bad_value); line_fail: if (filename != NULL) @@ -2788,11 +2796,13 @@ lookup_symbol_in_variable_table (struct comp_unit *unit, } static bfd_boolean -find_abstract_instance_name (struct comp_unit *unit, - bfd_byte *orig_info_ptr, - struct attribute *attr_ptr, - const char **pname, - bfd_boolean *is_linkage) +find_abstract_instance (struct comp_unit * unit, + bfd_byte * orig_info_ptr, + struct attribute * attr_ptr, + const char ** pname, + bfd_boolean * is_linkage, + char ** filename_ptr, + int * linenumber_ptr) { bfd *abfd = unit->abfd; bfd_byte *info_ptr; @@ -2830,7 +2840,7 @@ find_abstract_instance_name (struct comp_unit *unit, if (!die_ref || die_ref >= total) { _bfd_error_handler - (_("Dwarf Error: Invalid abstract instance DIE ref.")); + (_("DWARF error: invalid abstract instance DIE ref")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2867,8 +2877,8 @@ find_abstract_instance_name (struct comp_unit *unit, if (info_ptr == NULL) { _bfd_error_handler - (_("Dwarf Error: Unable to read alt ref %llu."), - (long long) die_ref); + (_("DWARF error: unable to read alt ref %" PRIu64), + (uint64_t) die_ref); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2891,7 +2901,7 @@ find_abstract_instance_name (struct comp_unit *unit, if (!die_ref || die_ref >= total) { _bfd_error_handler - (_("Dwarf Error: Invalid abstract instance DIE ref.")); + (_("DWARF error: invalid abstract instance DIE ref")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2908,7 +2918,7 @@ find_abstract_instance_name (struct comp_unit *unit, if (! abbrev) { _bfd_error_handler - (_("Dwarf Error: Could not find abbrev number %u."), abbrev_number); + (_("DWARF error: could not find abbrev number %u"), abbrev_number); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2925,7 +2935,7 @@ find_abstract_instance_name (struct comp_unit *unit, if (info_ptr == orig_info_ptr) { _bfd_error_handler - (_("Dwarf Error: Abstract instance recursion detected.")); + (_("DWARF error: abstract instance recursion detected")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2942,8 +2952,9 @@ find_abstract_instance_name (struct comp_unit *unit, } break; case DW_AT_specification: - if (!find_abstract_instance_name (unit, info_ptr, &attr, - pname, is_linkage)) + if (!find_abstract_instance (unit, info_ptr, &attr, + pname, is_linkage, + filename_ptr, linenumber_ptr)) return FALSE; break; case DW_AT_linkage_name: @@ -2956,6 +2967,13 @@ find_abstract_instance_name (struct comp_unit *unit, *is_linkage = TRUE; } break; + case DW_AT_decl_file: + *filename_ptr = concat_filename (unit->line_table, + attr.u.val); + break; + case DW_AT_decl_line: + *linenumber_ptr = attr.u.val; + break; default: break; } @@ -3073,7 +3091,7 @@ scan_unit_for_symbols (struct comp_unit *unit) if (abbrev_number != previous_failed_abbrev) { _bfd_error_handler - (_("Dwarf Error: Could not find abbrev number %u."), + (_("DWARF error: could not find abbrev number %u"), abbrev_number); previous_failed_abbrev = abbrev_number; } @@ -3148,9 +3166,11 @@ scan_unit_for_symbols (struct comp_unit *unit) case DW_AT_abstract_origin: case DW_AT_specification: - if (!find_abstract_instance_name (unit, info_ptr, &attr, - &func->name, - &func->is_linkage)) + if (!find_abstract_instance (unit, info_ptr, &attr, + &func->name, + &func->is_linkage, + &func->file, + &func->line)) goto fail; break; @@ -3344,8 +3364,8 @@ parse_comp_unit (struct dwarf2_debug *stash, if (version) { _bfd_error_handler - (_("Dwarf Error: found dwarf version '%u', this reader" - " only handles version 2, 3, 4 and 5 information."), version); + (_("DWARF error: found dwarf version '%u', this reader" + " only handles version 2, 3, 4 and 5 information"), version); bfd_set_error (bfd_error_bad_value); } return NULL; @@ -3388,8 +3408,8 @@ parse_comp_unit (struct dwarf2_debug *stash, { _bfd_error_handler /* xgettext: c-format */ - (_("Dwarf Error: found address size '%u', this reader" - " can not handle sizes greater than '%u'."), + (_("DWARF error: found address size '%u', this reader" + " can not handle sizes greater than '%u'"), addr_size, (unsigned int) sizeof (bfd_vma)); bfd_set_error (bfd_error_bad_value); @@ -3399,8 +3419,8 @@ parse_comp_unit (struct dwarf2_debug *stash, if (addr_size != 2 && addr_size != 4 && addr_size != 8) { _bfd_error_handler - ("Dwarf Error: found address size '%u', this reader" - " can only handle address sizes '2', '4' and '8'.", addr_size); + ("DWARF error: found address size '%u', this reader" + " can only handle address sizes '2', '4' and '8'", addr_size); bfd_set_error (bfd_error_bad_value); return NULL; } @@ -3425,7 +3445,7 @@ parse_comp_unit (struct dwarf2_debug *stash, abbrev = lookup_abbrev (abbrev_number, abbrevs); if (! abbrev) { - _bfd_error_handler (_("Dwarf Error: Could not find abbrev number %u."), + _bfd_error_handler (_("DWARF error: could not find abbrev number %u"), abbrev_number); bfd_set_error (bfd_error_bad_value); return NULL; @@ -3491,7 +3511,7 @@ parse_comp_unit (struct dwarf2_debug *stash, if (! is_str_attr (attr.form)) { _bfd_error_handler - (_("Dwarf Error: DW_AT_comp_dir attribute encountered with a non-string form.")); + (_("DWARF error: DW_AT_comp_dir attribute encountered with a non-string form")); comp_dir = NULL; } diff --git a/bfd/ecoff.c b/bfd/ecoff.c index e9d1eae..c947e60 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -182,6 +182,13 @@ _bfd_ecoff_new_section_hook (bfd *abfd, asection *section) return _bfd_generic_new_section_hook (abfd, section); } +void +_bfd_ecoff_set_alignment_hook (bfd *abfd ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + void *scnhdr ATTRIBUTE_UNUSED) +{ +} + /* Determine the machine architecture and type. This is called from the generic COFF routines. It is the inverse of ecoff_get_magic, below. This could be an ECOFF backend routine, with one version @@ -961,7 +968,7 @@ _bfd_ecoff_slurp_symbol_table (bfd *abfd) bfd_get_symcount (abfd) = internal_ptr - internal; _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: isymMax (%ld) is greater than ifdMax (%ld)"), + (_("%pB: warning: isymMax (%ld) is greater than ifdMax (%ld)"), abfd, ecoff_data (abfd)->debug_info.symbolic_header.isymMax, ecoff_data (abfd)->debug_info.symbolic_header.ifdMax); } @@ -1258,7 +1265,7 @@ ecoff_type_to_string (bfd *abfd, FDR *fdr, unsigned int indx) break; default: - sprintf (p1, _("Unknown basic type %d"), (int) basic_type); + sprintf (p1, _("unknown basic type %d"), (int) basic_type); break; } diff --git a/bfd/elf-attrs.c b/bfd/elf-attrs.c index 1783f63..dfdf1a5 100644 --- a/bfd/elf-attrs.c +++ b/bfd/elf-attrs.c @@ -472,8 +472,9 @@ _bfd_elf_parse_attributes (bfd *abfd, Elf_Internal_Shdr * hdr) len -= section_len; if (section_len <= 4) { - _bfd_error_handler (_("%B: error: attribute section length too small: %ld"), - abfd, section_len); + _bfd_error_handler + (_("%pB: error: attribute section length too small: %" PRId64), + abfd, (int64_t) section_len); break; } section_len -= 4; @@ -600,7 +601,7 @@ _bfd_elf_merge_object_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B: Object has vendor-specific contents that " + (_("error: %pB: object has vendor-specific contents that " "must be processed by the '%s' toolchain"), ibfd, in_attr->s); return FALSE; @@ -610,7 +611,7 @@ _bfd_elf_merge_object_attributes (bfd *ibfd, struct bfd_link_info *info) || (in_attr->i != 0 && strcmp (in_attr->s, out_attr->s) != 0)) { /* xgettext:c-format */ - _bfd_error_handler (_("error: %B: Object tag '%d, %s' is " + _bfd_error_handler (_("error: %pB: object tag '%d, %s' is " "incompatible with tag '%d, %s'"), ibfd, in_attr->i, in_attr->s ? in_attr->s : "", diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index b580dc2..afd6982 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -872,13 +872,13 @@ struct elf_backend_data const void *arch_data; /* A function to translate an ELF RELA relocation to a BFD arelent - structure. */ - void (*elf_info_to_howto) + structure. Returns TRUE upon success, FALSE otherwise. */ + bfd_boolean (*elf_info_to_howto) (bfd *, arelent *, Elf_Internal_Rela *); /* A function to translate an ELF REL relocation to a BFD arelent - structure. */ - void (*elf_info_to_howto_rel) + structure. Returns TRUE upon success, FALSE otherwise. */ + bfd_boolean (*elf_info_to_howto_rel) (bfd *, arelent *, Elf_Internal_Rela *); /* A function to determine whether a symbol is global when @@ -1352,7 +1352,7 @@ struct elf_backend_data (bfd *); reloc_howto_type *(*elf_backend_mips_rtype_to_howto) - (unsigned int, bfd_boolean); + (bfd *, unsigned int, bfd_boolean); /* The swapping table to use when dealing with ECOFF information. Used for the MIPS ELF .mdebug section. */ @@ -2181,7 +2181,7 @@ extern const struct bfd_elf_special_section *_bfd_elf_get_sec_type_attr (bfd *, asection *); /* If the target doesn't have reloc handling written yet: */ -extern void _bfd_elf_no_info_to_howto +extern bfd_boolean _bfd_elf_no_info_to_howto (bfd *, arelent *, Elf_Internal_Rela *); extern bfd_boolean bfd_section_from_shdr @@ -2270,7 +2270,9 @@ extern bfd_boolean _bfd_elf_validate_reloc extern bfd_boolean _bfd_elf_link_create_dynamic_sections (bfd *, struct bfd_link_info *); -extern bfd_boolean _bfd_elf_link_omit_section_dynsym +extern bfd_boolean _bfd_elf_omit_section_dynsym_default + (bfd *, struct bfd_link_info *, asection *); +extern bfd_boolean _bfd_elf_omit_section_dynsym_all (bfd *, struct bfd_link_info *, asection *); extern bfd_boolean _bfd_elf_create_dynamic_sections (bfd *, struct bfd_link_info *); diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c index 95697c4..12f06ef 100644 --- a/bfd/elf-eh-frame.c +++ b/bfd/elf-eh-frame.c @@ -939,7 +939,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, { (*info->callbacks->minfo) /* xgettext:c-format */ - (_("discarding zero address range FDE in %B(%A).\n"), + (_("discarding zero address range FDE in %pB(%pA).\n"), abfd, sec); this_inf->u.fde.cie_inf = NULL; } @@ -1042,9 +1042,9 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info, goto success; free_no_table: - (*info->callbacks->einfo) + _bfd_error_handler /* xgettext:c-format */ - (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"), + (_("error in %pB(%pA); no .eh_frame_hdr table will be created"), abfd, sec); hdr_info->u.dwarf.table = FALSE; if (sec_info) @@ -1532,16 +1532,16 @@ _bfd_elf_discard_section_eh_frame hdr_info->u.dwarf.table = FALSE; if (num_warnings_issued < 10) { - (*info->callbacks->einfo) + _bfd_error_handler /* xgettext:c-format */ - (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr" - " table being created.\n"), abfd, sec); + (_("FDE encoding in %pB(%pA) prevents .eh_frame_hdr" + " table being created"), abfd, sec); num_warnings_issued ++; } else if (num_warnings_issued == 10) { - (*info->callbacks->einfo) - (_("%P: Further warnings about FDE encoding preventing .eh_frame_hdr generation dropped.\n")); + _bfd_error_handler + (_("further warnings about FDE encoding preventing .eh_frame_hdr generation dropped")); num_warnings_issued ++; } } @@ -1863,7 +1863,7 @@ _bfd_elf_write_section_eh_frame_entry (bfd *abfd, struct bfd_link_info *info, if (addr <= last_addr) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: %A not in order"), sec->owner, sec); + _bfd_error_handler (_("%pB: %pA not in order"), sec->owner, sec); return FALSE; } @@ -1877,7 +1877,7 @@ _bfd_elf_write_section_eh_frame_entry (bfd *abfd, struct bfd_link_info *info, if (addr & 1) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: %A invalid input section size"), + _bfd_error_handler (_("%pB: %pA invalid input section size"), sec->owner, sec); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1885,7 +1885,7 @@ _bfd_elf_write_section_eh_frame_entry (bfd *abfd, struct bfd_link_info *info, if (last_addr >= addr + sec->rawsize) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: %A points past end of text section"), + _bfd_error_handler (_("%pB: %pA points past end of text section"), sec->owner, sec); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -2133,9 +2133,9 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, address += elf_gp (abfd); break; default: - (*info->callbacks->einfo) - (_("%P: DW_EH_PE_datarel unspecified" - " for this architecture.\n")); + _bfd_error_handler + (_("DW_EH_PE_datarel unspecified" + " for this architecture")); /* Fall thru */ case bfd_arch_frv: case bfd_arch_i386: @@ -2304,7 +2304,7 @@ _bfd_elf_fixup_eh_frame_hdr (struct bfd_link_info *info) if (sec->output_section != osec) { _bfd_error_handler - (_("Invalid output section for .eh_frame_entry: %A"), + (_("invalid output section for .eh_frame_entry: %pA"), sec->output_section); return FALSE; } @@ -2327,7 +2327,7 @@ _bfd_elf_fixup_eh_frame_hdr (struct bfd_link_info *info) if (i != 0) { _bfd_error_handler - (_("Invalid contents in %A section"), osec); + (_("invalid contents in %pA section"), osec); return FALSE; } @@ -2483,10 +2483,9 @@ write_dwarf_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) overlap = TRUE; } if (overflow) - (*info->callbacks->einfo) (_("%P: .eh_frame_hdr entry overflow.\n")); + _bfd_error_handler (_(".eh_frame_hdr entry overflow")); if (overlap) - (*info->callbacks->einfo) - (_("%P: .eh_frame_hdr refers to overlapping FDEs.\n")); + _bfd_error_handler (_(".eh_frame_hdr refers to overlapping FDEs")); if (overflow || overlap) { bfd_set_error (bfd_error_bad_value); diff --git a/bfd/elf-hppa.h b/bfd/elf-hppa.h index b87ee83..95ac96c 100644 --- a/bfd/elf-hppa.h +++ b/bfd/elf-hppa.h @@ -1020,26 +1020,44 @@ _bfd_elf_hppa_gen_reloc_type (bfd *abfd, /* Translate from an elf into field into a howto relocation pointer. */ -static void +static bfd_boolean elf_hppa_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { - BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info) - < (unsigned int) R_PARISC_UNIMPLEMENTED); - bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)]; + unsigned int r_type = ELF32_R_TYPE (elf_reloc->r_info); + + if (r_type >= (unsigned int) R_PARISC_UNIMPLEMENTED) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + bfd_reloc->howto = &elf_hppa_howto_table[r_type]; + return TRUE; } /* Translate from an elf into field into a howto relocation pointer. */ -static void -elf_hppa_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +elf_hppa_info_to_howto_rel (bfd *abfd, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { - BFD_ASSERT (ELF_R_TYPE (elf_reloc->r_info) - < (unsigned int) R_PARISC_UNIMPLEMENTED); - bfd_reloc->howto = &elf_hppa_howto_table[ELF_R_TYPE (elf_reloc->r_info)]; + unsigned int r_type = ELF_R_TYPE (elf_reloc->r_info); + + if (r_type >= (unsigned int) R_PARISC_UNIMPLEMENTED) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + bfd_reloc->howto = &elf_hppa_howto_table[r_type]; + return TRUE; } /* Return the address of the howto table entry to perform the CODE diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c index 1fab440..5716ab3 100644 --- a/bfd/elf-ifunc.c +++ b/bfd/elf-ifunc.c @@ -140,7 +140,7 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info, info->callbacks->einfo /* xgettext:c-format */ (_("%F%P: dynamic STT_GNU_IFUNC symbol `%s' with pointer " - "equality in `%B' can not be used when making an " + "equality in `%pB' can not be used when making an " "executable; recompile with -fPIE and relink with -pie\n"), h->root.root.string, h->root.u.def.section->owner); diff --git a/bfd/elf-m10200.c b/bfd/elf-m10200.c index 82c4ee7..cc71c1e 100644 --- a/bfd/elf-m10200.c +++ b/bfd/elf-m10200.c @@ -212,16 +212,25 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an MN10200 ELF reloc. */ -static void -mn10200_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +mn10200_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_MN10200_MAX); + if (r_type >= (unsigned int) R_MN10200_MAX) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + cache_ptr->howto = &elf_mn10200_howto_table[r_type]; + return cache_ptr->howto != NULL; } /* Perform a relocation as part of a final link. */ @@ -1378,7 +1387,7 @@ mn10200_elf_get_relocated_section_contents (bfd *output_bfd, #define elf_backend_rela_normal 1 #define elf_info_to_howto mn10200_info_to_howto -#define elf_info_to_howto_rel 0 +#define elf_info_to_howto_rel NULL #define elf_backend_relocate_section mn10200_elf_relocate_section #define bfd_elf32_bfd_relax_section mn10200_elf_relax_section #define bfd_elf32_bfd_get_relocated_section_contents \ diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c index a91257e..f86346e 100644 --- a/bfd/elf-m10300.c +++ b/bfd/elf-m10300.c @@ -798,8 +798,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an MN10300 ELF reloc. */ -static void -mn10300_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +mn10300_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -809,12 +809,13 @@ mn10300_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= R_MN10300_MAX) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised MN10300 reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_MN10300_NONE; + return FALSE; } cache_ptr->howto = elf_mn10300_howto_table + r_type; + return TRUE; } static int @@ -1025,7 +1026,7 @@ mn10300_do_tls_transition (bfd * input_bfd, default: _bfd_error_handler /* xgettext:c-format */ - (_("%B: Unsupported transition from %s to %s"), + (_("%pB: unsupported transition from %s to %s"), input_bfd, elf_mn10300_howto_table[r_type].name, elf_mn10300_howto_table[tls_r_type].name); @@ -1194,7 +1195,7 @@ mn10300_elf_check_relocs (bfd *abfd, else _bfd_error_handler /* xgettext:c-format */ - (_("%B: %s' accessed both as normal and thread local symbol"), + (_("%pB: %s' accessed both as normal and thread local symbol"), abfd, h ? h->root.root.string : ""); } @@ -2090,10 +2091,11 @@ mn10300_elf_relocate_section (bfd *output_bfd, _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.root.string); } @@ -2155,7 +2157,7 @@ mn10300_elf_relocate_section (bfd *output_bfd, " library (did you forget -fpic?)"); else if (r_type == R_MN10300_GOT32) /* xgettext:c-format */ - msg = _("%B: taking the address of protected function" + msg = _("%pB: taking the address of protected function" " '%s' cannot be done when making a shared library"); else msg = _("internal error: suspicious relocation type used" @@ -5543,7 +5545,7 @@ mn10300_elf_mkobject (bfd *abfd) #endif #define elf_info_to_howto mn10300_info_to_howto -#define elf_info_to_howto_rel 0 +#define elf_info_to_howto_rel NULL #define elf_backend_can_gc_sections 1 #define elf_backend_rela_normal 1 #define elf_backend_check_relocs mn10300_elf_check_relocs @@ -5574,8 +5576,7 @@ mn10300_elf_mkobject (bfd *abfd) _bfd_mn10300_elf_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ _bfd_mn10300_elf_size_dynamic_sections -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all #define elf_backend_finish_dynamic_symbol \ _bfd_mn10300_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c index 2549dd0..50c0e9d 100644 --- a/bfd/elf-properties.c +++ b/bfd/elf-properties.c @@ -62,7 +62,7 @@ _bfd_elf_get_property (bfd *abfd, unsigned int type, unsigned int datasz) p = (elf_property_list *) bfd_alloc (abfd, sizeof (*p)); if (p == NULL) { - _bfd_error_handler (_("%B: out of memory in _bfd_elf_get_property"), + _bfd_error_handler (_("%pB: out of memory in _bfd_elf_get_property"), abfd); _exit (EXIT_FAILURE); } @@ -88,7 +88,7 @@ _bfd_elf_parse_gnu_properties (bfd *abfd, Elf_Internal_Note *note) { bad_size: _bfd_error_handler - (_("warning: %B: corrupt GNU_PROPERTY_TYPE (%ld) size: %#lx"), + (_("warning: %pB: corrupt GNU_PROPERTY_TYPE (%ld) size: %#lx"), abfd, note->type, note->descsz); return FALSE; } @@ -109,7 +109,7 @@ bad_size: if (datasz > (size_t) (ptr_end - ptr)) { _bfd_error_handler - (_("warning: %B: corrupt GNU_PROPERTY_TYPE (%ld) type (0x%x) datasz: 0x%x"), + (_("warning: %pB: corrupt GNU_PROPERTY_TYPE (%ld) type (0x%x) datasz: 0x%x"), abfd, note->type, type, datasz); /* Clear all properties. */ elf_properties (abfd) = NULL; @@ -148,7 +148,7 @@ bad_size: if (datasz != align_size) { _bfd_error_handler - (_("warning: %B: corrupt stack size: 0x%x"), + (_("warning: %pB: corrupt stack size: 0x%x"), abfd, datasz); /* Clear all properties. */ elf_properties (abfd) = NULL; @@ -166,7 +166,7 @@ bad_size: if (datasz != 0) { _bfd_error_handler - (_("warning: %B: corrupt no copy on protected size: 0x%x"), + (_("warning: %pB: corrupt no copy on protected size: 0x%x"), abfd, datasz); /* Clear all properties. */ elf_properties (abfd) = NULL; @@ -183,7 +183,7 @@ bad_size: } _bfd_error_handler - (_("warning: %B: unsupported GNU_PROPERTY_TYPE (%ld) type: 0x%x"), + (_("warning: %pB: unsupported GNU_PROPERTY_TYPE (%ld) type: 0x%x"), abfd, note->type, type); next: diff --git a/bfd/elf-s390-common.c b/bfd/elf-s390-common.c index 4aa6666..21195f2 100644 --- a/bfd/elf-s390-common.c +++ b/bfd/elf-s390-common.c @@ -286,12 +286,12 @@ elf_s390_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) if (in_attr->i > 2) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses unknown vector ABI %d"), ibfd, + (_("warning: %pB uses unknown vector ABI %d"), ibfd, in_attr->i); else if (out_attr->i > 2) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses unknown vector ABI %d"), obfd, + (_("warning: %pB uses unknown vector ABI %d"), obfd, out_attr->i); else if (in_attr->i != out_attr->i) { @@ -303,7 +303,7 @@ elf_s390_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses vector %s ABI, %B uses %s ABI"), + (_("warning: %pB uses vector %s ABI, %pB uses %s ABI"), ibfd, abi_str[in_attr->i], obfd, abi_str[out_attr->i]); } if (in_attr->i > out_attr->i) diff --git a/bfd/elf.c b/bfd/elf.c index 90aef09..8ea5a81 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -340,7 +340,7 @@ bfd_elf_string_from_elf_section (bfd *abfd, { /* PR 17512: file: f057ec89. */ /* xgettext:c-format */ - _bfd_error_handler (_("%B: attempt to load strings from" + _bfd_error_handler (_("%pB: attempt to load strings from" " a non-string section (number %d)"), abfd, shindex); return NULL; @@ -355,8 +355,8 @@ bfd_elf_string_from_elf_section (bfd *abfd, unsigned int shstrndx = elf_elfheader(abfd)->e_shstrndx; _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid string offset %u >= %Lu for section `%s'"), - abfd, strindex, hdr->sh_size, + (_("%pB: invalid string offset %u >= %" PRIu64 " for section `%s'"), + abfd, strindex, (uint64_t) hdr->sh_size, (shindex == shstrndx && strindex == hdr->sh_name ? ".shstrtab" : bfd_elf_string_from_elf_section (abfd, shstrndx, hdr->sh_name))); @@ -494,7 +494,7 @@ bfd_elf_get_elf_syms (bfd *ibfd, { symoffset += (esym - (bfd_byte *) extsym_buf) / extsym_size; /* xgettext:c-format */ - _bfd_error_handler (_("%B symbol number %lu references" + _bfd_error_handler (_("%pB symbol number %lu references" " nonexistent SHT_SYMTAB_SHNDX section"), ibfd, (unsigned long) symoffset); if (alloc_intsym != NULL) @@ -658,8 +658,9 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: corrupt size field in group section" - " header: %#Lx"), abfd, shdr->sh_size); + (_("%pB: corrupt size field in group section" + " header: %#" PRIx64), + abfd, (uint64_t) shdr->sh_size); bfd_set_error (bfd_error_bad_value); -- num_group; continue; @@ -673,8 +674,9 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid size field in group section" - " header: %#Lx"), abfd, shdr->sh_size); + (_("%pB: invalid size field in group section" + " header: %#" PRIx64 ""), + abfd, (uint64_t) shdr->sh_size); bfd_set_error (bfd_error_bad_value); -- num_group; /* PR 17510: If the group contents are even @@ -709,7 +711,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) if (idx >= shnum) { _bfd_error_handler - (_("%B: invalid SHT_GROUP entry"), abfd); + (_("%pB: invalid SHT_GROUP entry"), abfd); idx = 0; } dest->shdr = elf_elfsections (abfd)[idx]; @@ -728,7 +730,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) elf_tdata (abfd)->group_sect_ptr = NULL; elf_tdata (abfd)->num_group = num_group = -1; _bfd_error_handler - (_("%B: no valid group sections found"), abfd); + (_("%pB: no valid group sections found"), abfd); bfd_set_error (bfd_error_bad_value); } } @@ -757,7 +759,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) { /* See PR 21957 for a reproducer. */ /* xgettext:c-format */ - _bfd_error_handler (_("%B: group section '%A' has no contents"), + _bfd_error_handler (_("%pB: group section '%pA' has no contents"), abfd, shdr->bfd_section); elf_tdata (abfd)->group_sect_ptr[i] = NULL; bfd_set_error (bfd_error_bad_value); @@ -817,7 +819,7 @@ setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) if (elf_group_name (newsect) == NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: no group info for section '%A'"), + _bfd_error_handler (_("%pB: no group info for section '%pA'"), abfd, newsect); return FALSE; } @@ -848,7 +850,7 @@ _bfd_elf_setup_sections (bfd *abfd) if (bed->link_order_error_handler) bed->link_order_error_handler /* xgettext:c-format */ - (_("%B: warning: sh_link not set for section `%A'"), + (_("%pB: warning: sh_link not set for section `%pA'"), abfd, s); } else @@ -868,7 +870,7 @@ _bfd_elf_setup_sections (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: sh_link [%d] in section `%A' is incorrect"), + (_("%pB: sh_link [%d] in section `%pA' is incorrect"), s->owner, elfsec, s); result = FALSE; } @@ -881,7 +883,7 @@ _bfd_elf_setup_sections (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: SHT_GROUP section [index %d] has no SHF_GROUP sections"), + (_("%pB: SHT_GROUP section [index %d] has no SHF_GROUP sections"), abfd, elf_section_data (s)->this_idx); result = FALSE; } @@ -902,7 +904,7 @@ _bfd_elf_setup_sections (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: section group entry number %u is corrupt"), + (_("%pB: section group entry number %u is corrupt"), abfd, i); result = FALSE; continue; @@ -925,7 +927,7 @@ _bfd_elf_setup_sections (bfd *abfd) /* There are some unknown sections in the group. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: unknown type [%#x] section `%s' in group [%A]"), + (_("%pB: unknown type [%#x] section `%s' in group [%pA]"), abfd, idx->shdr->sh_type, bfd_elf_string_from_elf_section (abfd, @@ -1195,7 +1197,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unable to initialize compress status for section %s"), + (_("%pB: unable to initialize compress status for section %s"), abfd, name); return FALSE; } @@ -1206,7 +1208,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unable to initialize decompress status for section %s"), + (_("%pB: unable to initialize decompress status for section %s"), abfd, name); return FALSE; } @@ -1387,7 +1389,7 @@ copy_special_section_fields (const bfd *ibfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Invalid sh_link field (%d) in section number %d"), + (_("%pB: invalid sh_link field (%d) in section number %d"), ibfd, iheader->sh_link, secnum); return FALSE; } @@ -1403,7 +1405,7 @@ copy_special_section_fields (const bfd *ibfd, if we could not find a match ? */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: Failed to find link section for section %d"), obfd, secnum); + (_("%pB: failed to find link section for section %d"), obfd, secnum); } if (iheader->sh_info) @@ -1430,7 +1432,7 @@ copy_special_section_fields (const bfd *ibfd, else _bfd_error_handler /* xgettext:c-format */ - (_("%B: Failed to find info section for section %d"), obfd, secnum); + (_("%pB: failed to find info section for section %d"), obfd, secnum); } return changed; @@ -2013,7 +2015,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) if (sections_being_created [shindex]) { _bfd_error_handler - (_("%B: warning: loop in section dependencies detected"), abfd); + (_("%pB: warning: loop in section dependencies detected"), abfd); return FALSE; } sections_being_created [shindex] = TRUE; @@ -2121,7 +2123,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: multiple symbol tables detected" + (_("%pB: warning: multiple symbol tables detected" " - ignoring the table in section %u"), abfd, shindex); goto success; @@ -2205,7 +2207,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: multiple dynamic symbol tables detected" + (_("%pB: warning: multiple dynamic symbol tables detected" " - ignoring the table in section %u"), abfd, shindex); goto success; @@ -2318,7 +2320,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid link %u for reloc section %s (index %u)"), + (_("%pB: invalid link %u for reloc section %s (index %u)"), abfd, hdr->sh_link, name, shindex); ret = _bfd_elf_make_section_from_shdr (abfd, hdr, name, shindex); @@ -2477,7 +2479,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) for applications? */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: unknown type [%#x] section `%s'"), + (_("%pB: unknown type [%#x] section `%s'"), abfd, hdr->sh_type, name); else { @@ -2492,7 +2494,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) /* FIXME: We should handle this section. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: unknown type [%#x] section `%s'"), + (_("%pB: unknown type [%#x] section `%s'"), abfd, hdr->sh_type, name); else if (hdr->sh_type >= SHT_LOOS && hdr->sh_type <= SHT_HIOS) { @@ -2503,7 +2505,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) be rejected with an error message. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: unknown type [%#x] section `%s'"), + (_("%pB: unknown type [%#x] section `%s'"), abfd, hdr->sh_type, name); else { @@ -2516,7 +2518,7 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) /* FIXME: We should handle this section. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: unknown type [%#x] section `%s'"), + (_("%pB: unknown type [%#x] section `%s'"), abfd, hdr->sh_type, name); goto fail; @@ -3221,7 +3223,7 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: error: Alignment power %d of section `%A' is too big"), + (_("%pB: error: alignment power %d of section `%pA' is too big"), abfd, asect->alignment_power, asect); arg->failed = TRUE; return; @@ -3251,7 +3253,7 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg) non-bss input sections to bss output sections, or emit data to a bss output section via a linker script. */ _bfd_error_handler - (_("warning: section `%A' type changed to PROGBITS"), asect); + (_("warning: section `%pA' type changed to PROGBITS"), asect); this_hdr->sh_type = sh_type; } @@ -3727,7 +3729,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) if (section_number >= SHN_LORESERVE) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: too many sections: %u"), + _bfd_error_handler (_("%pB: too many sections: %u"), abfd, section_number); return FALSE; } @@ -3812,8 +3814,8 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) asection *kept; _bfd_error_handler /* xgettext:c-format */ - (_("%B: sh_link of section `%A' points to" - " discarded section `%A' of `%B'"), + (_("%pB: sh_link of section `%pA' points to" + " discarded section `%pA' of `%pB'"), abfd, d->this_hdr.bfd_section, s, s->owner); /* Point to the kept section if it has the same @@ -3837,8 +3839,8 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: sh_link of section `%A' points to" - " removed section `%A' of `%B'"), + (_("%pB: sh_link of section `%pA' points to" + " removed section `%pA' of `%pB'"), abfd, d->this_hdr.bfd_section, s, s->owner); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3859,7 +3861,7 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info) if (bed->link_order_error_handler) bed->link_order_error_handler /* xgettext:c-format */ - (_("%B: warning: sh_link not set for section `%A'"), + (_("%pB: warning: sh_link not set for section `%pA'"), abfd, sec); } } @@ -4389,7 +4391,7 @@ get_program_header_size (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: GNU_MBIN section `%A' has invalid sh_info field: %d"), + (_("%pB: GNU_MBIN section `%pA' has invalid sh_info field: %d"), abfd, s, elf_section_data (s)->this_hdr.sh_info); continue; } @@ -4542,6 +4544,9 @@ elf_modify_segment_map (bfd *abfd, return TRUE; } +#define IS_TBSS(s) \ + ((s->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) == SEC_THREAD_LOCAL) + /* Set up a mapping from BFD sections to program segments. */ bfd_boolean @@ -4727,33 +4732,35 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) the previous section, then we need a new segment. */ new_segment = TRUE; } + else if ((abfd->flags & D_PAGED) != 0 + && (((last_hdr->lma + last_size - 1) & -maxpagesize) + == (hdr->lma & -maxpagesize))) + { + /* If we are demand paged then we can't map two disk + pages onto the same memory page. */ + new_segment = FALSE; + } /* In the next test we have to be careful when last_hdr->lma is close to the end of the address space. If the aligned address wraps around to the start of the address space, then there are no more pages left in memory and it is OK to assume that the current section can be included in the current segment. */ - else if ((BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) + maxpagesize - > last_hdr->lma) - && (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) + maxpagesize - <= hdr->lma)) + else if ((BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) + + maxpagesize > last_hdr->lma) + && (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) + + maxpagesize <= hdr->lma)) { /* If putting this section in this segment would force us to skip a page in the segment, then we need a new segment. */ new_segment = TRUE; } else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0 - && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0 - && ((abfd->flags & D_PAGED) == 0 - || (((last_hdr->lma + last_size - 1) & -maxpagesize) - != (hdr->lma & -maxpagesize)))) + && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0) { /* We don't want to put a loaded section after a nonloaded (ie. bss style) section in the same segment as that will force the non-loaded section to be loaded. - Consider .tbss sections as loaded for this purpose. - However, like the writable/non-writable case below, - if they are on the same page then they must be put - in the same segment. */ + Consider .tbss sections as loaded for this purpose. */ new_segment = TRUE; } else if ((abfd->flags & D_PAGED) == 0) @@ -4770,20 +4777,10 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) new_segment = TRUE; } else if (! writable - && (hdr->flags & SEC_READONLY) == 0 - && ((info != NULL - && info->relro_end > info->relro_start) - || (((last_hdr->lma + last_size - 1) & -maxpagesize) - != (hdr->lma & -maxpagesize)))) + && (hdr->flags & SEC_READONLY) == 0) { /* We don't want to put a writable section in a read only - segment, unless they are on the same page in memory - anyhow and there is no RELRO segment. We already - know that the last section does not bring us past the - current section on the page, so the only case in which - the new section is not on the same page as the previous - section is when the previous section ends precisely on - a page boundary. */ + segment. */ new_segment = TRUE; } else @@ -4809,11 +4806,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) executable = TRUE; last_hdr = hdr; /* .tbss sections effectively have zero size. */ - if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) - != SEC_THREAD_LOCAL) - last_size = hdr->size; - else - last_size = 0; + last_size = !IS_TBSS (hdr) ? hdr->size : 0; continue; } @@ -4839,10 +4832,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) last_hdr = hdr; /* .tbss sections effectively have zero size. */ - if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) - last_size = hdr->size; - else - last_size = 0; + last_size = !IS_TBSS (hdr) ? hdr->size : 0; phdr_index = i; phdr_in_segment = FALSE; } @@ -4851,8 +4841,7 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) for .tbss. */ if (last_hdr != NULL && (i - phdr_index != 1 - || ((last_hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) - != SEC_THREAD_LOCAL))) + || !IS_TBSS (last_hdr))) { m = make_mapping (abfd, sections, phdr_index, i, phdr_in_segment); if (m == NULL) @@ -4948,18 +4937,18 @@ _bfd_elf_map_sections_to_segments (bfd *abfd, struct bfd_link_info *info) if ((s->flags & SEC_THREAD_LOCAL) == 0) { _bfd_error_handler - (_("%B: TLS sections are not adjacent:"), abfd); + (_("%pB: TLS sections are not adjacent:"), abfd); s = first_tls; i = 0; while (i < (unsigned int) tls_count) { if ((s->flags & SEC_THREAD_LOCAL) != 0) { - _bfd_error_handler (_(" TLS: %A"), s); + _bfd_error_handler (_(" TLS: %pA"), s); i++; } else - _bfd_error_handler (_(" non-TLS: %A"), s); + _bfd_error_handler (_(" non-TLS: %pA"), s); s = s->next; } bfd_set_error (bfd_error_bad_value); @@ -5455,7 +5444,7 @@ assign_file_positions_for_load_sections (bfd *abfd, && strcmp (m->sections[0]->name, ".dynamic") != 0) { _bfd_error_handler - (_("%B: The first section in the PT_DYNAMIC segment" + (_("%pB: The first section in the PT_DYNAMIC segment" " is not the .dynamic section"), abfd); bfd_set_error (bfd_error_bad_value); @@ -5483,7 +5472,7 @@ assign_file_positions_for_load_sections (bfd *abfd, && p->p_paddr < (bfd_vma) off)) { _bfd_error_handler - (_("%B: Not enough room for program headers," + (_("%pB: not enough room for program headers," " try linking with -N"), abfd); bfd_set_error (bfd_error_bad_value); @@ -5571,8 +5560,8 @@ assign_file_positions_for_load_sections (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: section %A lma %#Lx adjusted to %#Lx"), - abfd, sec, s_start, p_end); + (_("%pB: section %pA lma %#" PRIx64 " adjusted to %#" PRIx64), + abfd, sec, (uint64_t) s_start, (uint64_t) p_end); adjust = 0; sec->lma = p_end; } @@ -5708,7 +5697,7 @@ assign_file_positions_for_load_sections (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: section `%A' can't be allocated in segment %d"), + (_("%pB: section `%pA' can't be allocated in segment %d"), abfd, sec, j); print_segment_map (m); } @@ -5756,7 +5745,7 @@ assign_file_positions_for_non_load_sections (bfd *abfd, if (hdr->sh_size != 0) _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: allocated section `%s' not in segment"), + (_("%pB: warning: allocated section `%s' not in segment"), abfd, (hdr->bfd_section == NULL ? "*unknown*" @@ -5869,65 +5858,100 @@ assign_file_positions_for_non_load_sections (bfd *abfd, { if (p->p_type == PT_GNU_RELRO) { - const Elf_Internal_Phdr *lp; - struct elf_segment_map *lm; + bfd_vma start, end; + bfd_boolean ok; if (link_info != NULL) { /* During linking the range of the RELRO segment is passed - in link_info. */ + in link_info. Note that there may be padding between + relro_start and the first RELRO section. */ + start = link_info->relro_start; + end = link_info->relro_end; + } + else if (m->count != 0) + { + if (!m->p_size_valid) + abort (); + start = m->sections[0]->vma; + end = start + m->p_size; + } + else + { + start = 0; + end = 0; + } + + ok = FALSE; + if (start < end) + { + struct elf_segment_map *lm; + const Elf_Internal_Phdr *lp; + unsigned int i; + + /* Find a LOAD segment containing a section in the RELRO + segment. */ for (lm = elf_seg_map (abfd), lp = phdrs; lm != NULL; lm = lm->next, lp++) { if (lp->p_type == PT_LOAD - && lp->p_vaddr < link_info->relro_end && lm->count != 0 - && lm->sections[0]->vma >= link_info->relro_start) + && (lm->sections[lm->count - 1]->vma + + (!IS_TBSS (lm->sections[lm->count - 1]) + ? lm->sections[lm->count - 1]->size + : 0)) > start + && lm->sections[0]->vma < end) break; } - BFD_ASSERT (lm != NULL); - } - else - { - /* Otherwise we are copying an executable or shared - library, but we need to use the same linker logic. */ - for (lp = phdrs; lp < phdrs + count; ++lp) + if (lm != NULL) { - if (lp->p_type == PT_LOAD - && lp->p_paddr == p->p_paddr) - break; - } - } + /* Find the section starting the RELRO segment. */ + for (i = 0; i < lm->count; i++) + { + asection *s = lm->sections[i]; + if (s->vma >= start + && s->vma < end + && s->size != 0) + break; + } - if (lp < phdrs + count) - { - p->p_vaddr = lp->p_vaddr; - p->p_paddr = lp->p_paddr; - p->p_offset = lp->p_offset; - if (link_info != NULL) - p->p_filesz = link_info->relro_end - lp->p_vaddr; - else if (m->p_size_valid) - p->p_filesz = m->p_size; - else - abort (); - p->p_memsz = p->p_filesz; - /* Preserve the alignment and flags if they are valid. The - gold linker generates RW/4 for the PT_GNU_RELRO section. - It is better for objcopy/strip to honor these attributes - otherwise gdb will choke when using separate debug files. - */ - if (!m->p_align_valid) - p->p_align = 1; - if (!m->p_flags_valid) - p->p_flags = PF_R; - } - else - { - memset (p, 0, sizeof *p); - p->p_type = PT_NULL; + if (i < lm->count) + { + p->p_vaddr = lm->sections[i]->vma; + p->p_paddr = lm->sections[i]->lma; + p->p_offset = lm->sections[i]->filepos; + p->p_memsz = end - p->p_vaddr; + p->p_filesz = p->p_memsz; + + /* The RELRO segment typically ends a few bytes + into .got.plt but other layouts are possible. + In cases where the end does not match any + loaded section (for instance is in file + padding), trim p_filesz back to correspond to + the end of loaded section contents. */ + if (p->p_filesz > lp->p_vaddr + lp->p_filesz - p->p_vaddr) + p->p_filesz = lp->p_vaddr + lp->p_filesz - p->p_vaddr; + + /* Preserve the alignment and flags if they are + valid. The gold linker generates RW/4 for + the PT_GNU_RELRO section. It is better for + objcopy/strip to honor these attributes + otherwise gdb will choke when using separate + debug files. */ + if (!m->p_align_valid) + p->p_align = 1; + if (!m->p_flags_valid) + p->p_flags = PF_R; + ok = TRUE; + } + } } + if (link_info != NULL) + BFD_ASSERT (ok); + if (!ok) + memset (p, 0, sizeof *p); } else if (p->p_type == PT_GNU_STACK) { @@ -5954,7 +5978,7 @@ assign_file_positions_for_non_load_sections (bfd *abfd, { /* PR 17512: file: 2195325e. */ _bfd_error_handler - (_("%B: error: non-load segment %d includes file header " + (_("%pB: error: non-load segment %d includes file header " "and/or program header"), abfd, (int) (p - phdrs)); return FALSE; @@ -6103,9 +6127,7 @@ assign_file_positions_except_relocs (bfd *abfd, } /* Write out the program headers. */ - alloc = elf_program_header_size (abfd) / bed->s->sizeof_phdr; - - /* Sort the program headers into the ordering required by the ELF standard. */ + alloc = elf_elfheader (abfd)->e_phnum; if (alloc == 0) return TRUE; @@ -6122,17 +6144,19 @@ assign_file_positions_except_relocs (bfd *abfd, changed or the programs updated. */ if (alloc > 1 && tdata->phdr[0].p_type == PT_PHDR - && ! bed->elf_backend_allow_non_load_phdr (abfd, tdata->phdr, alloc) + && (bed->elf_backend_allow_non_load_phdr == NULL + || !bed->elf_backend_allow_non_load_phdr (abfd, tdata->phdr, + alloc)) && tdata->phdr[1].p_type == PT_LOAD && (tdata->phdr[1].p_vaddr > tdata->phdr[0].p_vaddr - || (tdata->phdr[1].p_vaddr + tdata->phdr[1].p_memsz) - < (tdata->phdr[0].p_vaddr + tdata->phdr[0].p_memsz))) + || (tdata->phdr[1].p_vaddr + tdata->phdr[1].p_memsz + < tdata->phdr[0].p_vaddr + tdata->phdr[0].p_memsz))) { /* The fix for this error is usually to edit the linker script being used and set up the program headers manually. Either that or leave room for the headers at the start of the SECTIONS. */ - _bfd_error_handler (_("\ -%B: error: PHDR segment not covered by LOAD segment"), + _bfd_error_handler (_("%pB: error: PHDR segment not covered" + " by LOAD segment"), abfd); return FALSE; } @@ -6362,7 +6386,8 @@ _bfd_elf_write_object_contents (bfd *abfd) = _bfd_elf_strtab_offset (elf_shstrtab (abfd), i_shdrp[count]->sh_name); if (bed->elf_backend_section_processing) - (*bed->elf_backend_section_processing) (abfd, i_shdrp[count]); + if (!(*bed->elf_backend_section_processing) (abfd, i_shdrp[count])) + return FALSE; if (i_shdrp[count]->contents) { bfd_size_type amt = i_shdrp[count]->sh_size; @@ -6475,7 +6500,7 @@ _bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr) which is used in a relocation entry. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: symbol `%s' required but not present"), + (_("%pB: symbol `%s' required but not present"), abfd, bfd_asymbol_name (asym_ptr)); bfd_set_error (bfd_error_no_symbols); return -1; @@ -6818,9 +6843,10 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd) if (segment->p_type == PT_LOAD && (segment->p_filesz > 0 || segment->p_memsz == 0)) /* xgettext:c-format */ - _bfd_error_handler (_("%B: warning: Empty loadable segment detected" - " at vaddr=%#Lx, is this intentional?"), - ibfd, segment->p_vaddr); + _bfd_error_handler + (_("%pB: warning: empty loadable segment detected" + " at vaddr=%#" PRIx64 ", is this intentional?"), + ibfd, (uint64_t) segment->p_vaddr); map->count = 0; *pointer_to_map = map; @@ -7432,9 +7458,9 @@ rewrite: /* PR 17512: file: f17299af. */ if (segment->p_align > (bfd_vma) 1 << ((sizeof (bfd_vma) * 8) - 2)) /* xgettext:c-format */ - _bfd_error_handler (_("%B: warning: segment alignment of %#Lx" - " is too large"), - ibfd, segment->p_align); + _bfd_error_handler (_("%pB: warning: segment alignment of %#" + PRIx64 " is too large"), + ibfd, (uint64_t) segment->p_align); else maxpagesize = segment->p_align; } @@ -7587,7 +7613,16 @@ _bfd_elf_fixup_group_sections (bfd *ibfd, asection *discarded) but the SHT_GROUP section is, then adjust its size. */ else if (s->output_section == discarded && isec->output_section != discarded) - removed += 4; + { + struct bfd_elf_section_data *elf_sec = elf_section_data (s); + removed += 4; + if (elf_sec->rel.hdr != NULL + && (elf_sec->rel.hdr->sh_flags & SHF_GROUP) != 0) + removed += 4; + if (elf_sec->rela.hdr != NULL + && (elf_sec->rela.hdr->sh_flags & SHF_GROUP) != 0) + removed += 4; + } s = elf_next_in_group (s); if (s == first) break; @@ -7597,18 +7632,26 @@ _bfd_elf_fixup_group_sections (bfd *ibfd, asection *discarded) if (discarded != NULL) { /* If we've been called for ld -r, then we need to - adjust the input section size. This function may - be called multiple times, so save the original - size. */ + adjust the input section size. */ if (isec->rawsize == 0) isec->rawsize = isec->size; isec->size = isec->rawsize - removed; + if (isec->size <= 4) + { + isec->size = 0; + isec->flags |= SEC_EXCLUDE; + } } else { /* Adjust the output section size when called from objcopy. */ isec->output_section->size -= removed; + if (isec->output_section->size <= 4) + { + isec->output_section->size = 0; + isec->output_section->flags |= SEC_EXCLUDE; + } } } } @@ -7913,10 +7956,11 @@ error_return: if (shndx == SHN_BAD) { /* xgettext:c-format */ - _bfd_error_handler (_("\ -Unable to find equivalent output section for symbol '%s' from section '%s'"), - syms[idx]->name ? syms[idx]->name : "", - sec->name); + _bfd_error_handler + (_("unable to find equivalent output section" + " for symbol '%s' from section '%s'"), + syms[idx]->name ? syms[idx]->name : "", + sec->name); bfd_set_error (bfd_error_invalid_operation); goto error_return; } @@ -8246,7 +8290,7 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bfd_boolean default_imported_symver) { error_return_bad_verref: _bfd_error_handler - (_("%B: .gnu.version_r invalid entry"), abfd); + (_("%pB: .gnu.version_r invalid entry"), abfd); bfd_set_error (bfd_error_bad_value); error_return_verref: elf_tdata (abfd)->verref = NULL; @@ -8373,7 +8417,7 @@ error_return_verref: { error_return_bad_verdef: _bfd_error_handler - (_("%B: .gnu.version_d invalid entry"), abfd); + (_("%pB: .gnu.version_d invalid entry"), abfd); bfd_set_error (bfd_error_bad_value); error_return_verdef: elf_tdata (abfd)->verdef = NULL; @@ -8826,12 +8870,13 @@ _bfd_elf_set_section_contents (bfd *abfd, return TRUE; } -void +bfd_boolean _bfd_elf_no_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr ATTRIBUTE_UNUSED, Elf_Internal_Rela *dst ATTRIBUTE_UNUSED) { abort (); + return FALSE; } /* Try to convert a non-ELF reloc into an ELF one. */ @@ -8923,10 +8968,9 @@ _bfd_elf_validate_reloc (bfd *abfd, arelent *areloc) return TRUE; fail: - _bfd_error_handler - /* xgettext:c-format */ - (_("%B: unsupported relocation type %s"), - abfd, areloc->howto->name); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: %s unsupported"), + abfd, areloc->howto->name); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -11019,6 +11063,8 @@ elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset, align is less than 4, we use 4 byte alignment. */ if (align < 4) align = 4; + if (align != 4 && align != 8) + return FALSE; p = buf; while (p < buf + size) diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 5921cc2..33fff58 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -98,6 +98,7 @@ reloc_type_to_name (unsigned int type) break; } } + #undef ARC_RELOC_HOWTO /* Try to minimize the amount of space occupied by relocation tables @@ -160,7 +161,7 @@ struct arc_relocation_data }; /* Should be included at this location due to static declarations - * defined before this point. */ + defined before this point. */ #include "arc-got.h" #define arc_bfd_get_8(A,B,C) bfd_get_8(A,B) @@ -199,11 +200,13 @@ arc_elf_reloc (bfd *abfd ATTRIBUTE_UNUSED, #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ TYPE = VALUE, + enum howto_list { #include "elf/arc-reloc.def" HOWTO_LIST_LAST }; + #undef ARC_RELOC_HOWTO #define ARC_RELOC_HOWTO(TYPE, VALUE, RSIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ @@ -233,16 +236,17 @@ static struct reloc_howto_struct elf_arc_howto_table[] = }; #undef ARC_RELOC_HOWTO -static void arc_elf_howto_init (void) +static void +arc_elf_howto_init (void) { #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ - elf_arc_howto_table[TYPE].pc_relative = \ + elf_arc_howto_table[TYPE].pc_relative = \ (strstr (#FORMULA, " P ") != NULL || strstr (#FORMULA, " PDATA ") != NULL); \ - elf_arc_howto_table[TYPE].dst_mask = RELOC_FUNCTION(0, ~0); \ - /* Only 32 bit data relocations should be marked as ME. */ \ - if (strstr (#FORMULA, " ME ") != NULL) \ - { \ - BFD_ASSERT (SIZE == 2); \ + elf_arc_howto_table[TYPE].dst_mask = RELOC_FUNCTION(0, ~0); \ + /* Only 32 bit data relocations should be marked as ME. */ \ + if (strstr (#FORMULA, " ME ") != NULL) \ + { \ + BFD_ASSERT (SIZE == 2); \ } #include "elf/arc-reloc.def" @@ -253,10 +257,12 @@ static void arc_elf_howto_init (void) #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ [TYPE] = VALUE, + const int howto_table_lookup[] = { #include "elf/arc-reloc.def" }; + #undef ARC_RELOC_HOWTO static reloc_howto_type * @@ -358,6 +364,7 @@ arc_elf_link_hash_table_create (bfd *abfd) #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ { BFD_RELOC_##TYPE, R_##TYPE }, + static const struct arc_reloc_map arc_reloc_map[] = { #include "elf/arc-reloc.def" @@ -368,6 +375,7 @@ static const struct arc_reloc_map arc_reloc_map[] = {BFD_RELOC_24, R_ARC_24}, {BFD_RELOC_32, R_ARC_32}, }; + #undef ARC_RELOC_HOWTO typedef ATTRIBUTE_UNUSED bfd_vma (*replace_func) (unsigned, int ATTRIBUTE_UNUSED); @@ -376,6 +384,7 @@ typedef ATTRIBUTE_UNUSED bfd_vma (*replace_func) (unsigned, int ATTRIBUTE_UNUSED case TYPE: \ func = (void *) RELOC_FUNCTION; \ break; + static replace_func get_replace_function (bfd *abfd, unsigned int r_type) { @@ -387,7 +396,7 @@ get_replace_function (bfd *abfd, unsigned int r_type) } if (func == replace_bits24 && bfd_big_endian (abfd)) - return (replace_func) replace_bits24_be; + func = replace_bits24_be; return (replace_func) func; } @@ -496,16 +505,25 @@ bfd_elf32_bfd_reloc_name_lookup (bfd * abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an ARC ELF reloc. */ -static void -arc_info_to_howto_rel (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +arc_info_to_howto_rel (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_ARC_max); + if (r_type >= (unsigned int) R_ARC_max) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + cache_ptr->howto = arc_elf_howto (r_type); + return TRUE; } /* Extract CPU features from an NTBS. */ @@ -608,8 +626,8 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info) /* It's sometimes ok to mix different configs, so this is only a warning. */ _bfd_error_handler - (_("Warning: %B: Conflicting platform configuration " - "%s with %s.\n"), ibfd, + (_("warning: %pB: conflicting platform configuration " + "%s with %s"), ibfd, tagval[in_attr[i].i], tagval[out_attr[i].i]); } @@ -627,8 +645,8 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info) BFD_ASSERT (out_attr[i].i < 5); /* We cannot mix code for different CPUs. */ _bfd_error_handler - (_("error: %B: unable to merge CPU base attributes " - "%s with %s.\n"), + (_("error: %pB: unable to merge CPU base attributes " + "%s with %s"), obfd, tagval[in_attr[i].i], tagval[out_attr[i].i]); @@ -664,8 +682,8 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info) && (!(cpu_out & bfd_feature_list[j].cpus))) { _bfd_error_handler - (_("error: %B: unable to merge ISA extension attributes " - "%s.\n"), + (_("error: %pB: unable to merge ISA extension attributes " + "%s"), obfd, bfd_feature_list[j].name); result = FALSE; break; @@ -688,8 +706,8 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info) p2 = (char *) bfd_feature_list[k].name; } _bfd_error_handler - (_("error: %B: conflicting ISA extension attributes " - "%s with %s.\n"), + (_("error: %pB: conflicting ISA extension attributes " + "%s with %s"), obfd, p1, p2); result = FALSE; break; @@ -723,7 +741,7 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { /* We cannot mix code with rf16 and without. */ _bfd_error_handler - (_("error: %B: cannot mix rf16 with full register set %B.\n"), + (_("error: %pB: cannot mix rf16 with full register set %pB"), obfd, ibfd); result = FALSE; } @@ -749,7 +767,7 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info) && out_attr[i].i != in_attr[i].i) { _bfd_error_handler - (_("error: %B: conflicting attributes %s: %s with %s.\n"), + (_("error: %pB: conflicting attributes %s: %s with %s"), obfd, tagname, tagval[in_attr[i].i], tagval[out_attr[i].i]); @@ -774,7 +792,7 @@ arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info) && out_attr[i].i != in_attr[i].i) { _bfd_error_handler - (_("error: %B: conflicting attributes %s.\n"), + (_("error: %pB: conflicting attributes %s"), obfd, tagname); result = FALSE; } @@ -874,8 +892,8 @@ arc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (mach_ibfd != mach_obfd) { /* xgettext:c-format */ - _bfd_error_handler (_("ERROR: Attempting to link %B " - "with a binary %B of different architecture"), + _bfd_error_handler (_("error: attempting to link %pB " + "with a binary %pB of different architecture"), ibfd, obfd); return FALSE; } @@ -888,7 +906,7 @@ arc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) /* Warn if different flags. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses different e_flags (%#x) fields than " + (_("%pB: uses different e_flags (%#x) fields than " "previous modules (%#x)"), ibfd, in_flags, out_flags); if (in_flags && out_flags) @@ -977,14 +995,14 @@ arc_elf_object_p (bfd * abfd) if (e_machine == EM_ARC) { _bfd_error_handler - (_("Error: The ARC4 architecture is no longer supported.\n")); + (_("error: the ARC4 architecture is no longer supported")); return FALSE; } else { _bfd_error_handler - (_("Warning: unset or old architecture flags. \n" - " Use default machine.\n")); + (_("warning: unset or old architecture flags; " + "use default machine")); } } @@ -1116,26 +1134,26 @@ arc_special_overflow_checks (const struct arc_relocation_data reloc_data, if (reloc_data.reloc_addend == 0) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): CMEM relocation to `%s' is invalid, " - "16 MSB should be %#x (value is %#Lx)"), + (_("%pB(%pA+%#" PRIx64 "): CMEM relocation to `%s' is invalid, " + "16 MSB should be %#x (value is %#" PRIx64 ")"), reloc_data.input_section->owner, reloc_data.input_section, - reloc_data.reloc_offset, + (uint64_t) reloc_data.reloc_offset, reloc_data.symbol_name, NPS_CMEM_HIGH_VALUE, - relocation); + (uint64_t) relocation); else _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): CMEM relocation to `%s+%#Lx' is invalid, " - "16 MSB should be %#x (value is %#Lx)"), + (_("%pB(%pA+%#" PRIx64 "): CMEM relocation to `%s+%#" PRIx64 + "' is invalid, 16 MSB should be %#x (value is %#" PRIx64 ")"), reloc_data.input_section->owner, reloc_data.input_section, - reloc_data.reloc_offset, + (uint64_t) reloc_data.reloc_offset, reloc_data.symbol_name, - reloc_data.reloc_addend, + (uint64_t) reloc_data.reloc_addend, NPS_CMEM_HIGH_VALUE, - relocation); + (uint64_t) relocation); return bfd_reloc_overflow; } break; @@ -1534,7 +1552,6 @@ elf_arc_relocate_section (bfd * output_bfd, { _bfd_clear_contents (howto, input_bfd, input_section, contents + rel->r_offset); - rel->r_offset = rel->r_offset; rel->r_info = 0; rel->r_addend = 0; @@ -1820,7 +1837,7 @@ elf_arc_relocate_section (bfd * output_bfd, && !reloc_data.sdata_begin_symbol_vma_set) { _bfd_error_handler - ("Error: Linker symbol __SDATA_BEGIN__ not found"); + ("error: linker symbol __SDATA_BEGIN__ not found"); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1833,7 +1850,7 @@ elf_arc_relocate_section (bfd * output_bfd, && reloc_data.sym_section == NULL) { _bfd_error_handler - (_("GOT and PLT relocations cannot be fixed with a non dynamic linker.")); + (_("GOT and PLT relocations cannot be fixed with a non dynamic linker")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1857,27 +1874,27 @@ elf_arc_relocate_section (bfd * output_bfd, case bfd_reloc_other: /* xgettext:c-format */ - msg = _("%B(%A): warning: unaligned access to symbol '%s' in the small data area"); + msg = _("%pB(%pA): warning: unaligned access to symbol '%s' in the small data area"); break; case bfd_reloc_outofrange: /* xgettext:c-format */ - msg = _("%B(%A): internal error: out of range error"); + msg = _("%pB(%pA): internal error: out of range error"); break; case bfd_reloc_notsupported: /* xgettext:c-format */ - msg = _("%B(%A): internal error: unsupported relocation error"); + msg = _("%pB(%pA): internal error: unsupported relocation error"); break; case bfd_reloc_dangerous: /* xgettext:c-format */ - msg = _("%B(%A): internal error: dangerous relocation"); + msg = _("%pB(%pA): internal error: dangerous relocation"); break; default: /* xgettext:c-format */ - msg = _("%B(%A): internal error: unknown error"); + msg = _("%pB(%pA): internal error: unknown error"); break; } @@ -1965,11 +1982,11 @@ elf_arc_check_relocs (bfd * abfd, name = "UNKNOWN"; _bfd_error_handler /* xgettext:c-format */ - (_("\ -%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), - abfd, - arc_elf_howto (r_type)->name, - name); + (_("%pB: relocation %s against `%s' can not be used" + " when making a shared object; recompile with -fPIC"), + abfd, + arc_elf_howto (r_type)->name, + name); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2857,7 +2874,7 @@ elf32_arc_obj_attrs_handle_unknown (bfd *abfd, int tag) if ((tag & 127) < (Tag_ARC_ISA_mpy_option + 1)) { _bfd_error_handler - (_("%B: Unknown mandatory ARC object attribute %d."), + (_("%pB: unknown mandatory ARC object attribute %d"), abfd, tag); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -2865,7 +2882,7 @@ elf32_arc_obj_attrs_handle_unknown (bfd *abfd, int tag) else { _bfd_error_handler - (_("Warning: %B: Unknown ARC object attribute %d."), + (_("warning: %pB: unknown ARC object attribute %d"), abfd, tag); return TRUE; } diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 0b250ce..ce9c2f2 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -56,7 +56,7 @@ ? bfd_elf32_swap_reloc_out \ : bfd_elf32_swap_reloca_out) -#define elf_info_to_howto 0 +#define elf_info_to_howto NULL #define elf_info_to_howto_rel elf32_arm_info_to_howto #define ARM_ELF_ABI_VERSION 0 @@ -1839,14 +1839,22 @@ elf32_arm_howto_from_type (unsigned int r_type) return NULL; } -static void -elf32_arm_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, arelent * bfd_reloc, +static bfd_boolean +elf32_arm_info_to_howto (bfd * abfd, arelent * bfd_reloc, Elf_Internal_Rela * elf_reloc) { unsigned int r_type; r_type = ELF32_R_TYPE (elf_reloc->r_info); - bfd_reloc->howto = elf32_arm_howto_from_type (r_type); + if ((bfd_reloc->howto = elf32_arm_howto_from_type (r_type)) == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } struct elf32_arm_reloc_map @@ -3142,7 +3150,7 @@ struct elf32_arm_link_hash_table int nacl_p; /* True if the target uses REL relocations. */ - int use_rel; + bfd_boolean use_rel; /* Nonzero if import library must be a secure gateway import library as per ARMv8-M Security Extensions. */ @@ -3796,7 +3804,7 @@ elf32_arm_link_hash_table_create (bfd *abfd) ret->plt_header_size = 20; ret->plt_entry_size = elf32_arm_use_long_plt_entry ? 16 : 12; #endif - ret->use_rel = 1; + ret->use_rel = TRUE; ret->obfd = abfd; if (!bfd_hash_table_init (&ret->stub_hash_table, stub_hash_newfunc, @@ -4019,10 +4027,10 @@ arm_type_of_stub (struct bfd_link_info *info, { if (input_sec->flags & SEC_ELF_PURECODE) _bfd_error_handler - (_("%B(%A): warning: long branch veneers used in" + (_("%pB(%pA): warning: long branch veneers used in" " section with SHF_ARM_PURECODE section" " attribute is only supported for M-profile" - " targets that implement the movw instruction."), + " targets that implement the movw instruction"), input_bfd, input_sec); stub_type = (bfd_link_pic (info) | globals->pic_veneer) @@ -4053,10 +4061,10 @@ arm_type_of_stub (struct bfd_link_info *info, { if (input_sec->flags & SEC_ELF_PURECODE) _bfd_error_handler - (_("%B(%A): warning: long branch veneers used in" + (_("%pB(%pA): warning: long branch veneers used in" " section with SHF_ARM_PURECODE section" " attribute is only supported for M-profile" - " targets that implement the movw instruction."), + " targets that implement the movw instruction"), input_bfd, input_sec); stub_type = (bfd_link_pic (info) | globals->pic_veneer) @@ -4072,10 +4080,10 @@ arm_type_of_stub (struct bfd_link_info *info, { if (input_sec->flags & SEC_ELF_PURECODE) _bfd_error_handler - (_("%B(%A): warning: long branch veneers used in" + (_("%pB(%pA): warning: long branch veneers used in" " section with SHF_ARM_PURECODE section" " attribute is only supported" " for M-profile" - " targets that implement the movw instruction."), + " targets that implement the movw instruction"), input_bfd, input_sec); /* Thumb to arm. */ @@ -4084,9 +4092,9 @@ arm_type_of_stub (struct bfd_link_info *info, && !INTERWORK_FLAG (sym_sec->owner)) { _bfd_error_handler - (_("%B(%s): warning: interworking not enabled.\n" - " first occurrence: %B: Thumb call to ARM"), - sym_sec->owner, name, input_bfd); + (_("%pB(%s): warning: interworking not enabled;" + " first occurrence: %pB: %s call to %s"), + sym_sec->owner, name, input_bfd, "Thumb", "ARM"); } stub_type = @@ -4124,10 +4132,10 @@ arm_type_of_stub (struct bfd_link_info *info, { if (input_sec->flags & SEC_ELF_PURECODE) _bfd_error_handler - (_("%B(%A): warning: long branch veneers used in" + (_("%pB(%pA): warning: long branch veneers used in" " section with SHF_ARM_PURECODE section" " attribute is only supported for M-profile" - " targets that implement the movw instruction."), + " targets that implement the movw instruction"), input_bfd, input_sec); if (branch_type == ST_BRANCH_TO_THUMB) { @@ -4138,9 +4146,9 @@ arm_type_of_stub (struct bfd_link_info *info, && !INTERWORK_FLAG (sym_sec->owner)) { _bfd_error_handler - (_("%B(%s): warning: interworking not enabled.\n" - " first occurrence: %B: ARM call to Thumb"), - sym_sec->owner, name, input_bfd); + (_("%pB(%s): warning: interworking not enabled;" + " first occurrence: %pB: %s call to %s"), + sym_sec->owner, name, input_bfd, "ARM", "Thumb"); } /* We have an extra 2-bytes reach because of @@ -4412,7 +4420,7 @@ elf32_arm_create_or_find_stub_sec (asection **link_sec_p, asection *section, out_sec = bfd_get_section_by_name (output_bfd, out_sec_name); if (out_sec == NULL) { - _bfd_error_handler (_("No address assigned to the veneers output " + _bfd_error_handler (_("no address assigned to the veneers output " "section %s"), out_sec_name); return NULL; } @@ -4487,7 +4495,7 @@ elf32_arm_add_stub (const char *stub_name, asection *section, { if (section == NULL) section = stub_sec; - _bfd_error_handler (_("%B: cannot create stub entry %s"), + _bfd_error_handler (_("%pB: cannot create stub entry %s"), section->owner, stub_name); return NULL; } @@ -5672,8 +5680,8 @@ cmse_scan (bfd *input_bfd, struct elf32_arm_link_hash_table *htab, if (!is_v8m) { - _bfd_error_handler (_("%B: Special symbol `%s' only allowed for " - "ARMv8-M architecture or later."), + _bfd_error_handler (_("%pB: special symbol `%s' only allowed for " + "ARMv8-M architecture or later"), input_bfd, sym_name); is_v8m = TRUE; /* Avoid multiple warning. */ ret = FALSE; @@ -5681,10 +5689,9 @@ cmse_scan (bfd *input_bfd, struct elf32_arm_link_hash_table *htab, if (cmse_invalid) { - _bfd_error_handler (_("%B: invalid special symbol `%s'."), + _bfd_error_handler (_("%pB: invalid special symbol `%s'; it must be" + " a global or weak function symbol"), input_bfd, sym_name); - _bfd_error_handler (_("It must be a global or weak function " - "symbol.")); ret = FALSE; if (i < ext_start) continue; @@ -5721,13 +5728,13 @@ cmse_scan (bfd *input_bfd, struct elf32_arm_link_hash_table *htab, if (hash || j < ext_start) { _bfd_error_handler - (_("%B: invalid standard symbol `%s'."), input_bfd, sym_name); - _bfd_error_handler - (_("It must be a global or weak function symbol.")); + (_("%pB: invalid standard symbol `%s'; it must be " + "a global or weak function symbol"), + input_bfd, sym_name); } else _bfd_error_handler - (_("%B: absent standard symbol `%s'."), input_bfd, sym_name); + (_("%pB: absent standard symbol `%s'"), input_bfd, sym_name); ret = FALSE; if (!hash) continue; @@ -5739,7 +5746,7 @@ cmse_scan (bfd *input_bfd, struct elf32_arm_link_hash_table *htab, if (cmse_hash->root.root.u.def.section != section) { _bfd_error_handler - (_("%B: `%s' and its special symbol are in different sections."), + (_("%pB: `%s' and its special symbol are in different sections"), input_bfd, sym_name); ret = FALSE; } @@ -5751,14 +5758,14 @@ cmse_scan (bfd *input_bfd, struct elf32_arm_link_hash_table *htab, if (section->output_section == NULL) { _bfd_error_handler - (_("%B: entry function `%s' not output."), input_bfd, sym_name); + (_("%pB: entry function `%s' not output"), input_bfd, sym_name); continue; } if (hash->root.size == 0) { _bfd_error_handler - (_("%B: entry function `%s' is empty."), input_bfd, sym_name); + (_("%pB: entry function `%s' is empty"), input_bfd, sym_name); ret = FALSE; } @@ -5887,8 +5894,8 @@ set_cmse_veneer_addr_from_implib (struct bfd_link_info *info, in_implib_bfd = htab->in_implib_bfd; if (!htab->cmse_implib) { - _bfd_error_handler (_("%B: --in-implib only supported for Secure " - "Gateway import libraries."), in_implib_bfd); + _bfd_error_handler (_("%pB: --in-implib only supported for Secure " + "Gateway import libraries"), in_implib_bfd); return FALSE; } @@ -5933,10 +5940,10 @@ set_cmse_veneer_addr_from_implib (struct bfd_link_info *info, || (ARM_GET_SYM_BRANCH_TYPE (intsym->st_target_internal) != ST_BRANCH_TO_THUMB)) { - _bfd_error_handler (_("%B: invalid import library entry: `%s'."), + _bfd_error_handler (_("%pB: invalid import library entry: `%s'; " + "symbol should be absolute, global and " + "refer to Thumb functions"), in_implib_bfd, sym_name); - _bfd_error_handler (_("Symbol should be absolute, global and " - "refer to Thumb functions.")); ret = FALSE; continue; } @@ -5955,7 +5962,7 @@ set_cmse_veneer_addr_from_implib (struct bfd_link_info *info, bfd_boolean new_stub; _bfd_error_handler - (_("Entry function `%s' disappeared from secure code."), sym_name); + (_("entry function `%s' disappeared from secure code"), sym_name); hash = (struct elf32_arm_link_hash_entry *) elf_link_hash_lookup (&(htab)->root, sym_name, TRUE, TRUE, TRUE); stub_entry @@ -5979,7 +5986,7 @@ set_cmse_veneer_addr_from_implib (struct bfd_link_info *info, { if (!cmse_entry_fct_p (hash)) { - _bfd_error_handler (_("`%s' refers to a non entry function."), + _bfd_error_handler (_("`%s' refers to a non entry function"), sym_name); ret = FALSE; } @@ -5994,7 +6001,7 @@ set_cmse_veneer_addr_from_implib (struct bfd_link_info *info, if (!!(flags & BSF_GLOBAL) != (hash->root.root.type == bfd_link_hash_defined)) _bfd_error_handler - (_("%B: visibility of symbol `%s' has changed."), in_implib_bfd, + (_("%pB: visibility of symbol `%s' has changed"), in_implib_bfd, sym_name); stub_entry->stub_offset = stub_offset; @@ -6003,7 +6010,7 @@ set_cmse_veneer_addr_from_implib (struct bfd_link_info *info, /* Size should match that of a SG veneer. */ if (intsym->st_size != cmse_stub_size) { - _bfd_error_handler (_("%B: incorrect size for symbol `%s'."), + _bfd_error_handler (_("%pB: incorrect size for symbol `%s'"), in_implib_bfd, sym_name); ret = FALSE; } @@ -6022,8 +6029,8 @@ set_cmse_veneer_addr_from_implib (struct bfd_link_info *info, if (stub_offset % cmse_stub_size) { _bfd_error_handler - (_("Offset of veneer for entry function `%s' not a multiple of " - "its size."), sym_name); + (_("offset of veneer for entry function `%s' not a multiple of " + "its size"), sym_name); ret = FALSE; } @@ -6050,7 +6057,7 @@ set_cmse_veneer_addr_from_implib (struct bfd_link_info *info, if (cmse_stub_array_start != cmse_stub_sec_vma) { _bfd_error_handler - (_("Start address of `%s' is different from previous link."), + (_("start address of `%s' is different from previous link"), out_sec_name); ret = FALSE; } @@ -6624,7 +6631,7 @@ elf32_arm_size_stubs (bfd *output_bfd, TRUE, FALSE); if (stub_entry == NULL) { - _bfd_error_handler (_("%B: cannot create stub entry %s"), + _bfd_error_handler (_("%pB: cannot create stub entry %s"), section->owner, stub_name); return FALSE; } @@ -6757,8 +6764,8 @@ find_thumb_glue (struct bfd_link_info *link_info, (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (hash == NULL - && asprintf (error_message, _("unable to find THUMB glue '%s' for '%s'"), - tmp_name, name) == -1) + && asprintf (error_message, _("unable to find %s glue '%s' for '%s'"), + "Thumb", tmp_name, name) == -1) *error_message = (char *) bfd_errmsg (bfd_error_system_call); free (tmp_name); @@ -6793,8 +6800,8 @@ find_arm_glue (struct bfd_link_info *link_info, (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (myh == NULL - && asprintf (error_message, _("unable to find ARM glue '%s' for '%s'"), - tmp_name, name) == -1) + && asprintf (error_message, _("unable to find %s glue '%s' for '%s'"), + "ARM", tmp_name, name) == -1) *error_message = (char *) bfd_errmsg (bfd_error_system_call); free (tmp_name); @@ -7508,7 +7515,7 @@ bfd_elf32_arm_process_before_allocation (bfd *abfd, if (globals->byteswap_code && !bfd_big_endian (abfd)) { - _bfd_error_handler (_("%B: BE8 images only valid in big-endian mode."), + _bfd_error_handler (_("%pB: BE8 images only valid in big-endian mode"), abfd); return FALSE; } @@ -7739,7 +7746,7 @@ bfd_elf32_arm_set_vfp11_fix (bfd *obfd, struct bfd_link_info *link_info) default: /* Give a warning, but do as the user requests anyway. */ - _bfd_error_handler (_("%B: warning: selected VFP11 erratum " + _bfd_error_handler (_("%pB: warning: selected VFP11 erratum " "workaround is not necessary for target architecture"), obfd); } } @@ -7766,7 +7773,7 @@ bfd_elf32_arm_set_stm32l4xx_fix (bfd *obfd, struct bfd_link_info *link_info) if (globals->stm32l4xx_fix != BFD_ARM_STM32L4XX_FIX_NONE) /* Give a warning, but do as the user requests anyway. */ _bfd_error_handler - (_("%B: warning: selected STM32L4XX erratum " + (_("%pB: warning: selected STM32L4XX erratum " "workaround is not necessary for target architecture"), obfd); } } @@ -8303,8 +8310,8 @@ bfd_elf32_arm_vfp11_fix_veneer_locations (bfd *abfd, (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) - _bfd_error_handler (_("%B: unable to find VFP11 veneer " - "`%s'"), abfd, tmp_name); + _bfd_error_handler (_("%pB: unable to find %s veneer `%s'"), + abfd, "VFP11", tmp_name); vma = myh->root.u.def.section->output_section->vma + myh->root.u.def.section->output_offset @@ -8323,8 +8330,8 @@ bfd_elf32_arm_vfp11_fix_veneer_locations (bfd *abfd, (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) - _bfd_error_handler (_("%B: unable to find VFP11 veneer " - "`%s'"), abfd, tmp_name); + _bfd_error_handler (_("%pB: unable to find %s veneer `%s'"), + abfd, "VFP11", tmp_name); vma = myh->root.u.def.section->output_section->vma + myh->root.u.def.section->output_offset @@ -8389,8 +8396,8 @@ bfd_elf32_arm_stm32l4xx_fix_veneer_locations (bfd *abfd, (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) - _bfd_error_handler (_("%B: unable to find STM32L4XX veneer " - "`%s'"), abfd, tmp_name); + _bfd_error_handler (_("%pB: unable to find %s veneer `%s'"), + abfd, "STM32L4XX", tmp_name); vma = myh->root.u.def.section->output_section->vma + myh->root.u.def.section->output_offset @@ -8408,8 +8415,8 @@ bfd_elf32_arm_stm32l4xx_fix_veneer_locations (bfd *abfd, (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) - _bfd_error_handler (_("%B: unable to find STM32L4XX veneer " - "`%s'"), abfd, tmp_name); + _bfd_error_handler (_("%pB: unable to find %s veneer `%s'"), + abfd, "STM32L4XX", tmp_name); vma = myh->root.u.def.section->output_section->vma + myh->root.u.def.section->output_offset @@ -8615,11 +8622,11 @@ bfd_elf32_arm_stm32l4xx_erratum_scan (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#x): error: multiple load detected" - " in non-last IT block instruction :" - " STM32L4XX veneer cannot be generated.\n" - "Use gcc option -mrestrict-it to generate" - " only one instruction per IT block.\n"), + (_("%pB(%pA+%#x): error: multiple load detected" + " in non-last IT block instruction:" + " STM32L4XX veneer cannot be generated; " + "use gcc option -mrestrict-it to generate" + " only one instruction per IT block"), abfd, sec, i); } else @@ -8713,7 +8720,7 @@ bfd_elf32_arm_set_target_params (struct bfd *output_bfd, globals->target2_reloc = R_ARM_GOT_PREL; else { - _bfd_error_handler (_("Invalid TARGET2 relocation type '%s'."), + _bfd_error_handler (_("invalid TARGET2 relocation type '%s'"), params->target2_type); } globals->fix_v4bx = params->fix_v4bx; @@ -8803,9 +8810,9 @@ elf32_thumb_to_arm_stub (struct bfd_link_info * info, && !INTERWORK_FLAG (sym_sec->owner)) { _bfd_error_handler - (_("%B(%s): warning: interworking not enabled.\n" - " first occurrence: %B: Thumb call to ARM"), - sym_sec->owner, name, input_bfd); + (_("%pB(%s): warning: interworking not enabled;" + " first occurrence: %pB: %s call to %s"), + sym_sec->owner, name, input_bfd, "Thumb", "ARM"); return FALSE; } @@ -8893,9 +8900,9 @@ elf32_arm_create_thumb_stub (struct bfd_link_info * info, && !INTERWORK_FLAG (sym_sec->owner)) { _bfd_error_handler - (_("%B(%s): warning: interworking not enabled.\n" - " first occurrence: %B: arm call to thumb"), - sym_sec->owner, name, input_bfd); + (_("%pB(%s): warning: interworking not enabled;" + " first occurrence: %pB: %s call to %s"), + sym_sec->owner, name, input_bfd, "ARM", "Thumb"); } --my_offset; @@ -9455,7 +9462,7 @@ elf32_arm_populate_plt_entry (bfd *output_bfd, struct bfd_link_info *info, { /* FIXME: We ought to be able to generate thumb-1 PLT instructions... */ - _bfd_error_handler (_("%B: Warning: thumb-1 mode PLT generation not currently supported"), + _bfd_error_handler (_("%pB: warning: thumb-1 mode PLT generation not currently supported"), output_bfd); return FALSE; } @@ -9720,8 +9727,10 @@ elf32_arm_tls_relax (struct elf32_arm_link_hash_table *globals, | bfd_get_16 (input_bfd, contents + rel->r_offset + 2); _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unexpected Thumb instruction '%#lx' in TLS trampoline"), - input_bfd, input_sec, rel->r_offset, insn); + (_("%pB(%pA+%#" PRIx64 "): " + "unexpected %s instruction '%#lx' in TLS trampoline"), + input_bfd, input_sec, (uint64_t) rel->r_offset, + "Thumb", insn); return bfd_reloc_notsupported; } break; @@ -9760,8 +9769,10 @@ elf32_arm_tls_relax (struct elf32_arm_link_hash_table *globals, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unexpected ARM instruction '%#lx' in TLS trampoline"), - input_bfd, input_sec, rel->r_offset, insn); + (_("%pB(%pA+%#" PRIx64 "): " + "unexpected %s instruction '%#lx' in TLS trampoline"), + input_bfd, input_sec, (uint64_t) rel->r_offset, + "ARM", insn); return bfd_reloc_notsupported; } break; @@ -10106,7 +10117,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, v = _("PIE executable"); _bfd_error_handler - (_("%B: relocation %s against external or undefined symbol `%s'" + (_("%pB: relocation %s against external or undefined symbol `%s'" " can not be used when making a %s; recompile with -fPIC"), input_bfd, elf32_arm_howto_table_1[r_type].name, h->root.root.string, v); return bfd_reloc_notsupported; @@ -10237,9 +10248,10 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, instruction instead ? */ if (branch_type != ST_BRANCH_TO_THUMB) _bfd_error_handler - (_("\%B: Warning: Arm BLX instruction targets Arm function '%s'."), - input_bfd, - h ? h->root.root.string : "(local)"); + (_("\%pB: warning: %s BLX instruction targets" + " %s function '%s'"), + input_bfd, "ARM", + "ARM", h ? h->root.root.string : "(local)"); } else if (r_type == R_ARM_PC24) { @@ -10663,9 +10675,10 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, instruction instead ? */ if (branch_type == ST_BRANCH_TO_THUMB) _bfd_error_handler - (_("%B: Warning: Thumb BLX instruction targets thumb function '%s'."), - input_bfd, - h ? h->root.root.string : "(local)"); + (_("%pB: warning: %s BLX instruction targets" + " %s function '%s'"), + input_bfd, "Thumb", + "Thumb", h ? h->root.root.string : "(local)"); } else { @@ -11531,8 +11544,11 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unexpected Thumb instruction '%#lx' referenced by TLS_GOTDESC"), - input_bfd, input_section, rel->r_offset, insn); + (_("%pB(%pA+%#" PRIx64 "): " + "unexpected %s instruction '%#lx' " + "referenced by TLS_GOTDESC"), + input_bfd, input_section, (uint64_t) rel->r_offset, + "Thumb", insn); return bfd_reloc_notsupported; } } @@ -11554,8 +11570,11 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, default: _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unexpected ARM instruction '%#lx' referenced by TLS_GOTDESC"), - input_bfd, input_section, rel->r_offset, insn); + (_("%pB(%pA+%#" PRIx64 "): " + "unexpected %s instruction '%#lx' " + "referenced by TLS_GOTDESC"), + input_bfd, input_section, (uint64_t) rel->r_offset, + "ARM", insn); return bfd_reloc_notsupported; } } @@ -11583,8 +11602,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s relocation not permitted in shared object"), - input_bfd, input_section, rel->r_offset, howto->name); + (_("%pB(%pA+%#" PRIx64 "): %s relocation not permitted " + "in shared object"), + input_bfd, input_section, (uint64_t) rel->r_offset, howto->name); return bfd_reloc_notsupported; } else @@ -11796,8 +11816,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): Only ADD or SUB instructions are allowed for ALU group relocations"), - input_bfd, input_section, rel->r_offset); + (_("%pB(%pA+%#" PRIx64 "): only ADD or SUB instructions " + "are allowed for ALU group relocations"), + input_bfd, input_section, (uint64_t) rel->r_offset); return bfd_reloc_overflow; } @@ -11836,9 +11857,11 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): Overflow whilst splitting %#Lx for group relocation %s"), - input_bfd, input_section, rel->r_offset, - signed_value < 0 ? -signed_value : signed_value, howto->name); + (_("%pB(%pA+%#" PRIx64 "): overflow whilst " + "splitting %#" PRIx64 " for group relocation %s"), + input_bfd, input_section, (uint64_t) rel->r_offset, + (uint64_t) (signed_value < 0 ? -signed_value : signed_value), + howto->name); return bfd_reloc_overflow; } @@ -11926,9 +11949,11 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): Overflow whilst splitting %#Lx for group relocation %s"), - input_bfd, input_section, rel->r_offset, - signed_value < 0 ? -signed_value : signed_value, howto->name); + (_("%pB(%pA+%#" PRIx64 "): overflow whilst " + "splitting %#" PRIx64 " for group relocation %s"), + input_bfd, input_section, (uint64_t) rel->r_offset, + (uint64_t) (signed_value < 0 ? -signed_value : signed_value), + howto->name); return bfd_reloc_overflow; } @@ -12012,9 +12037,11 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): Overflow whilst splitting %#Lx for group relocation %s"), - input_bfd, input_section, rel->r_offset, - signed_value < 0 ? -signed_value : signed_value, howto->name); + (_("%pB(%pA+%#" PRIx64 "): overflow whilst " + "splitting %#" PRIx64 " for group relocation %s"), + input_bfd, input_section, (uint64_t) rel->r_offset, + (uint64_t) (signed_value < 0 ? -signed_value : signed_value), + howto->name); return bfd_reloc_overflow; } @@ -12100,9 +12127,11 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): Overflow whilst splitting %#Lx for group relocation %s"), - input_bfd, input_section, rel->r_offset, - signed_value < 0 ? -signed_value : signed_value, howto->name); + (_("%pB(%pA+%#" PRIx64 "): overflow whilst " + "splitting %#" PRIx64 " for group relocation %s"), + input_bfd, input_section, (uint64_t) rel->r_offset, + (uint64_t) (signed_value < 0 ? -signed_value : signed_value), + howto->name); return bfd_reloc_overflow; } @@ -12366,9 +12395,10 @@ elf32_arm_relocate_section (bfd * output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s relocation against SEC_MERGE section"), + (_("%pB(%pA+%#" PRIx64 "): " + "%s relocation against SEC_MERGE section"), input_bfd, input_section, - rel->r_offset, howto->name); + (uint64_t) rel->r_offset, howto->name); return FALSE; } @@ -12478,12 +12508,12 @@ elf32_arm_relocate_section (bfd * output_bfd, _bfd_error_handler ((sym_type == STT_TLS /* xgettext:c-format */ - ? _("%B(%A+%#Lx): %s used with TLS symbol %s") + ? _("%pB(%pA+%#" PRIx64 "): %s used with TLS symbol %s") /* xgettext:c-format */ - : _("%B(%A+%#Lx): %s used with non-TLS symbol %s")), + : _("%pB(%pA+%#" PRIx64 "): %s used with non-TLS symbol %s")), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, name); } @@ -12533,10 +12563,11 @@ elf32_arm_relocate_section (bfd * output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); return FALSE; @@ -13018,11 +13049,11 @@ elf32_arm_set_private_flags (bfd *abfd, flagword flags) { if (flags & EF_ARM_INTERWORK) _bfd_error_handler - (_("Warning: Not setting interworking flag of %B since it has already been specified as non-interworking"), + (_("warning: not setting interworking flag of %pB since it has already been specified as non-interworking"), abfd); else _bfd_error_handler - (_("Warning: Clearing the interworking flag of %B due to outside request"), + (_("warning: clearing the interworking flag of %pB due to outside request"), abfd); } } @@ -13067,7 +13098,7 @@ elf32_arm_copy_private_bfd_data (bfd *ibfd, bfd *obfd) { if (out_flags & EF_ARM_INTERWORK) _bfd_error_handler - (_("Warning: Clearing the interworking flag of %B because non-interworking code in %B has been linked with it"), + (_("warning: clearing the interworking flag of %pB because non-interworking code in %pB has been linked with it"), obfd, ibfd); in_flags &= ~EF_ARM_INTERWORK; @@ -13154,7 +13185,7 @@ elf32_arm_obj_attrs_handle_unknown (bfd *abfd, int tag) if ((tag & 127) < 64) { _bfd_error_handler - (_("%B: Unknown mandatory EABI object attribute %d"), + (_("%pB: unknown mandatory EABI object attribute %d"), abfd, tag); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -13162,7 +13193,7 @@ elf32_arm_obj_attrs_handle_unknown (bfd *abfd, int tag) else { _bfd_error_handler - (_("Warning: %B: Unknown EABI object attribute %d"), + (_("warning: %pB: unknown EABI object attribute %d"), abfd, tag); return TRUE; } @@ -13429,7 +13460,7 @@ tag_cpu_arch_combine (bfd *ibfd, int oldtag, int *secondary_compat_out, if (oldtag > MAX_TAG_CPU_ARCH || newtag > MAX_TAG_CPU_ARCH) { - _bfd_error_handler (_("error: %B: Unknown CPU architecture"), ibfd); + _bfd_error_handler (_("error: %pB: unknown CPU architecture"), ibfd); return -1; } @@ -13467,7 +13498,7 @@ tag_cpu_arch_combine (bfd *ibfd, int oldtag, int *secondary_compat_out, if (result == -1) { - _bfd_error_handler (_("error: %B: Conflicting CPU architectures %d/%d"), + _bfd_error_handler (_("error: %pB: conflicting CPU architectures %d/%d"), ibfd, oldtag, newtag); return -1; } @@ -13564,7 +13595,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) != out_attr[Tag_MPextension_use].i) { _bfd_error_handler - (_("Error: %B has both the current and legacy " + (_("Error: %pB has both the current and legacy " "Tag_MPextension_use attributes"), ibfd); result = FALSE; } @@ -13593,7 +13624,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) && in_attr[Tag_ABI_VFP_args].i != AEABI_VFP_args_compatible) { _bfd_error_handler - (_("error: %B uses VFP register arguments, %B does not"), + (_("error: %pB uses VFP register arguments, %pB does not"), in_attr[Tag_ABI_VFP_args].i ? ibfd : obfd, in_attr[Tag_ABI_VFP_args].i ? obfd : ibfd); result = FALSE; @@ -13722,7 +13753,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) binaries in the toolchain have had the attributes set properly. _bfd_error_handler - (_("error: %B: 8-byte data alignment conflicts with %B"), + (_("error: %pB: 8-byte data alignment conflicts with %pB"), obfd, ibfd); result = FALSE; */ } @@ -13751,8 +13782,8 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) else { _bfd_error_handler - (_("error: %B: unable to merge virtualization attributes " - "with %B"), + (_("error: %pB: unable to merge virtualization attributes " + "with %pB"), obfd, ibfd); result = FALSE; } @@ -13777,7 +13808,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) else { _bfd_error_handler - (_("error: %B: Conflicting architecture profiles %c/%c"), + (_("error: %pB: conflicting architecture profiles %c/%c"), ibfd, in_attr[i].i ? in_attr[i].i : '0', out_attr[i].i ? out_attr[i].i : '0'); @@ -13916,7 +13947,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) /* It's sometimes ok to mix different configs, so this is only a warning. */ _bfd_error_handler - (_("Warning: %B: Conflicting platform configuration"), ibfd); + (_("warning: %pB: conflicting platform configuration"), ibfd); } break; case Tag_ABI_PCS_R9_use: @@ -13925,7 +13956,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) && in_attr[i].i != AEABI_R9_unused) { _bfd_error_handler - (_("error: %B: Conflicting use of R9"), ibfd); + (_("error: %pB: conflicting use of R9"), ibfd); result = FALSE; } if (out_attr[i].i == AEABI_R9_unused) @@ -13937,7 +13968,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) && out_attr[Tag_ABI_PCS_R9_use].i != AEABI_R9_unused) { _bfd_error_handler - (_("error: %B: SB relative addressing conflicts with use of R9"), + (_("error: %pB: SB relative addressing conflicts with use of R9"), ibfd); result = FALSE; } @@ -13950,7 +13981,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) && !elf_arm_tdata (obfd)->no_wchar_size_warning) { _bfd_error_handler - (_("warning: %B uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; use of wchar_t values across objects may fail"), + (_("warning: %pB uses %u-byte wchar_t yet the output is to use %u-byte wchar_t; use of wchar_t values across objects may fail"), ibfd, in_attr[i].i, out_attr[i].i); } else if (in_attr[i].i && !out_attr[i].i) @@ -13981,7 +14012,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) ? aeabi_enum_names[out_attr[i].i] : ""; _bfd_error_handler - (_("warning: %B uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"), + (_("warning: %pB uses %s enums yet the output is to use %s enums; use of enum values across objects may fail"), ibfd, in_name, out_name); } } @@ -13993,7 +14024,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) if (in_attr[i].i != out_attr[i].i) { _bfd_error_handler - (_("error: %B uses iWMMXt register arguments, %B does not"), + (_("error: %pB uses iWMMXt register arguments, %pB does not"), ibfd, obfd); result = FALSE; } @@ -14010,7 +14041,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) if (in_attr[i].i != out_attr[i].i) { _bfd_error_handler - (_("error: fp16 format mismatch between %B and %B"), + (_("error: fp16 format mismatch between %pB and %pB"), ibfd, obfd); result = FALSE; } @@ -14046,7 +14077,7 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, struct bfd_link_info *info) if (in_attr[Tag_MPextension_use].i != in_attr[i].i) { _bfd_error_handler - (_("%B has both the current and legacy " + (_("%pB has both the current and legacy " "Tag_MPextension_use attributes"), ibfd); result = FALSE; @@ -14365,7 +14396,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, object file containing relocations but no symbol table. */ && (r_symndx > STN_UNDEF || nsyms > 0)) { - _bfd_error_handler (_("%B: bad symbol index: %d"), abfd, + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -14518,7 +14549,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info, if (bfd_link_pic (info)) { _bfd_error_handler - (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), + (_("%pB: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), abfd, elf32_arm_howto_table_1[r_type].name, (h) ? h->root.root.string : "a local symbol"); bfd_set_error (bfd_error_bad_value); @@ -15633,7 +15664,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -15878,7 +15909,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED, if (!bfd_elf32_arm_process_before_allocation (ibfd, info) || !bfd_elf32_arm_vfp11_erratum_scan (ibfd, info) || !bfd_elf32_arm_stm32l4xx_erratum_scan (ibfd, info)) - _bfd_error_handler (_("Errors encountered processing file %B"), ibfd); + _bfd_error_handler (_("errors encountered processing file %pB"), ibfd); } /* Allocate space for the glue sections now that we've sized them. */ @@ -17491,7 +17522,7 @@ make_branch_to_a8_stub (struct bfd_hash_entry *gen_entry, This check is just to be on the safe side... */ if ((veneered_insn_loc & ~0xfff) == (veneer_entry_loc & ~0xfff)) { - _bfd_error_handler (_("%B: error: Cortex-A8 erratum stub is " + _bfd_error_handler (_("%pB: error: Cortex-A8 erratum stub is " "allocated in unsafe location"), abfd); return FALSE; } @@ -17518,7 +17549,7 @@ make_branch_to_a8_stub (struct bfd_hash_entry *gen_entry, { /* There's not much we can do apart from complain if this happens. */ - _bfd_error_handler (_("%B: error: Cortex-A8 erratum stub out " + _bfd_error_handler (_("%pB: error: Cortex-A8 erratum stub out " "of range (input file too large)"), abfd); return FALSE; } @@ -18345,7 +18376,7 @@ elf32_arm_write_section (bfd *output_bfd, if ((signed) branch_to_veneer < -(1 << 25) || (signed) branch_to_veneer >= (1 << 25)) - _bfd_error_handler (_("%B: error: VFP11 veneer out of " + _bfd_error_handler (_("%pB: error: VFP11 veneer out of " "range"), output_bfd); insn |= (branch_to_veneer >> 2) & 0xffffff; @@ -18367,7 +18398,7 @@ elf32_arm_write_section (bfd *output_bfd, if ((signed) branch_from_veneer < -(1 << 25) || (signed) branch_from_veneer >= (1 << 25)) - _bfd_error_handler (_("%B: error: VFP11 veneer out of " + _bfd_error_handler (_("%pB: error: VFP11 veneer out of " "range"), output_bfd); /* Original instruction. */ @@ -18418,12 +18449,13 @@ elf32_arm_write_section (bfd *output_bfd, branch_to_veneer - (1 << 24) : 0; _bfd_error_handler - (_("%B(%#Lx): error: Cannot create STM32L4XX veneer. " - "Jump out of range by %Ld bytes. " - "Cannot encode branch instruction. "), + (_("%pB(%#" PRIx64 "): error: " + "cannot create STM32L4XX veneer; " + "jump out of range by %" PRId64 " bytes; " + "cannot encode branch instruction"), output_bfd, - stm32l4xx_errnode->vma - 4, - out_of_range); + (uint64_t) (stm32l4xx_errnode->vma - 4), + (int64_t) out_of_range); continue; } @@ -18456,8 +18488,8 @@ elf32_arm_write_section (bfd *output_bfd, STM32L4XX_ERRATUM_LDM_VENEER_SIZE) < -(1 << 24) || (signed) (veneer_r - veneer) >= (1 << 24)) { - _bfd_error_handler (_("%B: error: Cannot create STM32L4XX " - "veneer."), output_bfd); + _bfd_error_handler (_("%pB: error: cannot create STM32L4XX " + "veneer"), output_bfd); continue; } @@ -19478,7 +19510,7 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) && !(ibfd->flags & DYNAMIC) && (in_flags & EF_ARM_BE8)) { - _bfd_error_handler (_("error: %B is already in final BE8 format"), + _bfd_error_handler (_("error: %pB is already in final BE8 format"), ibfd); return FALSE; } @@ -19554,7 +19586,7 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) EF_ARM_EABI_VERSION (out_flags))) { _bfd_error_handler - (_("error: Source object %B has EABI version %d, but target %B has EABI version %d"), + (_("error: source object %pB has EABI version %d, but target %pB has EABI version %d"), ibfd, (in_flags & EF_ARM_EABIMASK) >> 24, obfd, (out_flags & EF_ARM_EABIMASK) >> 24); return FALSE; @@ -19569,7 +19601,7 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_ARM_APCS_26) != (out_flags & EF_ARM_APCS_26)) { _bfd_error_handler - (_("error: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"), + (_("error: %pB is compiled for APCS-%d, whereas target %pB uses APCS-%d"), ibfd, in_flags & EF_ARM_APCS_26 ? 26 : 32, obfd, out_flags & EF_ARM_APCS_26 ? 26 : 32); flags_compatible = FALSE; @@ -19579,11 +19611,11 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { if (in_flags & EF_ARM_APCS_FLOAT) _bfd_error_handler - (_("error: %B passes floats in float registers, whereas %B passes them in integer registers"), + (_("error: %pB passes floats in float registers, whereas %pB passes them in integer registers"), ibfd, obfd); else _bfd_error_handler - (_("error: %B passes floats in integer registers, whereas %B passes them in float registers"), + (_("error: %pB passes floats in integer registers, whereas %pB passes them in float registers"), ibfd, obfd); flags_compatible = FALSE; @@ -19593,12 +19625,12 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { if (in_flags & EF_ARM_VFP_FLOAT) _bfd_error_handler - (_("error: %B uses VFP instructions, whereas %B does not"), - ibfd, obfd); + (_("error: %pB uses %s instructions, whereas %pB does not"), + ibfd, "VFP", obfd); else _bfd_error_handler - (_("error: %B uses FPA instructions, whereas %B does not"), - ibfd, obfd); + (_("error: %pB uses %s instructions, whereas %pB does not"), + ibfd, "FPA", obfd); flags_compatible = FALSE; } @@ -19607,12 +19639,12 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { if (in_flags & EF_ARM_MAVERICK_FLOAT) _bfd_error_handler - (_("error: %B uses Maverick instructions, whereas %B does not"), - ibfd, obfd); + (_("error: %pB uses %s instructions, whereas %pB does not"), + ibfd, "Maverick", obfd); else _bfd_error_handler - (_("error: %B does not use Maverick instructions, whereas %B does"), - ibfd, obfd); + (_("error: %pB does not use %s instructions, whereas %pB does"), + ibfd, "Maverick", obfd); flags_compatible = FALSE; } @@ -19630,11 +19662,11 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { if (in_flags & EF_ARM_SOFT_FLOAT) _bfd_error_handler - (_("error: %B uses software FP, whereas %B uses hardware FP"), + (_("error: %pB uses software FP, whereas %pB uses hardware FP"), ibfd, obfd); else _bfd_error_handler - (_("error: %B uses hardware FP, whereas %B uses software FP"), + (_("error: %pB uses hardware FP, whereas %pB uses software FP"), ibfd, obfd); flags_compatible = FALSE; @@ -19648,13 +19680,13 @@ elf32_arm_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (in_flags & EF_ARM_INTERWORK) { _bfd_error_handler - (_("Warning: %B supports interworking, whereas %B does not"), + (_("warning: %pB supports interworking, whereas %pB does not"), ibfd, obfd); } else { _bfd_error_handler - (_("Warning: %B does not support interworking, whereas %B does"), + (_("warning: %pB does not support interworking, whereas %pB does"), ibfd, obfd); } } diff --git a/bfd/elf32-avr.c b/bfd/elf32-avr.c index 46e15ec..7087606 100644 --- a/bfd/elf32-avr.c +++ b/bfd/elf32-avr.c @@ -945,8 +945,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an AVR ELF reloc. */ -static void -avr_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +avr_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -956,10 +956,13 @@ avr_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_AVR_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid AVR reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_avr_howto_table[r_type]; + return TRUE; } static bfd_boolean diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index 478b8d4..ae83771 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -1040,8 +1040,8 @@ static const struct bfin_reloc_map bfin_reloc_map [] = }; -static void -bfin_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +bfin_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -1056,7 +1056,15 @@ bfin_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, cache_ptr->howto = &bfin_gnuext_howto_table [r_type - BFIN_GNUEXT_RELOC_MIN]; else - cache_ptr->howto = (reloc_howto_type *) NULL; + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + return TRUE; } /* Given a BFD reloc type, return the howto. */ @@ -1574,9 +1582,10 @@ bfin_relocate_section (bfd * output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable relocation against symbol `%s'"), - input_bfd, - input_section, rel->r_offset, h->root.root.string); + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable relocation against symbol `%s'"), + input_bfd, input_section, (uint64_t) rel->r_offset, + h->root.root.string); return FALSE; } @@ -1605,8 +1614,9 @@ bfin_relocate_section (bfd * output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): reloc against `%s': error %d"), - input_bfd, input_section, rel->r_offset, name, (int) r); + (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"), + input_bfd, input_section, (uint64_t) rel->r_offset, + name, (int) r); return FALSE; } } @@ -2625,8 +2635,9 @@ bfinfdpic_relocate_section (bfd * output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation at `%A+%#Lx' references symbol `%s' with nonzero addend"), - input_bfd, input_section, rel->r_offset, name); + (_("%pB: relocation at `%pA+%#" PRIx64 "' " + "references symbol `%s' with nonzero addend"), + input_bfd, input_section, (uint64_t) rel->r_offset, name); return FALSE; } @@ -4684,7 +4695,7 @@ bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info, bad_reloc: _bfd_error_handler /* xgettext:c-format */ - (_("%B: unsupported relocation type %d"), + (_("%pB: unsupported relocation type %#x"), abfd, (int) ELF32_R_TYPE (rel->r_info)); return FALSE; } @@ -4759,7 +4770,7 @@ elf32_bfin_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (0) #endif _bfd_error_handler - ("old_flags = 0x%.8x, new_flags = 0x%.8x, init = %s, filename = %B", + ("old_flags = 0x%.8x, new_flags = 0x%.8x, init = %s, filename = %pB", old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no", ibfd); if (!elf_flags_init (obfd)) /* First call, no flags set. */ @@ -4773,11 +4784,11 @@ elf32_bfin_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; if (IS_FDPIC (obfd)) _bfd_error_handler - (_("%B: cannot link non-fdpic object file into fdpic executable"), + (_("%pB: cannot link non-fdpic object file into fdpic executable"), ibfd); else _bfd_error_handler - (_("%B: cannot link fdpic object file into non-fdpic executable"), + (_("%pB: cannot link fdpic object file into non-fdpic executable"), ibfd); } @@ -5337,7 +5348,7 @@ bfd_bfin_elf32_create_embedded_relocs (bfd *abfd, /* We can only relocate absolute longword relocs at run time. */ if (ELF32_R_TYPE (irel->r_info) != (int) R_BFIN_BYTE4_DATA) { - *errmsg = _("unsupported reloc type"); + *errmsg = _("unsupported relocation type"); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -5421,7 +5432,7 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] = #define bfd_elf32_bfd_reloc_name_lookup \ bfin_bfd_reloc_name_lookup #define elf_info_to_howto bfin_info_to_howto -#define elf_info_to_howto_rel 0 +#define elf_info_to_howto_rel NULL #define elf_backend_object_p elf32_bfin_object_p #define bfd_elf32_bfd_is_local_label_name \ diff --git a/bfd/elf32-cr16.c b/bfd/elf32-cr16.c index 7bb67a7..7756ef5 100644 --- a/bfd/elf32-cr16.c +++ b/bfd/elf32-cr16.c @@ -641,7 +641,7 @@ _bfd_cr16_elf_create_got_section (bfd * abfd, struct bfd_link_info * info) /* Retrieve a howto ptr using a BFD reloc_code. */ static reloc_howto_type * -elf_cr16_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, +elf_cr16_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { unsigned int i; @@ -650,7 +650,8 @@ elf_cr16_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, if (code == cr16_reloc_map[i].bfd_reloc_enum) return &cr16_elf_howto_table[cr16_reloc_map[i].cr16_reloc_type]; - _bfd_error_handler (_("Unsupported CR16 relocation type: 0x%x\n"), code); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, code); return NULL; } @@ -670,8 +671,8 @@ elf_cr16_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Retrieve a howto ptr using an internal relocation entry. */ -static void -elf_cr16_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, +static bfd_boolean +elf_cr16_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); @@ -679,12 +680,13 @@ elf_cr16_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, if (r_type >= R_CR16_MAX) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised CR16 reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_CR16_NONE; + return FALSE; } cache_ptr->howto = cr16_elf_howto_table + r_type; + return TRUE; } /* Look through the relocs for a section during the first phase. @@ -2798,7 +2800,7 @@ bfd_cr16_elf32_create_embedded_relocs (bfd *abfd, if (!((ELF32_R_TYPE (irel->r_info) == (int) R_CR16_NUM32a) || (ELF32_R_TYPE (irel->r_info) == (int) R_CR16_NUM32))) { - *errmsg = _("unsupported reloc type"); + *errmsg = _("unsupported relocation type"); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -2894,7 +2896,7 @@ _bfd_cr16_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSE #define bfd_elf32_bfd_reloc_type_lookup elf_cr16_reloc_type_lookup #define bfd_elf32_bfd_reloc_name_lookup elf_cr16_reloc_name_lookup #define elf_info_to_howto elf_cr16_info_to_howto -#define elf_info_to_howto_rel 0 +#define elf_info_to_howto_rel NULL #define elf_backend_relocate_section elf32_cr16_relocate_section #define bfd_elf32_bfd_relax_section elf32_cr16_relax_section #define bfd_elf32_bfd_get_relocated_section_contents \ @@ -2921,8 +2923,7 @@ _bfd_cr16_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSE _bfd_cr16_elf_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ _bfd_cr16_elf_size_dynamic_sections -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all #define elf_backend_finish_dynamic_symbol \ _bfd_cr16_elf_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf32-cr16c.c b/bfd/elf32-cr16c.c index ec2948d..40ec759 100644 --- a/bfd/elf32-cr16c.c +++ b/bfd/elf32-cr16c.c @@ -165,15 +165,15 @@ elf_cr16c_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } -static void +static bfd_boolean elf_cr16c_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr ATTRIBUTE_UNUSED, Elf_Internal_Rela *dst ATTRIBUTE_UNUSED) { - abort (); + return FALSE; } -static void +static bfd_boolean elf_cr16c_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) @@ -183,10 +183,13 @@ elf_cr16c_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= RINDEX_16C_MAX) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid CR16C reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_howto_table[r_type]; + return TRUE; } /* Perform a relocation as part of a final link. */ diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index 4cbe4c5..1c367c4 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -453,7 +453,7 @@ cris_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for an CRIS ELF reloc. */ -static void +static bfd_boolean cris_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, arelent * cache_ptr, Elf_Internal_Rela * dst) @@ -464,10 +464,13 @@ cris_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= R_CRIS_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid CRIS reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & cris_elf_howto_table [r_type]; + return TRUE; } bfd_reloc_status_type @@ -1113,7 +1116,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: unresolvable relocation %s against symbol `%s'"), + (_("%pB, section %pA: unresolvable relocation %s against symbol `%s'"), input_bfd, input_section, cris_elf_howto_table[r_type].name, @@ -1178,10 +1181,10 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, _bfd_error_handler ((h->got.offset == (bfd_vma) -1) /* xgettext:c-format */ - ? _("%B, section %A: No PLT nor GOT for relocation %s" + ? _("%pB, section %pA: no PLT nor GOT for relocation %s" " against symbol `%s'") /* xgettext:c-format */ - : _("%B, section %A: No PLT for relocation %s" + : _("%pB, section %pA: no PLT for relocation %s" " against symbol `%s'"), input_bfd, input_section, @@ -1305,21 +1308,21 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, if (h == NULL) _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s with non-zero addend %Ld" - " against local symbol"), + (_("%pB, section %pA: relocation %s with non-zero addend" + " %" PRId64 " against local symbol"), input_bfd, input_section, cris_elf_howto_table[r_type].name, - rel->r_addend); + (int64_t) rel->r_addend); else _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s with non-zero addend %Ld" - " against symbol `%s'"), + (_("%pB, section %pA: relocation %s with non-zero addend" + " %" PRId64 " against symbol `%s'"), input_bfd, input_section, cris_elf_howto_table[r_type].name, - rel->r_addend, + (int64_t) rel->r_addend, symname[0] != '\0' ? symname : _("[whose name is lost]")); bfd_set_error (bfd_error_bad_value); @@ -1341,7 +1344,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s is" + (_("%pB, section %pA: relocation %s is" " not allowed for global symbol: `%s'"), input_bfd, input_section, @@ -1358,7 +1361,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s with no GOT created"), + (_("%pB, section %pA: relocation %s with no GOT created"), input_bfd, input_section, cris_elf_howto_table[r_type].name); @@ -1575,10 +1578,10 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, ((h->root.type == bfd_link_hash_undefined) /* We shouldn't get here for GCC-emitted code. */ /* xgettext:c-format */ - ? _("%B, section %A: relocation %s has an undefined" + ? _("%pB, section %pA: relocation %s has an undefined" " reference to `%s', perhaps a declaration mixup?") /* xgettext:c-format */ - : _("%B, section %A: relocation %s is" + : _("%pB, section %pA: relocation %s is" " not allowed for `%s', a global symbol with default" " visibility, perhaps a declaration mixup?"), input_bfd, @@ -1662,12 +1665,12 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, to pass us these kinds of things. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s with non-zero addend %Ld" - " against symbol `%s'"), + (_("%pB, section %pA: relocation %s with non-zero addend" + " %" PRId64 " against symbol `%s'"), input_bfd, input_section, cris_elf_howto_table[r_type].name, - rel->r_addend, + (int64_t) rel->r_addend, symname[0] != '\0' ? symname : _("[whose name is lost]")); bfd_set_error (bfd_error_bad_value); @@ -1815,12 +1818,12 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, things. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s with non-zero addend %Ld" - " against symbol `%s'"), + (_("%pB, section %pA: relocation %s with non-zero addend" + " %" PRId64 " against symbol `%s'"), input_bfd, input_section, cris_elf_howto_table[r_type].name, - rel->r_addend, + (int64_t) rel->r_addend, symname[0] != '\0' ? symname : _("[whose name is lost]")); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1949,7 +1952,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s is" + (_("%pB, section %pA: relocation %s is" " not allowed for symbol: `%s'" " which is defined outside the program," " perhaps a declaration mixup?"), @@ -3044,7 +3047,7 @@ cris_elf_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A:\n v10/v32 compatible object" + (_("%pB, section %pA: v10/v32 compatible object" " must not contain a PIC relocation"), abfd, sec); return FALSE; @@ -3098,7 +3101,7 @@ cris_elf_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A:\n relocation %s not valid" + (_("%pB, section %pA:\n relocation %s not valid" " in a shared object;" " typically an option mixup, recompile with -fPIC"), abfd, @@ -3316,7 +3319,7 @@ cris_elf_check_relocs (bfd *abfd, /* FIXME: How do we make this optionally a warning only? */ _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A:\n relocation %s should not" + (_("%pB, section %pA: relocation %s should not" " be used in a shared object; recompile with -fPIC"), abfd, sec, @@ -3741,8 +3744,8 @@ elf_cris_discard_excess_dso_dynamics (struct elf_cris_link_hash_entry *h, /* FIXME: How do we make this optionally a warning only? */ _bfd_error_handler /* xgettext:c-format */ - (_("%B, section `%A', to symbol `%s':\n" - " relocation %s should not be used" + (_("%pB, section `%pA', to symbol `%s':" + " relocation %s should not be used" " in a shared object; recompile with -fPIC"), s->section->owner, s->section, @@ -3854,7 +3857,7 @@ cris_elf_final_write_processing (bfd *abfd, default: _bfd_abort (__FILE__, __LINE__, - _("Unexpected machine number")); + _("unexpected machine number")); } elf_elfheader (abfd)->e_flags = e_flags; @@ -3955,8 +3958,8 @@ cris_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler (bfd_get_symbol_leading_char (ibfd) == '_' - ? _("%B: uses _-prefixed symbols, but writing file with non-prefixed symbols") - : _("%B: uses non-prefixed symbols, but writing file with _-prefixed symbols"), + ? _("%pB: uses _-prefixed symbols, but writing file with non-prefixed symbols") + : _("%pB: uses non-prefixed symbols, but writing file with _-prefixed symbols"), ibfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3975,9 +3978,9 @@ cris_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler ((imach == bfd_mach_cris_v32) - ? _("%B contains CRIS v32 code, incompatible" + ? _("%pB contains CRIS v32 code, incompatible" " with previous objects") - : _("%B contains non-CRIS-v32 code, incompatible" + : _("%pB contains non-CRIS-v32 code, incompatible" " with previous objects"), ibfd); bfd_set_error (bfd_error_bad_value); diff --git a/bfd/elf32-crx.c b/bfd/elf32-crx.c index d8a3862..fde3a58 100644 --- a/bfd/elf32-crx.c +++ b/bfd/elf32-crx.c @@ -28,7 +28,7 @@ static reloc_howto_type *elf_crx_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static void elf_crx_info_to_howto +static bfd_boolean elf_crx_info_to_howto (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean elf32_crx_relax_delete_bytes (struct bfd_link_info *, bfd *, asection *, bfd_vma, int); @@ -418,20 +418,21 @@ elf_crx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Retrieve a howto ptr using an internal relocation entry. */ -static void -elf_crx_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, +static bfd_boolean +elf_crx_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); if (r_type >= R_CRX_MAX) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised CRX reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_CRX_NONE; + return FALSE; } cache_ptr->howto = &crx_elf_howto_table[r_type]; + return TRUE; } /* Perform a relocation as part of a final link. */ @@ -1320,7 +1321,7 @@ elf32_crx_relax_section (bfd *abfd, asection *sec, #define bfd_elf32_bfd_reloc_name_lookup \ elf_crx_reloc_name_lookup #define elf_info_to_howto elf_crx_info_to_howto -#define elf_info_to_howto_rel 0 +#define elf_info_to_howto_rel NULL #define elf_backend_relocate_section elf32_crx_relocate_section #define bfd_elf32_bfd_relax_section elf32_crx_relax_section #define bfd_elf32_bfd_get_relocated_section_contents \ diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c index 0d1453c..c901595 100644 --- a/bfd/elf32-d10v.c +++ b/bfd/elf32-d10v.c @@ -220,8 +220,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an D10V ELF reloc. */ -static void -d10v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +d10v_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -231,10 +231,13 @@ d10v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_D10V_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid D10V reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_d10v_howto_table[r_type]; + return TRUE; } static asection * @@ -539,7 +542,7 @@ elf32_d10v_relocate_section (bfd *output_bfd, #define TARGET_BIG_SYM d10v_elf32_vec #define TARGET_BIG_NAME "elf32-d10v" -#define elf_info_to_howto 0 +#define elf_info_to_howto NULL #define elf_info_to_howto_rel d10v_info_to_howto_rel #define elf_backend_object_p 0 #define elf_backend_final_write_processing 0 diff --git a/bfd/elf32-d30v.c b/bfd/elf32-d30v.c index 51d9b88..7620a73 100644 --- a/bfd/elf32-d30v.c +++ b/bfd/elf32-d30v.c @@ -508,8 +508,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an D30V ELF reloc (type REL). */ -static void -d30v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +d30v_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -519,16 +519,19 @@ d30v_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_D30V_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid D30V reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_d30v_howto_table[r_type]; + return TRUE; } /* Set the howto pointer for an D30V ELF reloc (type RELA). */ -static void -d30v_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +d30v_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -538,10 +541,13 @@ d30v_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_D30V_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid D30V reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_d30v_howto_table[r_type]; + return TRUE; } #define ELF_ARCH bfd_arch_d30v diff --git a/bfd/elf32-dlx.c b/bfd/elf32-dlx.c index 468e6cb..d82d3ea 100644 --- a/bfd/elf32-dlx.c +++ b/bfd/elf32-dlx.c @@ -138,7 +138,7 @@ elf32_dlx_relocate16 (bfd *abfd, if (strcmp (input_section->name, symbol->section->output_section->name) != 0) { _bfd_error_handler - (_("BFD Link Error: branch (PC rel16) to section (%s) not supported"), + (_("branch (PC rel16) to section (%s) not supported"), symbol->section->output_section->name); return bfd_reloc_undefined; } @@ -201,7 +201,7 @@ elf32_dlx_relocate26 (bfd *abfd, if (strcmp (input_section->name, symbol->section->output_section->name) != 0) { _bfd_error_handler - (_("BFD Link Error: jump (PC rel26) to section (%s) not supported"), + (_("jump (PC rel26) to section (%s) not supported"), symbol->section->output_section->name); return bfd_reloc_undefined; } @@ -530,7 +530,7 @@ elf32_dlx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, } static reloc_howto_type * -dlx_rtype_to_howto (unsigned int r_type) +dlx_rtype_to_howto (bfd *abfd, unsigned int r_type) { switch (r_type) { @@ -545,31 +545,33 @@ dlx_rtype_to_howto (unsigned int r_type) default: if (r_type >= (unsigned int) R_DLX_max) { - _bfd_error_handler (_("Invalid DLX reloc number: %d"), r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return NULL; } return & dlx_elf_howto_table[r_type]; } } -static void +static bfd_boolean elf32_dlx_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, arelent * cache_ptr ATTRIBUTE_UNUSED, Elf_Internal_Rela * dst ATTRIBUTE_UNUSED) { - abort (); + return FALSE; } -static void -elf32_dlx_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +elf32_dlx_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - cache_ptr->howto = dlx_rtype_to_howto (r_type); - return; + cache_ptr->howto = dlx_rtype_to_howto (abfd, r_type); + return cache_ptr->howto != NULL; } #define TARGET_BIG_SYM dlx_elf32_be_vec diff --git a/bfd/elf32-epiphany.c b/bfd/elf32-epiphany.c index 1ad1184..efbd67b 100644 --- a/bfd/elf32-epiphany.c +++ b/bfd/elf32-epiphany.c @@ -362,8 +362,8 @@ epiphany_elf_relax_section (bfd *abfd, asection *sec, /* Set the howto pointer for a EPIPHANY ELF reloc. */ -static void -epiphany_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +epiphany_info_to_howto_rela (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -373,10 +373,13 @@ epiphany_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_EPIPHANY_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid Epiphany reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & epiphany_elf_howto_table [r_type]; + return TRUE; } /* Perform a single relocation. diff --git a/bfd/elf32-fr30.c b/bfd/elf32-fr30.c index 679322a..7b0fc88 100644 --- a/bfd/elf32-fr30.c +++ b/bfd/elf32-fr30.c @@ -367,7 +367,7 @@ fr30_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for an FR30 ELF reloc. */ -static void +static bfd_boolean fr30_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) @@ -378,10 +378,13 @@ fr30_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_FR30_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid FR30 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & fr30_elf_howto_table [r_type]; + return TRUE; } /* Perform a single relocation. By default we use the standard BFD diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index b8d0338..7831aff 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -2532,7 +2532,7 @@ frv_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for an FRV ELF reloc. */ -static void +static bfd_boolean frv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) @@ -2554,16 +2554,20 @@ frv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_FRV_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid FRV reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & elf32_frv_howto_table [r_type]; break; } + return TRUE; } /* Set the howto pointer for an FRV ELF REL reloc. */ -static void + +static bfd_boolean frvfdpic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -2594,8 +2598,9 @@ frvfdpic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, default: cache_ptr->howto = NULL; - break; + return FALSE; } + return TRUE; } /* Perform a single relocation. By default we use the standard BFD @@ -3529,9 +3534,10 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, if (addend) { info->callbacks->einfo - (_("%H: R_FRV_FUNCDESC references dynamic symbol" + (_("%H: %s references dynamic symbol" " with nonzero addend\n"), - input_bfd, input_section, rel->r_offset); + input_bfd, input_section, rel->r_offset, + "R_FRV_FUNCDESC"); return FALSE; } dynindx = h->dynindx; @@ -3650,9 +3656,10 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, if (addend && r_type == R_FRV_FUNCDESC_VALUE) { info->callbacks->einfo - (_("%H: R_FRV_FUNCDESC_VALUE" - " references dynamic symbol with nonzero addend\n"), - input_bfd, input_section, rel->r_offset); + (_("%H: %s references dynamic symbol" + " with nonzero addend\n"), + input_bfd, input_section, rel->r_offset, + "R_FRV_FUNCDESC_VALUE"); return FALSE; } dynindx = h->dynindx; @@ -6250,10 +6257,9 @@ elf32_frv_check_relocs (bfd *abfd, default: bad_reloc: - info->callbacks->einfo - /* xgettext:c-format */ - (_("%B: unsupported relocation type %i\n"), - abfd, ELF32_R_TYPE (rel->r_info)); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, (unsigned int) ELF32_R_TYPE (rel->r_info)); return FALSE; } } @@ -6504,7 +6510,7 @@ frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; _bfd_error_handler /* xgettext:c-format */ - (_("%B: compiled with %s and linked with modules" + (_("%pB: compiled with %s and linked with modules" " that use non-pic relocations"), ibfd, (new_flags & EF_FRV_BIGPIC) ? "-fPIC" : "-fpic"); #endif @@ -6558,7 +6564,7 @@ frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; _bfd_error_handler /* xgettext:c-format */ - (_("%B: compiled with %s and linked with modules compiled with %s"), + (_("%pB: compiled with %s and linked with modules compiled with %s"), ibfd, new_opt, old_opt); } @@ -6571,7 +6577,7 @@ frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses different unknown e_flags (%#x) fields" + (_("%pB: uses different unknown e_flags (%#x) fields" " than previous modules (%#x)"), ibfd, new_partial, old_partial); } @@ -6593,11 +6599,11 @@ frv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; if (IS_FDPIC (obfd)) _bfd_error_handler - (_("%B: cannot link non-fdpic object file into fdpic executable"), + (_("%pB: cannot link non-fdpic object file into fdpic executable"), ibfd); else _bfd_error_handler - (_("%B: cannot link fdpic object file into non-fdpic executable"), + (_("%pB: cannot link fdpic object file into non-fdpic executable"), ibfd); } diff --git a/bfd/elf32-ft32.c b/bfd/elf32-ft32.c index 86157d8..7c4e1ae 100644 --- a/bfd/elf32-ft32.c +++ b/bfd/elf32-ft32.c @@ -292,16 +292,25 @@ ft32_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for an FT32 ELF reloc. */ -static void -ft32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +ft32_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < (unsigned int) R_FT32_max); + if (r_type >= (unsigned int) R_FT32_max) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + cache_ptr->howto = & ft32_elf_howto_table [r_type]; + return cache_ptr->howto != NULL; } /* Relocate an FT32 ELF section. diff --git a/bfd/elf32-gen.c b/bfd/elf32-gen.c index 9ffaf59..1d907a0 100644 --- a/bfd/elf32-gen.c +++ b/bfd/elf32-gen.c @@ -41,20 +41,22 @@ static reloc_howto_type dummy = 0, /* dst_mask */ FALSE); /* pcrel_offset */ -static void +static bfd_boolean elf_generic_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED) { bfd_reloc->howto = &dummy; + return TRUE; } -static void +static bfd_boolean elf_generic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED) { bfd_reloc->howto = &dummy; + return TRUE; } static void @@ -66,7 +68,7 @@ check_for_relocs (bfd * abfd, asection * o, void * failed) ehdrp = elf_elfheader (abfd); /* xgettext:c-format */ - _bfd_error_handler (_("%B: Relocations in generic ELF (EM: %d)"), + _bfd_error_handler (_("%pB: relocations in generic ELF (EM: %d)"), abfd, ehdrp->e_machine); bfd_set_error (bfd_error_wrong_format); diff --git a/bfd/elf32-h8300.c b/bfd/elf32-h8300.c index 0412424..a41ae63 100644 --- a/bfd/elf32-h8300.c +++ b/bfd/elf32-h8300.c @@ -26,9 +26,9 @@ static reloc_howto_type *elf32_h8_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); -static void elf32_h8_info_to_howto +static bfd_boolean elf32_h8_info_to_howto (bfd *, arelent *, Elf_Internal_Rela *); -static void elf32_h8_info_to_howto_rel +static bfd_boolean elf32_h8_info_to_howto_rel (bfd *, arelent *, Elf_Internal_Rela *); static unsigned long elf32_h8_mach (flagword); static void elf32_h8_final_write_processing (bfd *, bfd_boolean); @@ -284,7 +284,7 @@ elf32_h8_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } -static void +static bfd_boolean elf32_h8_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { @@ -296,20 +296,20 @@ elf32_h8_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, if (h8_elf_howto_table[i].type == r) { bfd_reloc->howto = &h8_elf_howto_table[i]; - return; + return TRUE; } - abort (); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r); + bfd_set_error (bfd_error_bad_value); + return FALSE; } -static void -elf32_h8_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, +static bfd_boolean +elf32_h8_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, + arelent *bfd_reloc ATTRIBUTE_UNUSED, Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED) { - unsigned int r; - - abort (); - r = ELF32_R_TYPE (elf_reloc->r_info); - bfd_reloc->howto = &h8_elf_howto_table[r]; + return FALSE; } /* Special handling for H8/300 relocs. @@ -453,7 +453,8 @@ elf32_h8_relocate_section (bfd *output_bfd, struct bfd_link_info *info, arelent bfd_reloc; reloc_howto_type *howto; - elf32_h8_info_to_howto (input_bfd, &bfd_reloc, rel); + if (! elf32_h8_info_to_howto (input_bfd, &bfd_reloc, rel)) + continue; howto = bfd_reloc.howto; r_symndx = ELF32_R_SYM (rel->r_info); @@ -733,7 +734,8 @@ elf32_h8_relax_section (bfd *abfd, asection *sec, { arelent bfd_reloc; - elf32_h8_info_to_howto (abfd, &bfd_reloc, irel); + if (! elf32_h8_info_to_howto (abfd, &bfd_reloc, irel)) + continue; } /* Keep track of the previous reloc so that we can delete some long jumps created by the compiler. */ @@ -1249,7 +1251,8 @@ elf32_h8_relax_section (bfd *abfd, asection *sec, reloc_howto_type *h; bfd_vma last_reloc_size; - elf32_h8_info_to_howto (abfd, &bfd_reloc, last_reloc); + if (! elf32_h8_info_to_howto (abfd, &bfd_reloc, last_reloc)) + break; h = bfd_reloc.howto; last_reloc_size = 1 << h->size; if (last_reloc->r_offset + last_reloc_size @@ -1267,7 +1270,8 @@ elf32_h8_relax_section (bfd *abfd, asection *sec, reloc_howto_type *h; bfd_vma next_reloc_size; - elf32_h8_info_to_howto (abfd, &bfd_reloc, next_reloc); + if (! elf32_h8_info_to_howto (abfd, &bfd_reloc, next_reloc)) + break; h = bfd_reloc.howto; next_reloc_size = 1 << h->size; if (next_reloc->r_offset + next_reloc_size diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c index 7454f48..3ce3807 100644 --- a/bfd/elf32-hppa.c +++ b/bfd/elf32-hppa.c @@ -574,7 +574,7 @@ hppa_add_stub (const char *stub_name, if (hsh == NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: cannot create stub entry %s"), + _bfd_error_handler (_("%pB: cannot create stub entry %s"), section->owner, stub_name); return NULL; } @@ -826,10 +826,11 @@ hppa_build_one_stub (struct bfd_hash_entry *bh, void *in_arg) { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): cannot reach %s, recompile with -ffunction-sections"), + (_("%pB(%pA+%#" PRIx64 "): " + "cannot reach %s, recompile with -ffunction-sections"), hsh->target_section->owner, stub_sec, - hsh->stub_offset, + (uint64_t) hsh->stub_offset, hsh->bh_root.string); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1239,7 +1240,7 @@ elf32_hppa_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s can not be used when making a shared object; recompile with -fPIC"), + (_("%pB: relocation %s can not be used when making a shared object; recompile with -fPIC"), abfd, elf_hppa_howto_table[r_type].name); bfd_set_error (bfd_error_bad_value); @@ -2079,7 +2080,7 @@ maybe_set_textrel (struct elf_link_hash_entry *eh, void *inf) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, eh->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2677,7 +2678,7 @@ get_local_syms (bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *info) else { /* xgettext:c-format */ - _bfd_error_handler (_("%B: duplicate export stub %s"), + _bfd_error_handler (_("%pB: duplicate export stub %s"), input_bfd, stub_name); } } @@ -3330,10 +3331,11 @@ final_link_relocate (asection *input_section, error. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s fixup for insn %#x is not supported in a non-shared link"), + (_("%pB(%pA+%#" PRIx64 "): %s fixup for insn %#x " + "is not supported in a non-shared link"), input_bfd, input_section, - offset, + (uint64_t) offset, howto->name, insn); } @@ -3496,10 +3498,11 @@ final_link_relocate (asection *input_section, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): cannot reach %s, recompile with -ffunction-sections"), + (_("%pB(%pA+%#" PRIx64 "): cannot reach %s, " + "recompile with -ffunction-sections"), input_bfd, input_section, - offset, + (uint64_t) offset, hsh->bh_root.string); bfd_set_error (bfd_error_bad_value); return bfd_reloc_notsupported; @@ -4139,7 +4142,7 @@ elf32_hppa_relocate_section (bfd *output_bfd, if (*sym_name == '\0') sym_name = bfd_section_name (input_bfd, sym_sec); _bfd_error_handler - (_("%B:%s has both normal and TLS relocs"), + (_("%pB:%s has both normal and TLS relocs"), input_bfd, sym_name); } bfd_set_error (bfd_error_bad_value); @@ -4198,10 +4201,10 @@ elf32_hppa_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): cannot handle %s for %s"), + (_("%pB(%pA+%#" PRIx64 "): cannot handle %s for %s"), input_bfd, input_section, - rela->r_offset, + (uint64_t) rela->r_offset, howto->name, sym_name); bfd_set_error (bfd_error_bad_value); diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index 88be84b..2c6a30d 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -289,8 +289,8 @@ i370_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an i370 ELF reloc. */ -static void -i370_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +i370_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -304,12 +304,13 @@ i370_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= R_I370_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised I370 reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_I370_NONE; + return FALSE; } cache_ptr->howto = i370_elf_howto_table[r_type]; + return TRUE; } /* Hack alert -- the following several routines look generic to me ... @@ -356,7 +357,7 @@ i370_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses different e_flags (%#x) fields than previous modules (%#x)"), + (_("%pB: uses different e_flags (%#x) fields than previous modules (%#x)"), ibfd, new_flags, old_flags); bfd_set_error (bfd_error_bad_value); @@ -811,7 +812,7 @@ i370_elf_check_relocs (bfd *abfd, return TRUE; #ifdef DEBUG - _bfd_error_handler ("i370_elf_check_relocs called for section %A in %B", + _bfd_error_handler ("i370_elf_check_relocs called for section %pA in %pB", sec, abfd); #endif @@ -1049,7 +1050,7 @@ i370_elf_relocate_section (bfd *output_bfd, bfd_boolean ret = TRUE; #ifdef DEBUG - _bfd_error_handler ("i370_elf_relocate_section called for %B section %A, %u relocations%s", + _bfd_error_handler ("i370_elf_relocate_section called for %pB section %pA, %u relocations%s", input_bfd, input_section, input_section->reloc_count, (bfd_link_relocatable (info)) ? " (relocatable)" : ""); @@ -1068,7 +1069,6 @@ i370_elf_relocate_section (bfd *output_bfd, Elf_Internal_Sym *sym = NULL; asection *sec = NULL; struct elf_link_hash_entry * h = NULL; - const char *sym_name = NULL; reloc_howto_type *howto; unsigned long r_symndx; bfd_vma relocation; @@ -1078,7 +1078,7 @@ i370_elf_relocate_section (bfd *output_bfd, || !i370_elf_howto_table[(int)r_type]) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unknown relocation type %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); @@ -1094,7 +1094,6 @@ i370_elf_relocate_section (bfd *output_bfd, { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - sym_name = ""; relocation = _bfd_elf_rela_local_sym (output_bfd, sym, & sec, rel); addend = rel->r_addend; @@ -1111,7 +1110,6 @@ i370_elf_relocate_section (bfd *output_bfd, while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - sym_name = h->root.root.string; if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { @@ -1161,8 +1159,8 @@ i370_elf_relocate_section (bfd *output_bfd, { default: _bfd_error_handler - (_("%B: unknown relocation type %d for symbol %s"), - input_bfd, (int) r_type, sym_name); + (_("%pB: unsupported relocation type %#x"), + input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -1301,28 +1299,15 @@ i370_elf_relocate_section (bfd *output_bfd, case (int) R_I370_COPY: case (int) R_I370_RELATIVE: - _bfd_error_handler - /* xgettext:c-format */ - (_("%B: Relocation %s is not yet supported for symbol %s."), - input_bfd, - i370_elf_howto_table[(int) r_type]->name, - sym_name); - + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: %s unsupported"), + input_bfd, + i370_elf_howto_table[(int) r_type]->name); bfd_set_error (bfd_error_invalid_operation); ret = FALSE; continue; } -#ifdef DEBUG - fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n", - howto->name, - (int)r_type, - sym_name, - r_symndx, - (long) offset, - (long) addend); -#endif - r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, offset, relocation, addend); @@ -1405,10 +1390,10 @@ i370_elf_relocate_section (bfd *output_bfd, #define elf_backend_adjust_dynamic_symbol i370_elf_adjust_dynamic_symbol #define elf_backend_check_relocs i370_elf_check_relocs -static int -i370_noop (void) +static bfd_boolean +i370_noop (bfd * abfd ATTRIBUTE_UNUSED, ...) { - return 1; + return TRUE; } #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 1f380db..61a1409 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -194,7 +194,7 @@ static reloc_howto_type elf_howto_table[]= #endif static reloc_howto_type * -elf_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, +elf_i386_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { switch (code) @@ -346,11 +346,13 @@ elf_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, return &elf_howto_table[R_386_GNU_VTENTRY - R_386_vt_offset]; default: - break; + TRACE ("Unknown"); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type: %#x"), + abfd, (int) code); + bfd_set_error (bfd_error_bad_value); + return NULL; } - - TRACE ("Unknown"); - return 0; } static reloc_howto_type * @@ -368,7 +370,7 @@ elf_i386_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, } static reloc_howto_type * -elf_i386_rtype_to_howto (bfd *abfd, unsigned r_type) +elf_i386_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, unsigned r_type) { unsigned int indx; @@ -379,25 +381,30 @@ elf_i386_rtype_to_howto (bfd *abfd, unsigned r_type) >= R_386_ext2 - R_386_ext) && ((indx = r_type - R_386_vt_offset) - R_386_ext2 >= R_386_vt - R_386_ext2)) - { - /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), - abfd, (int) r_type); - indx = R_386_NONE; - } + return NULL; /* PR 17512: file: 0f67f69d. */ if (elf_howto_table [indx].type != r_type) return NULL; return &elf_howto_table[indx]; } -static void -elf_i386_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +elf_i386_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); - cache_ptr->howto = elf_i386_rtype_to_howto (abfd, r_type); + + if ((cache_ptr->howto = elf_i386_rtype_to_howto (abfd, r_type)) == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + return TRUE; } /* Return whether a symbol name implies a local label. The UnixWare @@ -1156,10 +1163,10 @@ elf_i386_tls_transition (struct bfd_link_info *info, bfd *abfd, _bfd_error_handler /* xgettext:c-format */ - (_("%B: TLS transition from %s to %s against `%s' at %#Lx " - "in section `%A' failed"), + (_("%pB: TLS transition from %s to %s against `%s'" + " at %#" PRIx64 " in section `%pA' failed"), abfd, from->name, to->name, name, - rel->r_offset, sec); + (uint64_t) rel->r_offset, sec); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1247,7 +1254,7 @@ elf_i386_convert_load_reloc (bfd *abfd, Elf_Internal_Shdr *symtab_hdr, _bfd_error_handler /* xgettext:c-format */ - (_("%B: direct GOT relocation R_386_GOT32X against `%s' without base" + (_("%pB: direct GOT relocation R_386_GOT32X against `%s' without base" " register can not be used when making a shared object"), abfd, name); return FALSE; @@ -1507,7 +1514,7 @@ elf_i386_check_relocs (bfd *abfd, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); goto error_return; } @@ -1578,6 +1585,10 @@ elf_i386_check_relocs (bfd *abfd, rel, rel_end, h, r_symndx, FALSE)) goto error_return; + /* Check if _GLOBAL_OFFSET_TABLE_ is referenced. */ + if (h == htab->elf.hgot) + htab->got_referenced = TRUE; + switch (r_type) { case R_386_TLS_LDM: @@ -1700,7 +1711,7 @@ elf_i386_check_relocs (bfd *abfd, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and " + (_("%pB: `%s' accessed both as normal and " "thread local symbol"), abfd, name); bfd_set_error (bfd_error_bad_value); @@ -1720,11 +1731,19 @@ elf_i386_check_relocs (bfd *abfd, case R_386_GOTOFF: case R_386_GOTPC: - create_got: +create_got: if (r_type != R_386_TLS_IE) { if (eh != NULL) - eh->zero_undefweak &= 0x2; + { + eh->zero_undefweak &= 0x2; + + /* Need GOT to resolve undefined weak symbol to 0. */ + if (r_type == R_386_GOTOFF + && h->root.type == bfd_link_hash_undefweak + && bfd_link_executable (info)) + htab->got_referenced = TRUE; + } break; } /* Fall through */ @@ -1764,7 +1783,7 @@ do_relocation: { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unsupported non-PIC call to IFUNC `%s'"), + (_("%pB: unsupported non-PIC call to IFUNC `%s'"), abfd, h->root.root.string); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -1800,7 +1819,7 @@ do_relocation: size_reloc = FALSE; do_size: - if (NEED_DYNAMIC_RELOCATION_P (info, h, sec, r_type, + if (NEED_DYNAMIC_RELOCATION_P (info, FALSE, h, sec, r_type, R_386_32)) { struct elf_dyn_relocs *p; @@ -2342,7 +2361,7 @@ bad_ifunc_reloc: NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against STT_GNU_IFUNC " + (_("%pB: relocation %s against STT_GNU_IFUNC " "symbol `%s' isn't supported"), input_bfd, howto->name, name); bfd_set_error (bfd_error_bad_value); @@ -2375,7 +2394,7 @@ do_ifunc_pointer: if (POINTER_LOCAL_IFUNC_P (info, h)) { - info->callbacks->minfo (_("Local IFUNC function `%s' in %B\n"), + info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"), h->root.root.string, h->root.u.def.section->owner); @@ -2590,7 +2609,7 @@ disallow_got32: _bfd_error_handler /* xgettext:c-format */ - (_("%B: direct GOT relocation %s against `%s'" + (_("%pB: direct GOT relocation %s against `%s'" " without base register can not be used" " when making a shared object"), input_bfd, howto->name, name); @@ -2640,7 +2659,7 @@ disallow_got32: _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation R_386_GOTOFF against undefined %s" + (_("%pB: relocation R_386_GOTOFF against undefined %s" " `%s' can not be used when making a shared object"), input_bfd, v, h->root.root.string); bfd_set_error (bfd_error_bad_value); @@ -2653,7 +2672,7 @@ disallow_got32: { _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation R_386_GOTOFF against protected %s" + (_("%pB: relocation R_386_GOTOFF against protected %s" " `%s' can not be used when making a shared object"), input_bfd, h->type == STT_FUNC ? "function" : "data", @@ -3430,10 +3449,10 @@ disallow_got32: { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); return FALSE; @@ -3470,9 +3489,9 @@ check_relocation_error: { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): reloc against `%s': error %d"), + (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"), input_bfd, input_section, - rel->r_offset, name, (int) r); + (uint64_t) rel->r_offset, name, (int) r); return FALSE; } } @@ -3681,7 +3700,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd, + got_offset); if (PLT_LOCAL_IFUNC_P (info, h)) { - info->callbacks->minfo (_("Local IFUNC function `%s' in %B\n"), + info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"), h->root.root.string, h->root.u.def.section->owner); @@ -3820,7 +3839,7 @@ elf_i386_finish_dynamic_symbol (bfd *output_bfd, } if (SYMBOL_REFERENCES_LOCAL_P (info, h)) { - info->callbacks->minfo (_("Local IFUNC function `%s' in %B\n"), + info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"), h->root.root.string, h->root.u.def.section->owner); @@ -4178,6 +4197,7 @@ elf_i386_get_synthetic_symtab (bfd *abfd, switch (get_elf_x86_backend_data (abfd)->target_os) { case is_normal: + case is_solaris: non_lazy_plt = &elf_i386_non_lazy_plt; lazy_ibt_plt = &elf_i386_lazy_ibt_plt; non_lazy_ibt_plt = &elf_i386_non_lazy_ibt_plt; @@ -4337,6 +4357,7 @@ elf_i386_link_setup_gnu_properties (struct bfd_link_info *info) switch (get_elf_x86_backend_data (info->output_bfd)->target_os) { case is_normal: + case is_solaris: init_table.plt0_pad_byte = 0x0; init_table.lazy_plt = &elf_i386_lazy_plt; init_table.non_lazy_plt = &elf_i386_non_lazy_plt; @@ -4454,6 +4475,14 @@ elf_i386_fbsd_post_process_headers (bfd *abfd, struct bfd_link_info *info) #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf32-i386-sol2" +static const struct elf_x86_backend_data elf_i386_solaris_arch_bed = + { + is_solaris /* os */ + }; + +#undef elf_backend_arch_data +#define elf_backend_arch_data &elf_i386_solaris_arch_bed + #undef elf_backend_post_process_headers /* Restore default: we cannot use ELFOSABI_SOLARIS, otherwise ELFOSABI_NONE @@ -4580,6 +4609,9 @@ elf32_iamcu_elf_object_p (bfd *abfd) #undef ELF_MACHINE_CODE #define ELF_MACHINE_CODE EM_IAMCU +#undef elf_backend_arch_data +#define elf_backend_arch_data &elf_i386_arch_bed + #undef ELF_OSABI #undef elf32_bed diff --git a/bfd/elf32-i860.c b/bfd/elf32-i860.c index e34965c..737e7f5 100644 --- a/bfd/elf32-i860.c +++ b/bfd/elf32-i860.c @@ -761,10 +761,11 @@ lookup_howto (unsigned int rtype) elf_code_to_howto_index[elf32_i860_howto_table[i].type] = i; } - BFD_ASSERT (rtype <= R_860_max); + if (rtype > R_860_max) + return NULL; i = elf_code_to_howto_index[rtype]; if (i >= howto_tbl_size) - return 0; + return NULL; return elf32_i860_howto_table + i; } @@ -880,8 +881,7 @@ elf32_i860_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, rtype = R_860_HIGOTOFF; break; default: - rtype = 0; - break; + return NULL; } return lookup_howto (rtype); } @@ -904,13 +904,15 @@ elf32_i860_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, } /* Given a ELF reloc, return the matching HOWTO structure. */ -static void + +static bfd_boolean elf32_i860_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { bfd_reloc->howto = lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info)); + return bfd_reloc->howto != NULL; } /* Specialized relocation handler for R_860_SPLITn. These relocations diff --git a/bfd/elf32-i960.c b/bfd/elf32-i960.c index 61a7f9d..244e4ea 100644 --- a/bfd/elf32-i960.c +++ b/bfd/elf32-i960.c @@ -29,7 +29,7 @@ #define bfd_elf32_bfd_reloc_type_lookup elf32_i960_reloc_type_lookup #define bfd_elf32_bfd_reloc_name_lookup \ elf32_i960_reloc_name_lookup -#define elf_info_to_howto elf32_i960_info_to_howto +#define elf_info_to_howto NULL #define elf_info_to_howto_rel elf32_i960_info_to_howto_rel /* ELF relocs are against symbols. If we are producing relocatable @@ -116,15 +116,7 @@ elf32_i960_bfd_to_reloc_type (bfd_reloc_code_real_type code) } } -static void -elf32_i960_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, - arelent * cache_ptr ATTRIBUTE_UNUSED, - Elf_Internal_Rela * dst ATTRIBUTE_UNUSED) -{ - abort (); -} - -static void +static bfd_boolean elf32_i960_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) @@ -137,11 +129,14 @@ elf32_i960_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (type >= R_960_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid i960 reloc number: %d"), abfd, type); - type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_howto_table[(int) type]; + return TRUE; } static reloc_howto_type * diff --git a/bfd/elf32-ip2k.c b/bfd/elf32-ip2k.c index 3733ebb..1432f18 100644 --- a/bfd/elf32-ip2k.c +++ b/bfd/elf32-ip2k.c @@ -1231,8 +1231,8 @@ ip2k_elf_relax_section (bfd *abfd, /* Set the howto pointer for a IP2K ELF reloc. */ -static void -ip2k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +ip2k_info_to_howto_rela (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -1242,10 +1242,13 @@ ip2k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_IP2K_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid IP2K reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & ip2k_elf_howto_table [r_type]; + return TRUE; } /* Perform a single relocation. @@ -1295,9 +1298,11 @@ ip2k_final_link_relocate (reloc_howto_type * howto, ip2k_nominal_page_bits (input_bfd, input_section, rel->r_offset, contents)) /* xgettext:c-format */ - _bfd_error_handler (_("ip2k linker: missing page instruction at %#Lx (dest = %#Lx)"), - BASEADDR (input_section) + rel->r_offset, - relocation + rel->r_addend); + _bfd_error_handler + (_("ip2k linker: missing page instruction " + "at %#" PRIx64 " (dest = %#" PRIx64 ")"), + (uint64_t) (BASEADDR (input_section) + rel->r_offset), + (uint64_t) (relocation + rel->r_addend)); } else if (ip2k_relaxed) { @@ -1312,9 +1317,11 @@ ip2k_final_link_relocate (reloc_howto_type * howto, ip2k_nominal_page_bits (input_bfd, input_section, rel->r_offset - 2, contents))) /* xgettext:c-format */ - _bfd_error_handler (_("ip2k linker: redundant page instruction at %#Lx (dest = %#Lx)"), - page_addr, - relocation + rel->r_addend); + _bfd_error_handler + (_("ip2k linker: redundant page instruction " + "at %#" PRIx64 " (dest = %#" PRIx64 ")"), + (uint64_t) page_addr, + (uint64_t) (relocation + rel->r_addend)); } if ((relocation & IP2K_INSN_MASK) == IP2K_INSN_VALUE) relocation &= ~IP2K_INSN_MASK; diff --git a/bfd/elf32-iq2000.c b/bfd/elf32-iq2000.c index b29b9cb..d1ce3c8 100644 --- a/bfd/elf32-iq2000.c +++ b/bfd/elf32-iq2000.c @@ -416,7 +416,7 @@ iq2000_final_link_relocate (reloc_howto_type * howto, /* Set the howto pointer for a IQ2000 ELF reloc. */ -static void +static bfd_boolean iq2000_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, arelent * cache_ptr, Elf_Internal_Rela * dst) @@ -438,12 +438,15 @@ iq2000_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_IQ2000_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid IQ2000 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & iq2000_elf_howto_table [r_type]; break; } + return TRUE; } /* Look through the relocs for a section during the first phase. @@ -825,7 +828,7 @@ iq2000_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; _bfd_error_handler /* xgettext:c-format */ - (_("%B: compiled with %s and linked with modules compiled with %s"), + (_("%pB: compiled with %s and linked with modules compiled with %s"), ibfd, new_opt, old_opt); } @@ -839,7 +842,7 @@ iq2000_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses different e_flags (%#x) fields than previous modules (%#x)"), + (_("%pB: uses different e_flags (%#x) fields than previous modules (%#x)"), ibfd, new_flags, old_flags); } } diff --git a/bfd/elf32-lm32.c b/bfd/elf32-lm32.c index 089ec84..027830b 100644 --- a/bfd/elf32-lm32.c +++ b/bfd/elf32-lm32.c @@ -525,8 +525,8 @@ lm32_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an Lattice Mico32 ELF reloc. */ -static void -lm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +lm32_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -536,10 +536,13 @@ lm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_LM32_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid LM32 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &lm32_elf_howto_table[r_type]; + return TRUE; } /* Set the right machine number for an Lattice Mico32 ELF file. */ @@ -995,7 +998,9 @@ lm32_elf_relocate_section (bfd *output_bfd, /* Addend should be zero. */ if (rel->r_addend != 0) - _bfd_error_handler (_("internal error: addend should be zero for R_LM32_16_GOT")); + _bfd_error_handler + (_("internal error: addend should be zero for %s"), + "R_LM32_16_GOT"); r = _bfd_final_link_relocate (howto, input_bfd, @@ -1073,7 +1078,8 @@ lm32_elf_relocate_section (bfd *output_bfd, const char *msg = NULL; arelent bfd_reloc; - lm32_info_to_howto_rela (input_bfd, &bfd_reloc, rel); + if (! lm32_info_to_howto_rela (input_bfd, &bfd_reloc, rel)) + continue; howto = bfd_reloc.howto; if (h != NULL) @@ -1427,8 +1433,9 @@ lm32_elf_finish_dynamic_sections (bfd *output_bfd, != (lm32fdpic_fixup32_section (info)->reloc_count * 4)) { _bfd_error_handler - ("LINKER BUG: .rofixup section size mismatch: size/4 %Ld != relocs %d", - lm32fdpic_fixup32_section (info)->size/4, + ("LINKER BUG: .rofixup section size mismatch: size/4 %" PRId64 + " != relocs %d", + (int64_t) (lm32fdpic_fixup32_section (info)->size / 4), lm32fdpic_fixup32_section (info)->reloc_count); return FALSE; } @@ -1449,7 +1456,9 @@ lm32_elf_finish_dynamic_sections (bfd *output_bfd, if (hend->u.def.value != value) { _bfd_error_handler - ("LINKER BUG: .rofixup section hend->u.def.value != value: %Ld != %Ld", hend->u.def.value, value); + ("LINKER BUG: .rofixup section hend->u.def.value != value: %" + PRId64 " != %" PRId64, + (int64_t) hend->u.def.value, (int64_t) value); return FALSE; } } @@ -1986,7 +1995,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2562,7 +2571,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd) #define bfd_elf32_bfd_reloc_type_lookup lm32_reloc_type_lookup #define bfd_elf32_bfd_reloc_name_lookup lm32_reloc_name_lookup #define elf_info_to_howto lm32_info_to_howto_rela -#define elf_info_to_howto_rel 0 +#define elf_info_to_howto_rel NULL #define elf_backend_rela_normal 1 #define elf_backend_object_p lm32_elf_object_p #define elf_backend_final_write_processing lm32_elf_final_write_processing @@ -2580,7 +2589,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd) #define elf_backend_reloc_type_class lm32_elf_reloc_type_class #define elf_backend_copy_indirect_symbol lm32_elf_copy_indirect_symbol #define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections -#define elf_backend_omit_section_dynsym ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all #define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections #define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections #define elf_backend_adjust_dynamic_symbol lm32_elf_adjust_dynamic_symbol diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index dfb8a1e..613844a 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -28,7 +28,7 @@ /* Forward declarations. */ static reloc_howto_type * m32c_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static void m32c_info_to_howto_rela +static bfd_boolean m32c_info_to_howto_rela (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean m32c_elf_relocate_section (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); @@ -291,11 +291,10 @@ m32c_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for an M32C ELF reloc. */ -static void -m32c_info_to_howto_rela - (bfd * abfd ATTRIBUTE_UNUSED, - arelent * cache_ptr, - Elf_Internal_Rela * dst) +static bfd_boolean +m32c_info_to_howto_rela (bfd * abfd, + arelent * cache_ptr, + Elf_Internal_Rela * dst) { unsigned int r_type; @@ -303,10 +302,13 @@ m32c_info_to_howto_rela if (r_type >= (unsigned int) R_M32C_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid M32C reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & m32c_elf_howto_table [r_type]; + return TRUE; } @@ -871,7 +873,7 @@ m32c_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; _bfd_error_handler /* xgettext:c-format */ - (_("%B: compiled with %s and linked with modules compiled with %s"), + (_("%pB: compiled with %s and linked with modules compiled with %s"), ibfd, new_opt, old_opt); } @@ -884,7 +886,7 @@ m32c_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses different e_flags (%#x) fields" + (_("%pB: uses different e_flags (%#x) fields" " than previous modules (%#x)"), ibfd, new_flags, old_flags); } diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c index 78d5e39..94a4bc9 100644 --- a/bfd/elf32-m32r.c +++ b/bfd/elf32-m32r.c @@ -1272,7 +1272,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an M32R ELF reloc. */ -static void +static bfd_boolean m32r_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) @@ -1283,21 +1283,34 @@ m32r_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (r_type > (unsigned int) R_M32R_GNU_VTENTRY) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid M32R reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &m32r_elf_howto_table[r_type]; + return TRUE; } -static void +static bfd_boolean m32r_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) { - BFD_ASSERT ((ELF32_R_TYPE(dst->r_info) == (unsigned int) R_M32R_NONE) - || ((ELF32_R_TYPE(dst->r_info) > (unsigned int) R_M32R_GNU_VTENTRY) - && (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_M32R_max))); - cache_ptr->howto = &m32r_elf_howto_table[ELF32_R_TYPE(dst->r_info)]; + unsigned int r_type = ELF32_R_TYPE (dst->r_info); + + if (r_type == (unsigned int) R_M32R_NONE + || ((r_type > (unsigned int) R_M32R_GNU_VTENTRY) + && (r_type < (unsigned int) R_M32R_max))) + { + cache_ptr->howto = &m32r_elf_howto_table[r_type]; + return TRUE; + } + + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } @@ -2094,7 +2107,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2401,7 +2414,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, if (r_type < 0 || r_type >= (int) R_M32R_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unknown relocation type %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -2523,11 +2536,11 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation " + (_("%pB(%pA+%#" PRIx64 "): unresolvable %s relocation " "against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); } @@ -2968,7 +2981,8 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: The target (%s) of an %s relocation is in the wrong section (%A)"), + (_("%pB: the target (%s) of an %s relocation" + " is in the wrong section (%pA)"), input_bfd, sym_name, m32r_elf_howto_table[(int) r_type].name, @@ -3470,7 +3484,7 @@ m32r_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) || ((in_flags & EF_M32R_ARCH) == E_M32R2_ARCH)) { _bfd_error_handler - (_("%B: Instruction set mismatch with previous modules"), ibfd); + (_("%pB: instruction set mismatch with previous modules"), ibfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3854,8 +3868,7 @@ m32r_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED, #define elf_backend_create_dynamic_sections m32r_elf_create_dynamic_sections #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create #define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol #define elf_backend_finish_dynamic_symbol m32r_elf_finish_dynamic_symbol diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c index 0283e93..95d271f 100644 --- a/bfd/elf32-m68hc11.c +++ b/bfd/elf32-m68hc11.c @@ -32,7 +32,7 @@ /* Relocation functions. */ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static void m68hc11_info_to_howto_rel +static bfd_boolean m68hc11_info_to_howto_rel (bfd *, arelent *, Elf_Internal_Rela *); /* Trampoline generation. */ @@ -377,8 +377,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an M68HC11 ELF reloc. */ -static void -m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +m68hc11_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; @@ -387,10 +387,13 @@ m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_M68HC11_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid M68HC11 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; + return TRUE; } @@ -1296,7 +1299,7 @@ static const struct bfd_elf_special_section elf32_m68hc11_special_sections[] = #define TARGET_BIG_SYM m68hc11_elf32_vec #define TARGET_BIG_NAME "elf32-m68hc11" -#define elf_info_to_howto 0 +#define elf_info_to_howto NULL #define elf_info_to_howto_rel m68hc11_info_to_howto_rel #define bfd_elf32_bfd_relax_section m68hc11_elf_relax_section #define elf_backend_check_relocs elf32_m68hc11_check_relocs diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c index 3fec993..0b53674 100644 --- a/bfd/elf32-m68hc12.c +++ b/bfd/elf32-m68hc12.c @@ -32,7 +32,7 @@ /* Relocation functions. */ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static void m68hc11_info_to_howto_rel +static bfd_boolean m68hc11_info_to_howto_rel (bfd *, arelent *, Elf_Internal_Rela *); /* Trampoline generation. */ @@ -497,8 +497,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an M68HC11 ELF reloc. */ -static void -m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +m68hc11_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; @@ -507,10 +507,13 @@ m68hc11_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_M68HC11_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid M68HC12 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; + return TRUE; } @@ -646,7 +649,7 @@ static const struct bfd_elf_special_section elf32_m68hc12_special_sections[] = #define TARGET_BIG_SYM m68hc12_elf32_vec #define TARGET_BIG_NAME "elf32-m68hc12" -#define elf_info_to_howto 0 +#define elf_info_to_howto NULL #define elf_info_to_howto_rel m68hc11_info_to_howto_rel #define elf_backend_check_relocs elf32_m68hc11_check_relocs #define elf_backend_relocate_section elf32_m68hc11_relocate_section diff --git a/bfd/elf32-m68hc1x.c b/bfd/elf32-m68hc1x.c index dcdc357..35152ee 100644 --- a/bfd/elf32-m68hc1x.c +++ b/bfd/elf32-m68hc1x.c @@ -162,7 +162,7 @@ m68hc12_add_stub (const char *stub_name, asection *section, if (stub_entry == NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: cannot create stub entry %s"), + _bfd_error_handler (_("%pB: cannot create stub entry %s"), section->owner, stub_name); return NULL; } @@ -963,7 +963,8 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, || r_type == R_M68HC11_GNU_VTINHERIT) continue; - (*ebd->elf_info_to_howto_rel) (input_bfd, &arel, rel); + if (! (*ebd->elf_info_to_howto_rel) (input_bfd, &arel, rel)) + continue; howto = arel.howto; h = NULL; @@ -1112,7 +1113,7 @@ elf32_m68hc11_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, /* Get virtual address of instruction having the relocation. */ if (is_far) { - msg = _("Reference to the far symbol `%s' using a wrong " + msg = _("reference to the far symbol `%s' using a wrong " "relocation may result in incorrect execution"); buf = xmalloc (strlen (msg) + strlen (name) + 10); sprintf (buf, msg, name); @@ -1348,14 +1349,14 @@ _bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((new_flags & E_M68HC11_I32) != (old_flags & E_M68HC11_I32)) { _bfd_error_handler - (_("%B: linking files compiled for 16-bit integers (-mshort) " + (_("%pB: linking files compiled for 16-bit integers (-mshort) " "and others for 32-bit integers"), ibfd); ok = FALSE; } if ((new_flags & E_M68HC11_F64) != (old_flags & E_M68HC11_F64)) { _bfd_error_handler - (_("%B: linking files compiled for 32-bit double (-fshort-double) " + (_("%pB: linking files compiled for 32-bit double (-fshort-double) " "and others for 64-bit double"), ibfd); ok = FALSE; } @@ -1364,7 +1365,7 @@ _bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (!EF_M68HC11_CAN_MERGE_MACH (new_flags, old_flags)) { _bfd_error_handler - (_("%B: linking files compiled for HCS12 with " + (_("%pB: linking files compiled for HCS12 with " "others compiled for HC12"), ibfd); ok = FALSE; } @@ -1381,7 +1382,7 @@ _bfd_m68hc11_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses different e_flags (%#x) fields than previous modules (%#x)"), + (_("%pB: uses different e_flags (%#x) fields than previous modules (%#x)"), ibfd, new_flags, old_flags); ok = FALSE; } diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c index 112067b..8680504 100644 --- a/bfd/elf32-m68k.c +++ b/bfd/elf32-m68k.c @@ -341,7 +341,7 @@ static reloc_howto_type howto_table[] = FALSE), /* pcrel_offset */ }; -static void +static bfd_boolean rtype_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int indx = ELF32_R_TYPE (dst->r_info); @@ -349,11 +349,13 @@ rtype_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) if (indx >= (unsigned int) R_68K_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), - abfd, (int) indx); - indx = R_68K_NONE; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, indx); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &howto_table[indx]; + return TRUE; } #define elf_info_to_howto rtype_to_howto @@ -1655,15 +1657,15 @@ elf_m68k_add_entry_to_got (struct elf_m68k_got *got, { if (got->n_slots[R_8] > ELF_M68K_R_8_MAX_N_SLOTS_IN_GOT (info)) /* xgettext:c-format */ - _bfd_error_handler (_("%B: GOT overflow: " - "Number of relocations with 8-bit " + _bfd_error_handler (_("%pB: GOT overflow: " + "number of relocations with 8-bit " "offset > %d"), abfd, ELF_M68K_R_8_MAX_N_SLOTS_IN_GOT (info)); else /* xgettext:c-format */ - _bfd_error_handler (_("%B: GOT overflow: " - "Number of relocations with 8- or 16-bit " + _bfd_error_handler (_("%pB: GOT overflow: " + "number of relocations with 8- or 16-bit " "offset > %d"), abfd, ELF_M68K_R_8_16_MAX_N_SLOTS_IN_GOT (info)); @@ -3698,8 +3700,10 @@ elf_m68k_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s relocation not permitted in shared object"), - input_bfd, input_section, rel->r_offset, howto->name); + (_("%pB(%pA+%#" PRIx64 "): " + "%s relocation not permitted in shared object"), + input_bfd, input_section, (uint64_t) rel->r_offset, + howto->name); return FALSE; } @@ -3892,10 +3896,11 @@ elf_m68k_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); return FALSE; @@ -3928,12 +3933,12 @@ elf_m68k_relocate_section (bfd *output_bfd, _bfd_error_handler ((sym_type == STT_TLS /* xgettext:c-format */ - ? _("%B(%A+%#Lx): %s used with TLS symbol %s") + ? _("%pB(%pA+%#" PRIx64 "): %s used with TLS symbol %s") /* xgettext:c-format */ - : _("%B(%A+%#Lx): %s used with non-TLS symbol %s")), + : _("%pB(%pA+%#" PRIx64 "): %s used with non-TLS symbol %s")), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, name); } @@ -3968,9 +3973,9 @@ elf_m68k_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): reloc against `%s': error %d"), + (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"), input_bfd, input_section, - rel->r_offset, name, (int) r); + (uint64_t) rel->r_offset, name, (int) r); return FALSE; } } @@ -4382,7 +4387,7 @@ bfd_m68k_elf32_create_embedded_relocs (bfd *abfd, struct bfd_link_info *info, /* We can only relocate absolute longword relocs at run time. */ if (ELF32_R_TYPE (irel->r_info) != (int) R_68K_32) { - *errmsg = _("unsupported reloc type"); + *errmsg = _("unsupported relocation type"); bfd_set_error (bfd_error_bad_value); goto error_return; } diff --git a/bfd/elf32-mcore.c b/bfd/elf32-mcore.c index 9334b1d..a88acae 100644 --- a/bfd/elf32-mcore.c +++ b/bfd/elf32-mcore.c @@ -97,10 +97,9 @@ mcore_elf_unsupported_reloc (bfd * abfd, BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0); /* xgettext:c-format */ - _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"), + _bfd_error_handler (_("%pB: %s unsupported"), abfd, - reloc_entry->howto->name, - reloc_entry->howto->type); + reloc_entry->howto->name); return bfd_reloc_notsupported; } @@ -337,8 +336,8 @@ mcore_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for a RCE ELF reloc. */ -static void -mcore_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +mcore_elf_info_to_howto (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -352,13 +351,14 @@ mcore_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= R_MCORE_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised MCore reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_MCORE_NONE; + return FALSE; } cache_ptr->howto = mcore_elf_howto_table [r_type]; + return TRUE; } /* The RELOCATE_SECTION function is called by the ELF backend linker @@ -408,7 +408,7 @@ mcore_elf_relocate_section (bfd * output_bfd, #ifdef DEBUG _bfd_error_handler - ("mcore_elf_relocate_section called for %B section %A, %u relocations%s", + ("mcore_elf_relocate_section called for %pB section %pA, %u relocations%s", input_bfd, input_section, input_section->reloc_count, @@ -437,7 +437,7 @@ mcore_elf_relocate_section (bfd * output_bfd, || ! mcore_elf_howto_table [(int)r_type]) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: Unknown relocation type %d\n"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); @@ -452,10 +452,9 @@ mcore_elf_relocate_section (bfd * output_bfd, if (howto->special_function == mcore_elf_unsupported_reloc) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: Relocation %s (%d) is not currently supported.\n"), + _bfd_error_handler (_("%pB: %s unsupported"), input_bfd, - howto->name, - (int)r_type); + howto->name); bfd_set_error (bfd_error_bad_value); ret = FALSE; diff --git a/bfd/elf32-mep.c b/bfd/elf32-mep.c index d9d457b..5224d9a 100644 --- a/bfd/elf32-mep.c +++ b/bfd/elf32-mep.c @@ -375,11 +375,10 @@ mep_final_link_relocate /* Set the howto pointer for a MEP ELF reloc. */ -static void -mep_info_to_howto_rela - (bfd * abfd ATTRIBUTE_UNUSED, - arelent * cache_ptr, - Elf_Internal_Rela * dst) +static bfd_boolean +mep_info_to_howto_rela (bfd * abfd, + arelent * cache_ptr, + Elf_Internal_Rela * dst) { unsigned int r_type; @@ -387,10 +386,13 @@ mep_info_to_howto_rela if (r_type >= R_MEP_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid MEP reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & mep_elf_howto_table [r_type]; + return TRUE; } /* Relocate a MEP ELF section. @@ -585,7 +587,7 @@ mep_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) old_flags = elf_elfheader (obfd)->e_flags; #ifdef DEBUG - _bfd_error_handler ("%B: old_flags = 0x%.8x, new_flags = 0x%.8x, init = %s", + _bfd_error_handler ("%pB: old_flags = 0x%.8x, new_flags = 0x%.8x, init = %s", ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no"); #endif @@ -617,7 +619,7 @@ mep_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) else { /* xgettext:c-format */ - _bfd_error_handler (_("%B and %B are for different cores"), + _bfd_error_handler (_("%pB and %pB are for different cores"), last_ibfd, ibfd); bfd_set_error (bfd_error_invalid_target); return FALSE; @@ -636,7 +638,7 @@ mep_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) else { /* xgettext:c-format */ - _bfd_error_handler (_("%B and %B are for different configurations"), + _bfd_error_handler (_("%pB and %pB are for different configurations"), last_ibfd, ibfd); bfd_set_error (bfd_error_invalid_target); return FALSE; diff --git a/bfd/elf32-metag.c b/bfd/elf32-metag.c index b985fc0..efe95bd 100644 --- a/bfd/elf32-metag.c +++ b/bfd/elf32-metag.c @@ -864,8 +864,8 @@ tpoff (struct bfd_link_info *info, bfd_vma address) elf_hash_table (info)->tls_sec->alignment_power)); } -static void -metag_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +metag_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -875,10 +875,13 @@ metag_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_METAG_MAX) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid METAG reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & elf_metag_howto_table [r_type]; + return TRUE; } static reloc_howto_type * @@ -1180,7 +1183,7 @@ metag_add_stub (const char *stub_name, if (hsh == NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: cannot create stub entry %s"), + _bfd_error_handler (_("%pB: cannot create stub entry %s"), section->owner, stub_name); return NULL; } @@ -1857,10 +1860,10 @@ elf_metag_relocate_section (bfd *output_bfd, /* We don't support changing the TLS model. */ /* PR 20675 */ if (bfd_link_pic (info)) - _bfd_error_handler (_("%B(%A): multiple TLS models are not supported"), + _bfd_error_handler (_("%pB(%pA): multiple TLS models are not supported"), input_bfd, input_section); else - _bfd_error_handler (_("%B(%A): shared library symbol %s encountered whilst performing a static link"), + _bfd_error_handler (_("%pB(%pA): shared library symbol %s encountered whilst performing a static link"), input_bfd, input_section, name); return FALSE; } @@ -1913,8 +1916,10 @@ elf_metag_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s relocation not permitted in shared object"), - input_bfd, input_section, rel->r_offset, howto->name); + (_("%pB(%pA+%#" PRIx64 "): " + "%s relocation not permitted in shared object"), + input_bfd, input_section, (uint64_t) rel->r_offset, + howto->name); return FALSE; } else @@ -2249,7 +2254,7 @@ elf_metag_check_relocs (bfd *abfd, name = bfd_elf_sym_name (abfd, symtab_hdr, isym, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), + (_("%pB: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"), abfd, elf_metag_howto_table[r_type].name, name); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -2789,7 +2794,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -4141,7 +4146,7 @@ elf_metag_plt_sym_val (bfd_vma i, const asection *plt, #define elf_backend_finish_dynamic_sections elf_metag_finish_dynamic_sections #define elf_backend_size_dynamic_sections elf_metag_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + _bfd_elf_omit_section_dynsym_all #define elf_backend_post_process_headers elf_metag_post_process_headers #define elf_backend_reloc_type_class elf_metag_reloc_type_class #define elf_backend_copy_indirect_symbol elf_metag_copy_indirect_symbol diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index f1808bc..3acf93a 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -638,8 +638,8 @@ microblaze_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for a RCE ELF reloc. */ -static void -microblaze_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +microblaze_elf_info_to_howto (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -653,13 +653,14 @@ microblaze_elf_info_to_howto (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= R_MICROBLAZE_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised MicroBlaze reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_MICROBLAZE_NONE; + return FALSE; } cache_ptr->howto = microblaze_elf_howto_table [r_type]; + return TRUE; } /* Microblaze ELF local labels start with 'L.' or '$L', not '.L'. */ @@ -929,7 +930,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, if (r_type < 0 || r_type >= (int) R_MICROBLAZE_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unknown relocation type %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -1061,8 +1062,8 @@ microblaze_elf_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: The target (%s) of an %s relocation" - " is in the wrong section (%A)"), + (_("%pB: the target (%s) of an %s relocation" + " is in the wrong section (%pA)"), input_bfd, sym_name, microblaze_elf_howto_table[(int) r_type]->name, @@ -1109,8 +1110,8 @@ microblaze_elf_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: The target (%s) of an %s relocation" - " is in the wrong section (%A)"), + (_("%pB: the target (%s) of an %s relocation" + " is in the wrong section (%pA)"), input_bfd, sym_name, microblaze_elf_howto_table[(int) r_type]->name, @@ -1479,7 +1480,7 @@ microblaze_elf_relocate_section (bfd *output_bfd, { BFD_FAIL (); _bfd_error_handler - (_("%B: probably compiled without -fPIC?"), + (_("%pB: probably compiled without -fPIC?"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; diff --git a/bfd/elf32-mips.c b/bfd/elf32-mips.c index fa0cc15..d6005ff 100644 --- a/bfd/elf32-mips.c +++ b/bfd/elf32-mips.c @@ -57,11 +57,9 @@ static bfd_reloc_status_type mips32_64bit_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static reloc_howto_type *mips_elf32_rtype_to_howto - (unsigned int, bfd_boolean); -static void mips_info_to_howto_rel +static bfd_boolean mips_info_to_howto_rel (bfd *, arelent *, Elf_Internal_Rela *); -static void mips_info_to_howto_rela +static bfd_boolean mips_info_to_howto_rela (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean mips_elf_sym_is_global (bfd *, asymbol *); @@ -2196,7 +2194,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * -mips_elf32_rtype_to_howto (unsigned int r_type, +mips_elf32_rtype_to_howto (bfd *abfd, + unsigned int r_type, bfd_boolean rela_p ATTRIBUTE_UNUSED) { switch (r_type) @@ -2222,9 +2221,10 @@ mips_elf32_rtype_to_howto (unsigned int r_type, return &elf_mips16_howto_table_rel[r_type - R_MIPS16_min]; if (r_type >= (unsigned int) R_MIPS_max) { - _bfd_error_handler (_("Unrecognised MIPS reloc number: %d"), r_type); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_MIPS_NONE; + return NULL; } return &elf_mips_howto_table_rel[r_type]; } @@ -2232,7 +2232,7 @@ mips_elf32_rtype_to_howto (unsigned int r_type, /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ -static void +static bfd_boolean mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { const struct elf_backend_data *bed; @@ -2240,7 +2240,14 @@ mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) r_type = ELF32_R_TYPE (dst->r_info); bed = get_elf_backend_data (abfd); - cache_ptr->howto = bed->elf_backend_mips_rtype_to_howto (r_type, FALSE); + cache_ptr->howto = bed->elf_backend_mips_rtype_to_howto (abfd, r_type, FALSE); + if (cache_ptr->howto == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } /* The addend for a GPREL16 or LITERAL relocation comes from the GP value for the object file. We get the addend now, rather than @@ -2249,14 +2256,16 @@ mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0 && (gprel16_reloc_p (r_type) || literal_reloc_p (r_type))) cache_ptr->addend = elf_gp (abfd); + + return TRUE; } /* Given a MIPS Elf_Internal_Rela, fill in an arelent structure. */ -static void +static bfd_boolean mips_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { - mips_info_to_howto_rel (abfd, cache_ptr, dst); + return mips_info_to_howto_rel (abfd, cache_ptr, dst); /* If we ever need to do any extra processing with dst->r_addend (the field omitted in an Elf_Internal_Rel) we can do it here. */ diff --git a/bfd/elf32-moxie.c b/bfd/elf32-moxie.c index 8c7a378..d8b549d 100644 --- a/bfd/elf32-moxie.c +++ b/bfd/elf32-moxie.c @@ -123,8 +123,8 @@ moxie_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for an MOXIE ELF reloc. */ -static void -moxie_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +moxie_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -134,10 +134,13 @@ moxie_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_MOXIE_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid Moxie reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & moxie_elf_howto_table [r_type]; + return TRUE; } /* Perform a single relocation. By default we use the standard BFD diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c index 5ee32c4..2d351d3 100644 --- a/bfd/elf32-msp430.c +++ b/bfd/elf32-msp430.c @@ -631,8 +631,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an MSP430 ELF reloc. */ -static void -msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +msp430_info_to_howto_rela (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -645,20 +645,25 @@ msp430_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_MSP430x_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid MSP430X reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = elf_msp430x_howto_table + r_type; - return; } - - if (r_type >= (unsigned int) R_MSP430_max) + else if (r_type >= (unsigned int) R_MSP430_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid MSP430 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } - cache_ptr->howto = &elf_msp430_howto_table[r_type]; + else + cache_ptr->howto = &elf_msp430_howto_table[r_type]; + + return TRUE; } /* Look through the relocs for a section during the first phase. @@ -829,7 +834,7 @@ msp430_final_link_relocate (reloc_howto_type * howto, { info->callbacks->warning (info, - _("Try enabling relaxation to avoid relocation truncations"), + _("try enabling relaxation to avoid relocation truncations"), NULL, input_bfd, input_section, relocation); warned = TRUE; } @@ -1143,7 +1148,7 @@ msp430_final_link_relocate (reloc_howto_type * howto, { info->callbacks->warning (info, - _("Try enabling relaxation to avoid relocation truncations"), + _("try enabling relaxation to avoid relocation truncations"), NULL, input_bfd, input_section, relocation); warned = TRUE; } @@ -2349,7 +2354,7 @@ elf32_msp430_obj_attrs_handle_unknown (bfd *abfd, int tag) { _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B: Unknown MSPABI object attribute %d"), + (_("warning: %pB: unknown MSPABI object attribute %d"), abfd, tag); return TRUE; } @@ -2442,7 +2447,7 @@ elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B uses %s instructions but %B uses %s"), + (_("error: %pB uses %s instructions but %pB uses %s"), ibfd, isa_type (in_attr[OFBA_MSPABI_Tag_ISA].i), first_input_bfd, isa_type (out_attr[OFBA_MSPABI_Tag_ISA].i)); result = FALSE; @@ -2454,7 +2459,7 @@ elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B uses the %s code model whereas %B uses the %s code model"), + (_("error: %pB uses the %s code model whereas %pB uses the %s code model"), ibfd, code_model (in_attr[OFBA_MSPABI_Tag_Code_Model].i), first_input_bfd, code_model (out_attr[OFBA_MSPABI_Tag_Code_Model].i)); result = FALSE; @@ -2466,7 +2471,7 @@ elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B uses the large code model but %B uses MSP430 instructions"), + (_("error: %pB uses the large code model but %pB uses MSP430 instructions"), ibfd, first_input_bfd); result = FALSE; } @@ -2477,7 +2482,7 @@ elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B uses the %s data model whereas %B uses the %s data model"), + (_("error: %pB uses the %s data model whereas %pB uses the %s data model"), ibfd, data_model (in_attr[OFBA_MSPABI_Tag_Data_Model].i), first_input_bfd, data_model (out_attr[OFBA_MSPABI_Tag_Data_Model].i)); result = FALSE; @@ -2489,7 +2494,7 @@ elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B uses the small code model but %B uses the %s data model"), + (_("error: %pB uses the small code model but %pB uses the %s data model"), ibfd, first_input_bfd, data_model (out_attr[OFBA_MSPABI_Tag_Data_Model].i)); result = FALSE; @@ -2501,7 +2506,7 @@ elf32_msp430_merge_mspabi_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B uses the %s data model but %B only uses MSP430 instructions"), + (_("error: %pB uses the %s data model but %pB only uses MSP430 instructions"), ibfd, data_model (in_attr[OFBA_MSPABI_Tag_Data_Model].i), first_input_bfd); result = FALSE; diff --git a/bfd/elf32-mt.c b/bfd/elf32-mt.c index b58394f..94c2fac 100644 --- a/bfd/elf32-mt.c +++ b/bfd/elf32-mt.c @@ -28,7 +28,7 @@ static reloc_howto_type * mt_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static void mt_info_to_howto_rela +static bfd_boolean mt_info_to_howto_rela (bfd *, arelent *, Elf_Internal_Rela *); static bfd_reloc_status_type mt_elf_relocate_hi16 @@ -227,11 +227,10 @@ mt_elf_relocate_hi16 /* Set the howto pointer for a MT ELF reloc. */ -static void -mt_info_to_howto_rela - (bfd * abfd ATTRIBUTE_UNUSED, - arelent * cache_ptr, - Elf_Internal_Rela * dst) +static bfd_boolean +mt_info_to_howto_rela (bfd * abfd, + arelent * cache_ptr, + Elf_Internal_Rela * dst) { unsigned int r_type; @@ -239,10 +238,13 @@ mt_info_to_howto_rela if (r_type >= (unsigned int) R_MT_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid MT reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & mt_elf_howto_table [r_type]; + return TRUE; } /* Perform a single relocation. By default we use the standard BFD @@ -520,7 +522,7 @@ mt_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) old_flags = elf_elfheader (obfd)->e_flags; #ifdef DEBUG - _bfd_error_handler ("%B: old_flags = 0x%.8x, new_flags = 0x%.8x, init = %s", + _bfd_error_handler ("%pB: old_flags = 0x%.8x, new_flags = 0x%.8x, init = %s", ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no"); #endif diff --git a/bfd/elf32-nds32.c b/bfd/elf32-nds32.c index 5ceb0a0..fad1379 100644 --- a/bfd/elf32-nds32.c +++ b/bfd/elf32-nds32.c @@ -20,6 +20,8 @@ 02110-1301, USA. */ +#pragma GCC diagnostic ignored "-Wstack-usage=" + #include "sysdep.h" #include "bfd.h" #include "bfd_stdint.h" @@ -33,6 +35,7 @@ #include "elf32-nds32.h" #include "opcode/cgen.h" #include "../opcodes/nds32-opc.h" +#include /* Relocation HOWTO functions. */ static bfd_reloc_status_type nds32_elf_ignore_reloc @@ -56,36 +59,72 @@ static bfd_reloc_status_type nds32_elf_sda15_reloc static bfd_reloc_status_type nds32_elf_do_9_pcrel_reloc (bfd *, reloc_howto_type *, asection *, bfd_byte *, bfd_vma, asection *, bfd_vma, bfd_vma); +static void nds32_elf_relocate_hi20 + (bfd *, int, Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_byte *, bfd_vma); +static reloc_howto_type *bfd_elf32_bfd_reloc_type_table_lookup + (enum elf_nds32_reloc_type); +static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup + (bfd *, bfd_reloc_code_real_type); + +/* Target hooks. */ +static bfd_boolean nds32_info_to_howto_rel + (bfd *, arelent *, Elf_Internal_Rela *); +static bfd_boolean nds32_info_to_howto + (bfd *, arelent *, Elf_Internal_Rela *); +static bfd_boolean nds32_elf_add_symbol_hook + (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, + flagword *, asection **, bfd_vma *); +static bfd_boolean nds32_elf_relocate_section + (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); +static bfd_boolean nds32_elf_object_p (bfd *); +static void nds32_elf_final_write_processing (bfd *, bfd_boolean); +static bfd_boolean nds32_elf_set_private_flags (bfd *, flagword); +static bfd_boolean nds32_elf_merge_private_bfd_data (bfd *, struct bfd_link_info *); +static bfd_boolean nds32_elf_print_private_bfd_data (bfd *, void *); +static bfd_boolean nds32_elf_check_relocs + (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); +static asection *nds32_elf_gc_mark_hook + (asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *); +static bfd_boolean nds32_elf_adjust_dynamic_symbol + (struct bfd_link_info *, struct elf_link_hash_entry *); +static bfd_boolean nds32_elf_size_dynamic_sections + (bfd *, struct bfd_link_info *); +static bfd_boolean nds32_elf_create_dynamic_sections + (bfd *, struct bfd_link_info *); +static bfd_boolean nds32_elf_finish_dynamic_sections + (bfd *, struct bfd_link_info *info); +static bfd_boolean nds32_elf_finish_dynamic_symbol + (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *); +static bfd_boolean nds32_elf_mkobject (bfd *); /* Nds32 helper functions. */ +static bfd_reloc_status_type nds32_elf_final_sda_base + (bfd *, struct bfd_link_info *, bfd_vma *, bfd_boolean); +static bfd_boolean allocate_dynrelocs (struct elf_link_hash_entry *, void *); +static bfd_boolean readonly_dynrelocs (struct elf_link_hash_entry *, void *); +static Elf_Internal_Rela *find_relocs_at_address + (Elf_Internal_Rela *, Elf_Internal_Rela *, + Elf_Internal_Rela *, enum elf_nds32_reloc_type); static bfd_vma calculate_memory_address -(bfd *, Elf_Internal_Rela *, Elf_Internal_Sym *, Elf_Internal_Shdr *); + (bfd *, Elf_Internal_Rela *, Elf_Internal_Sym *, Elf_Internal_Shdr *); static int nds32_get_section_contents (bfd *, asection *, bfd_byte **, bfd_boolean); -static bfd_boolean nds32_elf_ex9_build_hash_table -(bfd *, asection *, struct bfd_link_info *); -static bfd_boolean nds32_elf_ex9_itb_base (struct bfd_link_info *); -static void nds32_elf_ex9_import_table (struct bfd_link_info *); -static void nds32_elf_ex9_finish (struct bfd_link_info *); -static void nds32_elf_ex9_reloc_jmp (struct bfd_link_info *); -static void nds32_elf_get_insn_with_reg - (Elf_Internal_Rela *, uint32_t, uint32_t *); static int nds32_get_local_syms (bfd *, asection *ATTRIBUTE_UNUSED, Elf_Internal_Sym **); -static bfd_boolean nds32_elf_ex9_replace_instruction - (struct bfd_link_info *, bfd *, asection *); -static bfd_boolean nds32_elf_ifc_calc (struct bfd_link_info *, bfd *, - asection *); -static bfd_boolean nds32_elf_ifc_finish (struct bfd_link_info *); -static bfd_boolean nds32_elf_ifc_replace (struct bfd_link_info *); -static bfd_boolean nds32_elf_ifc_reloc (void); -static bfd_boolean nds32_relax_fp_as_gp - (struct bfd_link_info *link_info, bfd *abfd, asection *sec, - Elf_Internal_Rela *internal_relocs, Elf_Internal_Rela *irelend, - Elf_Internal_Sym *isymbuf); +static bfd_boolean nds32_relax_fp_as_gp + (struct bfd_link_info *, bfd *, asection *, Elf_Internal_Rela *, + Elf_Internal_Rela *, Elf_Internal_Sym *); static bfd_boolean nds32_fag_remove_unused_fpbase - (bfd *abfd, asection *sec, Elf_Internal_Rela *internal_relocs, - Elf_Internal_Rela *irelend); + (bfd *, asection *, Elf_Internal_Rela *, Elf_Internal_Rela *); +static bfd_byte *nds32_elf_get_relocated_section_contents + (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, + bfd_boolean, asymbol **); +static void nds32_elf_ict_hash_init (void); +static void nds32_elf_ict_relocate (bfd *, struct bfd_link_info *); +static asection* nds32_elf_get_target_section (struct bfd_link_info *, char *); enum { @@ -95,13 +134,24 @@ enum MACH_V3M = bfd_mach_n1h_v3m }; +/* If ABI is set by the option --mabi, without + checking the ABI compatible. */ +static char *output_abi; + #define MIN(a, b) ((a) > (b) ? (b) : (a)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) +/* True if insn is 4byte. */ +#define INSN_32BIT(insn) ((((insn) & 0x80000000) == 0 ? (TRUE) : (FALSE))) + /* The name of the dynamic interpreter. This is put in the .interp section. */ #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" +#define NDS32_GUARD_SEC_P(flags) ((flags) & SEC_ALLOC \ + && (flags) & SEC_LOAD \ + && (flags) & SEC_READONLY) + /* The nop opcode we use. */ #define NDS32_NOP32 0x40000009 #define NDS32_NOP16 0x9200 @@ -113,32 +163,32 @@ enum /* The first entry in a procedure linkage table are reserved, and the initial contents are unimportant (we zero them out). Subsequent entries look like this. */ -#define PLT0_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(.got+4) */ -#define PLT0_ENTRY_WORD1 0x58f78000 /* ori r15, r25, LO12(.got+4) */ -#define PLT0_ENTRY_WORD2 0x05178000 /* lwi r17, [r15+0] */ -#define PLT0_ENTRY_WORD3 0x04f78001 /* lwi r15, [r15+4] */ -#define PLT0_ENTRY_WORD4 0x4a003c00 /* jr r15 */ +#define PLT0_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(.got+4) */ +#define PLT0_ENTRY_WORD1 0x58f78000 /* ori r15, r25, LO12(.got+4) */ +#define PLT0_ENTRY_WORD2 0x05178000 /* lwi r17, [r15+0] */ +#define PLT0_ENTRY_WORD3 0x04f78001 /* lwi r15, [r15+4] */ +#define PLT0_ENTRY_WORD4 0x4a003c00 /* jr r15 */ /* $ta is change to $r15 (from $r25). */ #define PLT0_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[1]@GOT) */ -#define PLT0_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[1]@GOT) */ -#define PLT0_PIC_ENTRY_WORD2 0x40f7f400 /* add r15, gp, r15 */ -#define PLT0_PIC_ENTRY_WORD3 0x05178000 /* lwi r17, [r15+0] */ -#define PLT0_PIC_ENTRY_WORD4 0x04f78001 /* lwi r15, [r15+4] */ -#define PLT0_PIC_ENTRY_WORD5 0x4a003c00 /* jr r15 */ - -#define PLT_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(&got[n+3]) */ -#define PLT_ENTRY_WORD1 0x04f78000 /* lwi r15, r15, LO12(&got[n+3]) */ -#define PLT_ENTRY_WORD2 0x4a003c00 /* jr r15 */ -#define PLT_ENTRY_WORD3 0x45000000 /* movi r16, sizeof(RELA) * n */ -#define PLT_ENTRY_WORD4 0x48000000 /* j .plt0. */ - -#define PLT_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[n+3]@GOT) */ -#define PLT_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[n+3]@GOT) */ -#define PLT_PIC_ENTRY_WORD2 0x38febc02 /* lw r15, [gp+r15] */ -#define PLT_PIC_ENTRY_WORD3 0x4a003c00 /* jr r15 */ -#define PLT_PIC_ENTRY_WORD4 0x45000000 /* movi r16, sizeof(RELA) * n */ -#define PLT_PIC_ENTRY_WORD5 0x48000000 /* j .plt0 */ +#define PLT0_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[1]@GOT) */ +#define PLT0_PIC_ENTRY_WORD2 0x40f7f400 /* add r15, gp, r15 */ +#define PLT0_PIC_ENTRY_WORD3 0x05178000 /* lwi r17, [r15+0] */ +#define PLT0_PIC_ENTRY_WORD4 0x04f78001 /* lwi r15, [r15+4] */ +#define PLT0_PIC_ENTRY_WORD5 0x4a003c00 /* jr r15 */ + +#define PLT_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(&got[n+3]) */ +#define PLT_ENTRY_WORD1 0x04f78000 /* lwi r15, r15, LO12(&got[n+3]) */ +#define PLT_ENTRY_WORD2 0x4a003c00 /* jr r15 */ +#define PLT_ENTRY_WORD3 0x45000000 /* movi r16, sizeof(RELA) * n */ +#define PLT_ENTRY_WORD4 0x48000000 /* j .plt0 */ + +#define PLT_PIC_ENTRY_WORD0 0x46f00000 /* sethi r15, HI20(got[n+3]@GOT) */ +#define PLT_PIC_ENTRY_WORD1 0x58f78000 /* ori r15, r15, LO12(got[n+3]@GOT) */ +#define PLT_PIC_ENTRY_WORD2 0x38febc02 /* lw r15, [gp+r15] */ +#define PLT_PIC_ENTRY_WORD3 0x4a003c00 /* jr r15 */ +#define PLT_PIC_ENTRY_WORD4 0x45000000 /* movi r16, sizeof(RELA) * n */ +#define PLT_PIC_ENTRY_WORD5 0x48000000 /* j .plt0 */ /* These are macros used to get the relocation accurate value. */ #define ACCURATE_8BIT_S1 (0x100) @@ -160,10 +210,11 @@ enum #define CONSERVATIVE_19BIT (0x40000 - 0x1000) #define CONSERVATIVE_20BIT (0x80000 - 0x1000) +#define NDS32_ICT_SECTION ".nds32.ict" + /* Size of small data/bss sections, used to calculate SDA_BASE. */ static long got_size = 0; static int is_SDA_BASE_set = 0; -static int is_ITB_BASE_set = 0; /* Convert ELF-VER in eflags to string for debugging purpose. */ static const char *const nds32_elfver_strtab[] = @@ -192,37 +243,108 @@ struct elf_nds32_pcrel_relocs_copied bfd_size_type count; }; +/* The sh linker needs to keep track of the number of relocs that it + decides to copy as dynamic relocs in check_relocs for each symbol. + This is so that it can later discard them if they are found to be + unnecessary. We store the information in a field extending the + regular ELF linker hash table. */ + +struct elf_nds32_dyn_relocs +{ + struct elf_nds32_dyn_relocs *next; + + /* The input section of the reloc. */ + asection *sec; + + /* Total number of relocs copied for the input section. */ + bfd_size_type count; + + /* Number of pc-relative relocs copied for the input section. */ + bfd_size_type pc_count; +}; + /* Nds32 ELF linker hash entry. */ +enum elf_nds32_tls_type +{ + GOT_UNKNOWN = (0), + GOT_NORMAL = (1 << 0), + GOT_TLS_LE = (1 << 1), + GOT_TLS_IE = (1 << 2), + GOT_TLS_IEGP = (1 << 3), + GOT_TLS_LD = (1 << 4), + GOT_TLS_GD = (1 << 5), + GOT_TLS_DESC = (1 << 6), +}; + struct elf_nds32_link_hash_entry { struct elf_link_hash_entry root; /* Track dynamic relocs copied for this symbol. */ - struct elf_dyn_relocs *dyn_relocs; + struct elf_nds32_dyn_relocs *dyn_relocs; /* For checking relocation type. */ -#define GOT_UNKNOWN 0 -#define GOT_NORMAL 1 -#define GOT_TLS_IE 2 - unsigned int tls_type; + enum elf_nds32_tls_type tls_type; + + int offset_to_gp; + + /* For saving function attribute indirect_call and entry address. */ + bfd_boolean indirect_call; }; /* Get the nds32 ELF linker hash table from a link_info structure. */ #define FP_BASE_NAME "_FP_BASE_" static int check_start_export_sym = 0; -static size_t ex9_relax_size = 0; /* Save ex9 predicted reducing size. */ +/* File for exporting indirect call table. */ +static FILE *ict_file = NULL; +/* Save object ict model. */ +static unsigned int ict_model = 0; +/* True if _INDIRECT_CALL_TABLE_BASE_ is defined. */ +static bfd_boolean ignore_indirect_call = FALSE; +/* Be used to set ifc bit in elf header. */ +static bfd_boolean ifc_flag = FALSE; + +/* Rom-patch symbol hash table. */ +struct elf_nds32_ict_hash_entry +{ + struct bfd_hash_entry root; + struct elf_link_hash_entry *h; + unsigned int order; +}; + +/* Rom-patch hash table. */ +static struct bfd_hash_table indirect_call_table; /* The offset for executable tls relaxation. */ #define TP_OFFSET 0x0 +typedef struct +{ + int min_id; + int max_id; + int count; + int bias; + int init; +} elf32_nds32_relax_group_t; + struct elf_nds32_obj_tdata { struct elf_obj_tdata root; /* tls_type for each local got entry. */ char *local_got_tls_type; + + unsigned int hdr_size; + + /* GOTPLT entries for TLS descriptors. */ + bfd_vma *local_tlsdesc_gotent; + + int* offset_to_gp; + + /* for R_NDS32_RELAX_GROUP handling. */ + elf32_nds32_relax_group_t relax_group; }; #define elf_nds32_tdata(bfd) \ @@ -231,6 +353,12 @@ struct elf_nds32_obj_tdata #define elf32_nds32_local_got_tls_type(bfd) \ (elf_nds32_tdata (bfd)->local_got_tls_type) +#define elf32_nds32_local_gp_offset(bfd) \ + (elf_nds32_tdata (bfd)->offset_to_gp) + +#define elf32_nds32_relax_group_ptr(bfd) \ + &(elf_nds32_tdata (bfd)->relax_group) + #define elf32_nds32_hash_entry(ent) ((struct elf_nds32_link_hash_entry *)(ent)) static bfd_boolean @@ -240,68 +368,75 @@ nds32_elf_mkobject (bfd *abfd) NDS32_ELF_DATA); } + /* Relocations used for relocation. */ -static reloc_howto_type nds32_elf_howto_table[] = -{ +/* NOTE! + the index order must be the same with elf_nds32_reloc_type in + include/elf/nds32.h + */ +#define HOWTO2(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ + [C] = HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) + +static reloc_howto_type nds32_elf_howto_table[] = { /* This reloc does nothing. */ - HOWTO (R_NDS32_NONE, /* type */ - 0, /* rightshift */ - 3, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_NONE", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_NONE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_NONE", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ /* A 16 bit absolute relocation. */ - HOWTO (R_NDS32_16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - nds32_elf_generic_reloc, /* special_function */ - "R_NDS32_16", /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + nds32_elf_generic_reloc,/* special_function */ + "R_NDS32_16", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* A 32 bit absolute relocation. */ - HOWTO (R_NDS32_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - nds32_elf_generic_reloc, /* special_function */ - "R_NDS32_32", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + nds32_elf_generic_reloc,/* special_function */ + "R_NDS32_32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* A 20 bit address. */ - HOWTO (R_NDS32_20, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - nds32_elf_generic_reloc, /* special_function */ - "R_NDS32_20", /* name */ - FALSE, /* partial_inplace */ - 0xfffff, /* src_mask */ - 0xfffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + nds32_elf_generic_reloc,/* special_function */ + "R_NDS32_20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* An PC Relative 9-bit relocation, shifted by 2. This reloc is complicated because relocations are relative to pc & -4. @@ -311,1910 +446,2264 @@ static reloc_howto_type nds32_elf_howto_table[] = Branch relaxing in the assembler can store the addend in the insn, and if bfd_install_relocation gets called the addend may get added again. */ - HOWTO (R_NDS32_9_PCREL, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - nds32_elf_9_pcrel_reloc, /* special_function */ - "R_NDS32_9_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_9_PCREL, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_9_pcrel_reloc,/* special_function */ + "R_NDS32_9_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* A relative 15 bit relocation, right shifted by 1. */ - HOWTO (R_NDS32_15_PCREL, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 14, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_15_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0x3fff, /* src_mask */ - 0x3fff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_15_PCREL, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 14, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_15_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0x3fff, /* src_mask */ + 0x3fff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* A relative 17 bit relocation, right shifted by 1. */ - HOWTO (R_NDS32_17_PCREL, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_17_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_17_PCREL, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_17_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* A relative 25 bit relocation, right shifted by 1. */ /* ??? It's not clear whether this should have partial_inplace set or not. Branch relaxing in the assembler can store the addend in the insn, and if bfd_install_relocation gets called the addend may get added again. */ - HOWTO (R_NDS32_25_PCREL, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 24, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_25_PCREL", /* name */ - FALSE, /* partial_inplace */ - 0xffffff, /* src_mask */ - 0xffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_25_PCREL, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_25_PCREL", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* High 20 bits of address when lower 12 is or'd in. */ - HOWTO (R_NDS32_HI20, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_hi20_reloc, /* special_function */ - "R_NDS32_HI20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_hi20_reloc, /* special_function */ + "R_NDS32_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S3, /* type */ - 3, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 9, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_lo12_reloc, /* special_function */ - "R_NDS32_LO12S3", /* name */ - FALSE, /* partial_inplace */ - 0x000001ff, /* src_mask */ - 0x000001ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_LO12S3", /* name */ + FALSE, /* partial_inplace */ + 0x000001ff, /* src_mask */ + 0x000001ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S2, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_lo12_reloc, /* special_function */ - "R_NDS32_LO12S2", /* name */ - FALSE, /* partial_inplace */ - 0x000003ff, /* src_mask */ - 0x000003ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_LO12S2", /* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S1, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 11, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_lo12_reloc, /* special_function */ - "R_NDS32_LO12S1", /* name */ - FALSE, /* partial_inplace */ - 0x000007ff, /* src_mask */ - 0x000007ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S1, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_LO12S1", /* name */ + FALSE, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S0, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_lo12_reloc, /* special_function */ - "R_NDS32_LO12S0", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_LO12S0", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 15 bits offset. */ - HOWTO (R_NDS32_SDA15S3, /* type */ - 3, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - nds32_elf_sda15_reloc, /* special_function */ - "R_NDS32_SDA15S3", /* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA15S3, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_sda15_reloc, /* special_function */ + "R_NDS32_SDA15S3", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 15 bits offset. */ - HOWTO (R_NDS32_SDA15S2, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - nds32_elf_sda15_reloc, /* special_function */ - "R_NDS32_SDA15S2", /* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA15S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_sda15_reloc, /* special_function */ + "R_NDS32_SDA15S2", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 15 bits offset. */ - HOWTO (R_NDS32_SDA15S1, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - nds32_elf_sda15_reloc, /* special_function */ - "R_NDS32_SDA15S1", /* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA15S1, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_sda15_reloc, /* special_function */ + "R_NDS32_SDA15S1", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 15 bits offset. */ - HOWTO (R_NDS32_SDA15S0, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - nds32_elf_sda15_reloc, /* special_function */ - "R_NDS32_SDA15S0", /* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_NDS32_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - NULL, /* special_function */ - "R_NDS32_GNU_VTINHERIT", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_NDS32_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_NDS32_GNU_VTENTRY", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA15S0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + nds32_elf_sda15_reloc, /* special_function */ + "R_NDS32_SDA15S0", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO2 (R_NDS32_GNU_VTINHERIT,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + NULL, /* special_function */ + "R_NDS32_GNU_VTINHERIT",/* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO2 (R_NDS32_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn,/* special_function */ + "R_NDS32_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ /* A 16 bit absolute relocation. */ - HOWTO (R_NDS32_16_RELA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_16_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_16_RELA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_16_RELA", /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* A 32 bit absolute relocation. */ - HOWTO (R_NDS32_32_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_32_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_32_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_32_RELA", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* A 20 bit address. */ - HOWTO (R_NDS32_20_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_20_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xfffff, /* src_mask */ - 0xfffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_NDS32_9_PCREL_RELA, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_9_PCREL_RELA",/* name */ - FALSE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_20_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_20_RELA", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_9_PCREL_RELA, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_9_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* A relative 15 bit relocation, right shifted by 1. */ - HOWTO (R_NDS32_15_PCREL_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 14, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_15_PCREL_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x3fff, /* src_mask */ - 0x3fff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_15_PCREL_RELA,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 14, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_15_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x3fff, /* src_mask */ + 0x3fff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* A relative 17 bit relocation, right shifted by 1. */ - HOWTO (R_NDS32_17_PCREL_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_17_PCREL_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_17_PCREL_RELA,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_17_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* A relative 25 bit relocation, right shifted by 2. */ - HOWTO (R_NDS32_25_PCREL_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 24, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_25_PCREL_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffffff, /* src_mask */ - 0xffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_25_PCREL_RELA,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_25_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* High 20 bits of address when lower 16 is or'd in. */ - HOWTO (R_NDS32_HI20_RELA, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_HI20_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_HI20_RELA, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_HI20_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S3_RELA, /* type */ - 3, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 9, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_LO12S3_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x000001ff, /* src_mask */ - 0x000001ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S3_RELA, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S3_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x000001ff, /* src_mask */ + 0x000001ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S2_RELA, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_LO12S2_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x000003ff, /* src_mask */ - 0x000003ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S2_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S1_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 11, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_LO12S1_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x000007ff, /* src_mask */ - 0x000007ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S1_RELA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 11, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S1_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x000007ff, /* src_mask */ + 0x000007ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S0_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_LO12S0_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S0_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S0_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 15 bits offset. */ - HOWTO (R_NDS32_SDA15S3_RELA, /* type */ - 3, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA15S3_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA15S3_RELA, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA15S3_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 15 bits offset. */ - HOWTO (R_NDS32_SDA15S2_RELA, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA15S2_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_NDS32_SDA15S1_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA15S1_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_NDS32_SDA15S0_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA15S0_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_NDS32_RELA_GNU_VTINHERIT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - NULL, /* special_function */ - "R_NDS32_RELA_GNU_VTINHERIT", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_NDS32_RELA_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - _bfd_elf_rel_vtable_reloc_fn, /* special_function */ - "R_NDS32_RELA_GNU_VTENTRY", /* name */ - FALSE, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA15S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA15S2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_SDA15S1_RELA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA15S1_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_SDA15S0_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA15S0_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO2 (R_NDS32_RELA_GNU_VTINHERIT,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + NULL, /* special_function */ + "R_NDS32_RELA_GNU_VTINHERIT",/* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage */ + HOWTO2 (R_NDS32_RELA_GNU_VTENTRY,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + _bfd_elf_rel_vtable_reloc_fn,/* special_function */ + "R_NDS32_RELA_GNU_VTENTRY",/* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Like R_NDS32_20, but referring to the GOT table entry for the symbol. */ - HOWTO (R_NDS32_GOT20, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOT20", /* name */ - FALSE, /* partial_inplace */ - 0xfffff, /* src_mask */ - 0xfffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Like R_NDS32_PCREL, but referring to the procedure linkage table entry for the symbol. */ - HOWTO (R_NDS32_25_PLTREL, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 24, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_25_PLTREL", /* name */ - FALSE, /* partial_inplace */ - 0xffffff, /* src_mask */ - 0xffffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_25_PLTREL, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_25_PLTREL", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* This is used only by the dynamic linker. The symbol should exist both in the object being run and in some shared library. The dynamic linker copies the data addressed by the symbol from the shared library into the object, because the object being run has to have the data at some particular address. */ - HOWTO (R_NDS32_COPY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_COPY", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_COPY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_COPY", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Like R_NDS32_20, but used when setting global offset table entries. */ - HOWTO (R_NDS32_GLOB_DAT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GLOB_DAT", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GLOB_DAT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GLOB_DAT", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Marks a procedure linkage table entry for a symbol. */ - HOWTO (R_NDS32_JMP_SLOT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_JMP_SLOT", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_JMP_SLOT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_JMP_SLOT", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Used only by the dynamic linker. When the object is run, this longword is set to the load address of the object, plus the addend. */ - HOWTO (R_NDS32_RELATIVE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_RELATIVE", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_NDS32_GOTOFF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOTOFF", /* name */ - FALSE, /* partial_inplace */ - 0xfffff, /* src_mask */ - 0xfffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_RELATIVE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_RELATIVE", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_GOTOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* An PC Relative 20-bit relocation used when setting PIC offset table register. */ - HOWTO (R_NDS32_GOTPC20, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOTPC20", /* name */ - FALSE, /* partial_inplace */ - 0xfffff, /* src_mask */ - 0xfffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTPC20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTPC20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* Like R_NDS32_HI20, but referring to the GOT table entry for the symbol. */ - HOWTO (R_NDS32_GOT_HI20, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOT_HI20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_GOT_LO12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOT_LO12", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* An PC Relative relocation used when setting PIC offset table register. Like R_NDS32_HI20, but referring to the GOT table entry for the symbol. */ - HOWTO (R_NDS32_GOTPC_HI20, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOTPC_HI20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - TRUE), /* pcrel_offset */ - HOWTO (R_NDS32_GOTPC_LO12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOTPC_LO12", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - HOWTO (R_NDS32_GOTOFF_HI20, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOTOFF_HI20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_GOTOFF_LO12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOTOFF_LO12", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTPC_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTPC_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTPC_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTPC_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_GOTOFF_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTOFF_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Alignment hint for relaxable instruction. This is used with R_NDS32_LABEL as a pair. Relax this instruction from 4 bytes to 2 in order to make next label aligned on word boundary. */ - HOWTO (R_NDS32_INSN16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_INSN16", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_INSN16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_INSN16", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Alignment hint for label. */ - HOWTO (R_NDS32_LABEL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_LABEL", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LABEL, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LABEL", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for unconditional call sequence */ - HOWTO (R_NDS32_LONGCALL1, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_LONGCALL1", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGCALL1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional call sequence. */ - HOWTO (R_NDS32_LONGCALL2, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_LONGCALL2", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGCALL2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional call sequence. */ - HOWTO (R_NDS32_LONGCALL3, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_LONGCALL3", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGCALL3, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL3", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for unconditional branch sequence. */ - HOWTO (R_NDS32_LONGJUMP1, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_LONGJUMP1", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGJUMP1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP1", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional branch sequence. */ - HOWTO (R_NDS32_LONGJUMP2, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_LONGJUMP2", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGJUMP2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP2", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional branch sequence. */ - HOWTO (R_NDS32_LONGJUMP3, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_LONGJUMP3", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGJUMP3, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP3", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for load/store sequence. */ - HOWTO (R_NDS32_LOADSTORE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_LOADSTORE", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LOADSTORE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LOADSTORE", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for load/store sequence. */ - HOWTO (R_NDS32_9_FIXED_RELA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_9_FIXED_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_9_FIXED_RELA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_9_FIXED_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for load/store sequence. */ - HOWTO (R_NDS32_15_FIXED_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_15_FIXED_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x00003fff, /* src_mask */ - 0x00003fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_15_FIXED_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_15_FIXED_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00003fff, /* src_mask */ + 0x00003fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for load/store sequence. */ - HOWTO (R_NDS32_17_FIXED_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_17_FIXED_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_17_FIXED_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_17_FIXED_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for load/store sequence. */ - HOWTO (R_NDS32_25_FIXED_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_25_FIXED_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_25_FIXED_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_25_FIXED_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* High 20 bits of PLT symbol offset relative to PC. */ - HOWTO (R_NDS32_PLTREL_HI20, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_PLTREL_HI20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_PLTREL_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLTREL_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Low 12 bits of PLT symbol offset relative to PC. */ - HOWTO (R_NDS32_PLTREL_LO12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_PLTREL_LO12", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_PLTREL_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLTREL_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* High 20 bits of PLT symbol offset relative to GOT (GP). */ - HOWTO (R_NDS32_PLT_GOTREL_HI20, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_PLT_GOTREL_HI20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_PLT_GOTREL_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_HI20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Low 12 bits of PLT symbol offset relative to GOT (GP). */ - HOWTO (R_NDS32_PLT_GOTREL_LO12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_PLT_GOTREL_LO12", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_PLT_GOTREL_LO12,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_LO12",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 12 bits offset. */ - HOWTO (R_NDS32_SDA12S2_DP_RELA, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA12S2_DP_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA12S2_DP_RELA,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA12S2_DP_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 12 bits offset. */ - HOWTO (R_NDS32_SDA12S2_SP_RELA, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA12S2_SP_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA12S2_SP_RELA,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA12S2_SP_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S2_DP_RELA, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_LO12S2_DP_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x000003ff, /* src_mask */ - 0x000003ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S2_DP_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S2_DP_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. */ - HOWTO (R_NDS32_LO12S2_SP_RELA,/* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_LO12S2_SP_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x000003ff, /* src_mask */ - 0x000003ff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S2_SP_RELA,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S2_SP_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Lower 12 bits of address. Special identity for or case. */ - HOWTO (R_NDS32_LO12S0_ORI_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_LO12S0_ORI_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LO12S0_ORI_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_LO12S0_ORI_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 19 bits offset. */ - HOWTO (R_NDS32_SDA16S3_RELA, /* type */ - 3, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA16S3_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA16S3_RELA, /* type */ + 3, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA16S3_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Small data area 15 bits offset. */ - HOWTO (R_NDS32_SDA17S2_RELA, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 17, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA17S2_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x0001ffff, /* src_mask */ - 0x0001ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_NDS32_SDA18S1_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 18, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA18S1_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x0003ffff, /* src_mask */ - 0x0003ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - HOWTO (R_NDS32_SDA19S0_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 19, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA19S0_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x0007ffff, /* src_mask */ - 0x0007ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_DWARF2_OP1_RELA, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_DWARF2_OP1_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_DWARF2_OP2_RELA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_DWARF2_OP2_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_DWARF2_LEB_RELA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_DWARF2_LEB_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_UPDATE_TA_RELA,/* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_UPDATE_TA_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA17S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA17S2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0001ffff, /* src_mask */ + 0x0001ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_SDA18S1_RELA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 18, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA18S1_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0003ffff, /* src_mask */ + 0x0003ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_SDA19S0_RELA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA19S0_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_DWARF2_OP1_RELA,/* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DWARF2_OP1_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_DWARF2_OP2_RELA,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DWARF2_OP2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_DWARF2_LEB_RELA,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DWARF2_LEB_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_UPDATE_TA_RELA,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_UPDATE_TA_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Like R_NDS32_PCREL, but referring to the procedure linkage table entry for the symbol. */ - HOWTO (R_NDS32_9_PLTREL, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_9_PLTREL", /* name */ - FALSE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_9_PLTREL, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_9_PLTREL", /* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* Low 20 bits of PLT symbol offset relative to GOT (GP). */ - HOWTO (R_NDS32_PLT_GOTREL_LO20, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_PLT_GOTREL_LO20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - /* low 15 bits of PLT symbol offset relative to GOT (GP) */ - HOWTO (R_NDS32_PLT_GOTREL_LO15, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_PLT_GOTREL_LO15", /* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_PLT_GOTREL_LO20,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_LO20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* low 15 bits of PLT symbol offset relative to GOT (GP) */ + HOWTO2 (R_NDS32_PLT_GOTREL_LO15,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_LO15",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Low 19 bits of PLT symbol offset relative to GOT (GP). */ - HOWTO (R_NDS32_PLT_GOTREL_LO19, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 19, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_PLT_GOTREL_LO19", /* name */ - FALSE, /* partial_inplace */ - 0x0007ffff, /* src_mask */ - 0x0007ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_GOT_LO15, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOT_LO15", /* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_GOT_LO19, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 19, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOT_LO19", /* name */ - FALSE, /* partial_inplace */ - 0x0007ffff, /* src_mask */ - 0x0007ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_GOTOFF_LO15, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOTOFF_LO15", /* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_GOTOFF_LO19, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 19, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOTOFF_LO19", /* name */ - FALSE, /* partial_inplace */ - 0x0007ffff, /* src_mask */ - 0x0007ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_PLT_GOTREL_LO19,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_PLT_GOTREL_LO19",/* name */ + FALSE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT_LO15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT_LO15", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT_LO19, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT_LO19", /* name */ + FALSE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTOFF_LO15, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF_LO15", /* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOTOFF_LO19, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 19, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOTOFF_LO19", /* name */ + FALSE, /* partial_inplace */ + 0x0007ffff, /* src_mask */ + 0x0007ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* GOT 15 bits offset. */ - HOWTO (R_NDS32_GOT15S2_RELA, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOT15S2_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x00007fff, /* src_mask */ - 0x00007fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT15S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT15S2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x00007fff, /* src_mask */ + 0x00007fff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* GOT 17 bits offset. */ - HOWTO (R_NDS32_GOT17S2_RELA, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 17, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_GOT17S2_RELA",/* name */ - FALSE, /* partial_inplace */ - 0x0001ffff, /* src_mask */ - 0x0001ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_GOT17S2_RELA, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_GOT17S2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0001ffff, /* src_mask */ + 0x0001ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* A 5 bit address. */ - HOWTO (R_NDS32_5_RELA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 5, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_5_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x1f, /* src_mask */ - 0x1f, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_10_UPCREL_RELA,/* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 9, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_10_UPCREL_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x1ff, /* src_mask */ - 0x1ff, /* dst_mask */ - TRUE), /* pcrel_offset */ - HOWTO (R_NDS32_SDA_FP7U2_RELA,/* type */ - 2, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 7, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_SDA_FP7U2_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x0000007f, /* src_mask */ - 0x0000007f, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_WORD_9_PCREL_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_WORD_9_PCREL_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xff, /* src_mask */ - 0xff, /* dst_mask */ - TRUE), /* pcrel_offset */ - HOWTO (R_NDS32_25_ABS_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 24, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_25_ABS_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffffff, /* src_mask */ - 0xffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_5_RELA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 5, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_5_RELA", /* name */ + FALSE, /* partial_inplace */ + 0x1f, /* src_mask */ + 0x1f, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_10_UPCREL_RELA,/* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_10_UPCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x1ff, /* src_mask */ + 0x1ff, /* dst_mask */ + TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_SDA_FP7U2_RELA,/* type */ + 2, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 7, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SDA_FP7U2_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x0000007f, /* src_mask */ + 0x0000007f, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_WORD_9_PCREL_RELA,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_WORD_9_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xff, /* src_mask */ + 0xff, /* dst_mask */ + TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_25_ABS_RELA, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_25_ABS_RELA", /* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* A relative 17 bit relocation for ifc, right shifted by 1. */ - HOWTO (R_NDS32_17IFC_PCREL_RELA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_17IFC_PCREL_RELA", /* name */ - FALSE, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - TRUE), /* pcrel_offset */ + HOWTO2 (R_NDS32_17IFC_PCREL_RELA,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_17IFC_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* A relative unsigned 10 bit relocation for ifc, right shifted by 1. */ - HOWTO (R_NDS32_10IFCU_PCREL_RELA, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 9, /* bitsize */ - TRUE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_unsigned, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_10IFCU_PCREL_RELA", /* name */ - FALSE, /* partial_inplace */ - 0x1ff, /* src_mask */ - 0x1ff, /* dst_mask */ - TRUE), /* pcrel_offset */ - - /* Like R_NDS32_HI20, but referring to the TLS entry for the symbol. */ - HOWTO (R_NDS32_TLS_LE_HI20, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_LE_HI20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_TLS_LE_LO12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 12, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_LE_LO12", /* name */ - FALSE, /* partial_inplace */ - 0x00000fff, /* src_mask */ - 0x00000fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - - /* Like R_NDS32_HI20, but referring to the TLS entry for the symbol. */ - HOWTO (R_NDS32_TLS_IE_HI20, /* type */ - 12, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_IE_HI20", /* name */ - FALSE, /* partial_inplace */ - 0x000fffff, /* src_mask */ - 0x000fffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_TLS_IE_LO12S2, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 10, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_IE_LO12S2", /* name */ - FALSE, /* partial_inplace */ - 0x000003ff, /* src_mask */ - 0x000003ff, /* dst_mask */ - FALSE), /* pcrel_offset */ - /* Mark a TLS IE entry in GOT. */ - HOWTO (R_NDS32_TLS_TPOFF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_TPOFF", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - /* A 20 bit address. */ - HOWTO (R_NDS32_TLS_LE_20, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 20, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_LE_20", /* name */ - FALSE, /* partial_inplace */ - 0xfffff, /* src_mask */ - 0xfffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_TLS_LE_15S0, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_LE_15S0", /* name */ - FALSE, /* partial_inplace */ - 0x7fff, /* src_mask */ - 0x7fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_TLS_LE_15S1, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_LE_15S1", /* name */ - FALSE, /* partial_inplace */ - 0x7fff, /* src_mask */ - 0x7fff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_TLS_LE_15S2, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 15, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_NDS32_TLS_LE_15S2", /* name */ - FALSE, /* partial_inplace */ - 0x7fff, /* src_mask */ - 0x7fff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_10IFCU_PCREL_RELA,/* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 9, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_unsigned,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_10IFCU_PCREL_RELA",/* name */ + FALSE, /* partial_inplace */ + 0x1ff, /* src_mask */ + 0x1ff, /* dst_mask */ + TRUE), /* pcrel_offset */ /* Relax hint for unconditional call sequence */ - HOWTO (R_NDS32_LONGCALL4, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_LONGCALL4", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGCALL4, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL4", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional call sequence. */ - HOWTO (R_NDS32_LONGCALL5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_LONGCALL5", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGCALL5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL5", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional call sequence. */ - HOWTO (R_NDS32_LONGCALL6, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_LONGCALL6", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGCALL6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGCALL6", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for unconditional branch sequence. */ - HOWTO (R_NDS32_LONGJUMP4, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_LONGJUMP4", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGJUMP4, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP4", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional branch sequence. */ - HOWTO (R_NDS32_LONGJUMP5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_LONGJUMP5", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGJUMP5, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP5", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional branch sequence. */ - HOWTO (R_NDS32_LONGJUMP6, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_LONGJUMP6", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGJUMP6, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP6", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Relax hint for conditional branch sequence. */ - HOWTO (R_NDS32_LONGJUMP7, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_LONGJUMP7", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_LONGJUMP7, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LONGJUMP7", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Check sum value for security. */ + HOWTO2 (R_NDS32_SECURITY_16, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 5, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_SECURITY_16", /* name */ + FALSE, /* partial_inplace */ + 0x1fffe0, /* src_mask */ + 0x1fffe0, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* TLS LE TP offset relocation */ + HOWTO2 (R_NDS32_TLS_TPOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_TPOFF", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the TLS LE entry for the symbol. */ + HOWTO2 (R_NDS32_TLS_LE_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_LE_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 20 bit address. */ + HOWTO2 (R_NDS32_TLS_LE_20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_20", /* name */ + FALSE, /* partial_inplace */ + 0xfffff, /* src_mask */ + 0xfffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_LE_15S0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S0", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_LE_15S1, /* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S1", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_LE_15S2, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 15, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_LE_15S2", /* name */ + FALSE, /* partial_inplace */ + 0x7fff, /* src_mask */ + 0x7fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the TLS IE entry for the symbol. */ + HOWTO2 (R_NDS32_TLS_IE_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IE_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_IE_LO12, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IE_LO12", /* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_TLS_IE_LO12S2,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IE_LO12S2",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like R_NDS32_HI20, but referring to the TLS IE (PIE) entry for the symbol. */ + HOWTO2 (R_NDS32_TLS_IEGP_HI20,/* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IEGP_HI20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_TLS_IEGP_LO12,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IEGP_LO12",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO2 (R_NDS32_TLS_IEGP_LO12S2,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_IEGP_LO12S2",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS description relocation */ + HOWTO2 (R_NDS32_TLS_DESC, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_hi20_reloc, /* special_function */ + "R_NDS32_TLS_DESC_HI20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description offset high part. */ + HOWTO2 (R_NDS32_TLS_DESC_HI20,/* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_hi20_reloc, /* special_function */ + "R_NDS32_TLS_DESC_HI20",/* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* TLS GD/LD description offset low part. */ + HOWTO2 (R_NDS32_TLS_DESC_LO12,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_lo12_reloc, /* special_function */ + "R_NDS32_TLS_DESC_LO12",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description offset set (movi). */ + HOWTO2 (R_NDS32_TLS_DESC_20, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_DESC_20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description offset set (lwi.gp). */ + HOWTO2 (R_NDS32_TLS_DESC_SDA17S2,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_TLS_DESC_SDA17S2",/* name */ + FALSE, /* partial_inplace */ + 0x0001ffff, /* src_mask */ + 0x0001ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Jump-patch table relocations. */ + /* High 20 bits of jump-patch table address. */ + HOWTO2 (R_NDS32_ICT_HI20, /* type */ + 12, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 20, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_ICT_HI20", /* name */ + FALSE, /* partial_inplace */ + 0x000fffff, /* src_mask */ + 0x000fffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + /* Lower 12 bits of jump-patch table address. */ + HOWTO2 (R_NDS32_ICT_LO12,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 12, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_ICT_LO12",/* name */ + FALSE, /* partial_inplace */ + 0x00000fff, /* src_mask */ + 0x00000fff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO2 (R_NDS32_ICT_LO12S2,/* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 10, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_ICT_LO12S2",/* name */ + FALSE, /* partial_inplace */ + 0x000003ff, /* src_mask */ + 0x000003ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A relative 25 bit relocation, right shifted by 2. */ + HOWTO2 (R_NDS32_ICT_25PC,/* type */ + 1, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 24, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_NDS32_ICT_25PC",/* name */ + FALSE, /* partial_inplace */ + 0xffffff, /* src_mask */ + 0xffffff, /* dst_mask */ + TRUE), /* pcrel_offset */ }; /* Relocations used for relaxation. */ -static reloc_howto_type nds32_elf_relax_howto_table[] = -{ - HOWTO (R_NDS32_RELAX_ENTRY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_RELAX_ENTRY", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_GOT_SUFF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_GOT_SUFF", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_GOTOFF_SUFF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_GOTOFF_SUFF", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_PLT_GOT_SUFF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_PLT_GOT_SUFF",/* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_MULCALL_SUFF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_MULCALL_SUFF",/* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_PTR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_PTR", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_PTR_COUNT, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_PTR_COUNT", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_PTR_RESOLVED, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_PTR_RESOLVED",/* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_PLTBLOCK, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_PLTBLOCK", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_RELAX_REGION_BEGIN, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_RELAX_REGION_BEGIN", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_RELAX_REGION_END, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_RELAX_REGION_END", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_MINUEND, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_MINUEND", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_SUBTRAHEND, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_SUBTRAHEND", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_DIFF8, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_DIFF8", /* name */ - FALSE, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_DIFF16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_DIFF16", /* name */ - FALSE, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_DIFF32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_DIFF32", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_DIFF_ULEB128, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_DIFF_ULEB128",/* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_DATA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_DATA", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_TRAN, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - nds32_elf_ignore_reloc,/* special_function */ - "R_NDS32_TRAN", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_TLS_LE_ADD, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_TLS_LE_ADD", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_TLS_LE_LS, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_TLS_LE_LS", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ - HOWTO (R_NDS32_EMPTY, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - FALSE, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - nds32_elf_ignore_reloc, /* special_function */ - "R_NDS32_EMPTY", /* name */ - FALSE, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - FALSE), /* pcrel_offset */ +#define HOWTO3(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ + [C-R_NDS32_RELAX_ENTRY] = HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) + +static reloc_howto_type nds32_elf_relax_howto_table[] = { + HOWTO3 (R_NDS32_RELAX_ENTRY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_RELAX_ENTRY", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_GOT_SUFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_GOT_SUFF", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_GOTOFF_SUFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_GOTOFF_SUFF", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PLT_GOT_SUFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PLT_GOT_SUFF",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_MULCALL_SUFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_MULCALL_SUFF",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PTR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PTR", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PTR_COUNT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PTR_COUNT", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PTR_RESOLVED, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PTR_RESOLVED",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_PLTBLOCK, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_PLTBLOCK", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_RELAX_REGION_BEGIN,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_RELAX_REGION_BEGIN",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_RELAX_REGION_END,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_RELAX_REGION_END",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_MINUEND, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_MINUEND", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_SUBTRAHEND, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_SUBTRAHEND", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DIFF8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DIFF8", /* name */ + FALSE, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DIFF16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DIFF16", /* name */ + FALSE, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DIFF32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DIFF32", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DIFF_ULEB128, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DIFF_ULEB128",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_DATA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_DATA", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_TRAN, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TRAN", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_EMPTY, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_EMPTY", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO3 (R_NDS32_TLS_LE_ADD, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_LE_ADD", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + HOWTO3 (R_NDS32_TLS_LE_LS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_LE_LS", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO3 (R_NDS32_TLS_IEGP_LW, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_IEGP_LW", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description address base addition. */ + HOWTO3 (R_NDS32_TLS_DESC_ADD, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_DESC_ADD",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description function load. */ + HOWTO3 (R_NDS32_TLS_DESC_FUNC,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_DESC_FUNC",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS DESC resolve function call. */ + HOWTO3 (R_NDS32_TLS_DESC_CALL,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_DESC_CALL",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS DESC variable access. */ + HOWTO3 (R_NDS32_TLS_DESC_MEM, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_TLS_DESC_MEM",/* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description mark (@tlsdec). */ + HOWTO3 (R_NDS32_RELAX_REMOVE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_REMOVE", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* TLS GD/LD description mark (@tlsdec). */ + HOWTO3 (R_NDS32_RELAX_GROUP, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_GROUP", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* LA and FLSI relaxation. */ + HOWTO3 (R_NDS32_LSI, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + nds32_elf_ignore_reloc,/* special_function */ + "R_NDS32_LSI", /* name */ + FALSE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; - + +static unsigned long dl_tlsdesc_lazy_trampoline[] = +{ + 0x46200000, /* sethi $r2,#0x0 */ + 0x58210000, /* ori $r2,$r2,#0x0 */ + 0x40217400, /* add $r2,$r2,$gp */ + 0x04210000, /* lwi $r2,[$r2+#0x0] */ + 0x46300000, /* sethi $r3,#0x0 */ + 0x58318000, /* ori $r3,$r3,#0x0 */ + 0x4031f400, /* add $r3,$r3,$gp */ + 0x4a000800, /* jr $r2 */ +}; + +/* === code === */ + +static void +nds32_put_trampoline (void *contents, const unsigned long *template, + unsigned count) +{ + unsigned ix; + + for (ix = 0; ix != count; ix++) + { + unsigned long insn = template[ix]; + bfd_putb32 (insn, (char *) contents + ix * 4); + } +} + /* nds32_insertion_sort sorts an array with nmemb elements of size size. This prototype is the same as qsort (). */ @@ -2224,7 +2713,7 @@ nds32_insertion_sort (void *base, size_t nmemb, size_t size, { char *ptr = (char *) base; int i, j; - char *tmp = xmalloc (size); + char *tmp = alloca (size); /* If i is less than j, i is inserted before j. @@ -2248,7 +2737,6 @@ nds32_insertion_sort (void *base, size_t nmemb, size_t size, memmove (ptr + (j + 1) * size, ptr + j * size, (i - j) * size); memcpy (ptr + j * size, tmp, size); } - free (tmp); } /* Sort relocation by r_offset. @@ -2277,14 +2765,13 @@ compar_reloc (const void *lhs, const void *rhs) } /* Functions listed below are only used for old relocs. - * nds32_elf_9_pcrel_reloc - * nds32_elf_do_9_pcrel_reloc - * nds32_elf_hi20_reloc - * nds32_elf_relocate_hi20 - * nds32_elf_lo12_reloc - * nds32_elf_sda15_reloc - * nds32_elf_generic_reloc - */ + nds32_elf_9_pcrel_reloc + nds32_elf_do_9_pcrel_reloc + nds32_elf_hi20_reloc + nds32_elf_relocate_hi20 + nds32_elf_lo12_reloc + nds32_elf_sda15_reloc + nds32_elf_generic_reloc */ /* Handle the R_NDS32_9_PCREL & R_NDS32_9_PCREL_RELA reloc. */ @@ -2705,8 +3192,7 @@ struct nds32_reloc_map_entry unsigned char elf_reloc_val; }; -static const struct nds32_reloc_map_entry nds32_reloc_map[] = -{ +static const struct nds32_reloc_map_entry nds32_reloc_map[] = { {BFD_RELOC_NONE, R_NDS32_NONE}, {BFD_RELOC_16, R_NDS32_16_RELA}, {BFD_RELOC_32, R_NDS32_32_RELA}, @@ -2765,6 +3251,7 @@ static const struct nds32_reloc_map_entry nds32_reloc_map[] = {BFD_RELOC_NDS32_LONGJUMP5, R_NDS32_LONGJUMP5}, {BFD_RELOC_NDS32_LONGJUMP6, R_NDS32_LONGJUMP6}, {BFD_RELOC_NDS32_LONGJUMP7, R_NDS32_LONGJUMP7}, + {BFD_RELOC_NDS32_SECURITY_16, R_NDS32_SECURITY_16}, {BFD_RELOC_NDS32_LOADSTORE, R_NDS32_LOADSTORE}, {BFD_RELOC_NDS32_9_FIXED, R_NDS32_9_FIXED_RELA}, {BFD_RELOC_NDS32_15_FIXED, R_NDS32_15_FIXED_RELA}, @@ -2822,15 +3309,52 @@ static const struct nds32_reloc_map_entry nds32_reloc_map[] = {BFD_RELOC_NDS32_TLS_LE_LS, R_NDS32_TLS_LE_LS}, {BFD_RELOC_NDS32_TLS_IE_HI20, R_NDS32_TLS_IE_HI20}, {BFD_RELOC_NDS32_TLS_IE_LO12S2, R_NDS32_TLS_IE_LO12S2}, - {BFD_RELOC_NDS32_TLS_TPOFF, R_NDS32_TLS_TPOFF}, {BFD_RELOC_NDS32_TLS_LE_20, R_NDS32_TLS_LE_20}, {BFD_RELOC_NDS32_TLS_LE_15S0, R_NDS32_TLS_LE_15S0}, {BFD_RELOC_NDS32_TLS_LE_15S1, R_NDS32_TLS_LE_15S1}, {BFD_RELOC_NDS32_TLS_LE_15S2, R_NDS32_TLS_LE_15S2}, + + {BFD_RELOC_NDS32_TLS_DESC, R_NDS32_TLS_DESC}, + {BFD_RELOC_NDS32_TLS_DESC_HI20, R_NDS32_TLS_DESC_HI20}, + {BFD_RELOC_NDS32_TLS_DESC_LO12, R_NDS32_TLS_DESC_LO12}, + {BFD_RELOC_NDS32_TLS_DESC_ADD, R_NDS32_TLS_DESC_ADD}, + {BFD_RELOC_NDS32_TLS_DESC_FUNC, R_NDS32_TLS_DESC_FUNC}, + {BFD_RELOC_NDS32_TLS_DESC_CALL, R_NDS32_TLS_DESC_CALL}, + {BFD_RELOC_NDS32_TLS_DESC_MEM, R_NDS32_TLS_DESC_MEM}, + {BFD_RELOC_NDS32_TLS_DESC_20, R_NDS32_TLS_DESC_20}, + {BFD_RELOC_NDS32_TLS_DESC_SDA17S2, R_NDS32_TLS_DESC_SDA17S2}, + {BFD_RELOC_NDS32_TLS_IE_LO12, R_NDS32_TLS_IE_LO12}, + {BFD_RELOC_NDS32_TLS_IEGP_HI20, R_NDS32_TLS_IEGP_HI20}, + {BFD_RELOC_NDS32_TLS_IEGP_LO12, R_NDS32_TLS_IEGP_LO12}, + {BFD_RELOC_NDS32_TLS_IEGP_LO12S2, R_NDS32_TLS_IEGP_LO12S2}, + {BFD_RELOC_NDS32_TLS_IEGP_LW, R_NDS32_TLS_IEGP_LW}, + + {BFD_RELOC_NDS32_REMOVE, R_NDS32_RELAX_REMOVE}, + {BFD_RELOC_NDS32_GROUP, R_NDS32_RELAX_GROUP}, + + {BFD_RELOC_NDS32_ICT_HI20, R_NDS32_ICT_HI20}, + {BFD_RELOC_NDS32_ICT_LO12, R_NDS32_ICT_LO12}, + {BFD_RELOC_NDS32_ICT_25PC, R_NDS32_ICT_25PC}, + {BFD_RELOC_NDS32_ICT_LO12S2, R_NDS32_ICT_LO12S2}, + + {BFD_RELOC_NDS32_LSI, R_NDS32_LSI}, }; /* Patch tag. */ +/* Reserve space for COUNT dynamic relocations in relocation selection + SRELOC. */ + +static inline void +elf32_nds32_allocate_dynrelocs (struct bfd_link_info *info, asection *sreloc, + bfd_size_type count) +{ + BFD_ASSERT (elf_hash_table (info)->dynamic_sections_created); + if (sreloc == NULL) + abort (); + sreloc->size += sizeof (Elf32_External_Rela) * count; +} + static reloc_howto_type * bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) @@ -2860,6 +3384,13 @@ bfd_elf32_bfd_reloc_type_table_lookup (enum elf_nds32_reloc_type code) } else { + if ((size_t) (code - R_NDS32_RELAX_ENTRY) >= + ARRAY_SIZE (nds32_elf_relax_howto_table)) + { + int i = code; + i += 1; + } + BFD_ASSERT ((size_t) (code - R_NDS32_RELAX_ENTRY) < ARRAY_SIZE (nds32_elf_relax_howto_table)); return &nds32_elf_relax_howto_table[code - R_NDS32_RELAX_ENTRY]; @@ -2876,7 +3407,7 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, { if (nds32_reloc_map[i].bfd_reloc_val == code) return bfd_elf32_bfd_reloc_type_table_lookup - (nds32_reloc_map[i].elf_reloc_val); + (nds32_reloc_map[i].elf_reloc_val); } return NULL; @@ -2884,7 +3415,7 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an NDS32 ELF reloc. */ -static void +static bfd_boolean nds32_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -2894,20 +3425,35 @@ nds32_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, if (r_type > R_NDS32_GNU_VTENTRY) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid NDS32 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } + + BFD_ASSERT (ELF32_R_TYPE (dst->r_info) <= R_NDS32_GNU_VTENTRY); cache_ptr->howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type); + return TRUE; } -static void +static bfd_boolean nds32_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) { - BFD_ASSERT ((ELF32_R_TYPE (dst->r_info) == R_NDS32_NONE) - || ((ELF32_R_TYPE (dst->r_info) > R_NDS32_GNU_VTENTRY) - && (ELF32_R_TYPE (dst->r_info) < R_NDS32_max))); - cache_ptr->howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (dst->r_info)); + unsigned int r_type = ELF32_R_TYPE (dst->r_info); + + if ((r_type == R_NDS32_NONE) + || ((r_type > R_NDS32_GNU_VTENTRY) + && (r_type < R_NDS32_max))) + { + cache_ptr->howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type); + return TRUE; + } + + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } /* Support for core dump NOTE sections. @@ -2922,29 +3468,29 @@ nds32_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) switch (note->descsz) { case 0x114: - /* Linux/NDS32 32-bit, ABI1 */ + /* Linux/NDS32 32-bit, ABI1 */ - /* pr_cursig */ + /* pr_cursig */ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12); - /* pr_pid */ + /* pr_pid */ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24); - /* pr_reg */ + /* pr_reg */ offset = 72; size = 200; break; case 0xfc: - /* Linux/NDS32 32-bit */ + /* Linux/NDS32 32-bit */ - /* pr_cursig */ + /* pr_cursig */ elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12); - /* pr_pid */ + /* pr_pid */ elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24); - /* pr_reg */ + /* pr_reg */ offset = 72; size = 176; break; @@ -2964,7 +3510,7 @@ nds32_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) switch (note->descsz) { case 124: - /* Linux/NDS32 */ + /* Linux/NDS32 */ /* __kernel_uid_t, __kernel_gid_t are short on NDS32 platform. */ elf_tdata (abfd)->core->program = @@ -3097,20 +3643,20 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, struct elf_nds32_link_hash_table *table; struct bfd_link_hash_entry *h, *h2; long unsigned int total = 0; + asection *first = NULL, *final = NULL, *temp; + bfd_vma sda_base = 0; h = bfd_link_hash_lookup (info->hash, "_SDA_BASE_", FALSE, FALSE, TRUE); if (!h || (h->type != bfd_link_hash_defined && h->type != bfd_link_hash_defweak)) { - asection *first = NULL, *final = NULL, *temp; - bfd_vma sda_base; /* The first section must be 4-byte aligned to promise _SDA_BASE_ being 4 byte-aligned. Therefore, it has to set the first section ".data" 4 byte-aligned. */ static const char sec_name[SDA_SECTION_NUM][10] = - { - ".data", ".got", ".sdata_d", ".sdata_w", ".sdata_h", ".sdata_b", - ".sbss_b", ".sbss_h", ".sbss_w", ".sbss_d" - }; + { + ".data", ".got", ".sdata_d", ".sdata_w", ".sdata_h", ".sdata_b", + ".sbss_b", ".sbss_h", ".sbss_w", ".sbss_d" + }; size_t i = 0; if (output_bfd->sections == NULL) @@ -3120,7 +3666,7 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, } /* Get the first and final section. */ - while (i < sizeof (sec_name) / sizeof (sec_name [0])) + while (i < ARRAY_SIZE (sec_name)) { temp = bfd_get_section_by_name (output_bfd, sec_name[i]); if (temp && !first && (temp->size != 0 || temp->rawsize != 0)) @@ -3162,7 +3708,7 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, /* Find the section sda_base located. */ i = 0; - while (i < sizeof (sec_name) / sizeof (sec_name [0])) + while (i < ARRAY_SIZE (sec_name)) { final = bfd_get_section_by_name (output_bfd, sec_name[i]); if (final && (final->size != 0 || final->rawsize != 0) @@ -3177,17 +3723,44 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, } else { - /* There is not any data section in output bfd, and set _SDA_BASE_ in - first output section. */ - first = output_bfd->sections; - while (first && first->size == 0 && first->rawsize == 0) - first = first->next; + /* If there is not any default data section in output bfd, try to find + the first data section. If no data section be found, just simplily + choose the first output section. */ + temp = output_bfd->sections; + while (temp) + { + if (temp->flags & SEC_ALLOC + && (((temp->flags & SEC_DATA) + && ((temp->flags & SEC_READONLY) == 0)) + || (temp->flags & SEC_LOAD) == 0) + && (temp->size != 0 || temp->rawsize != 0)) + { + if (!first) + first = temp; + final = temp; + } + temp = temp->next; + } + + /* There is no data or bss section. */ + if (!first || (first->size == 0 && first->rawsize == 0)) + { + first = output_bfd->sections; + while (first && first->size == 0 && first->rawsize == 0) + first = first->next; + } + + /* There is no concrete section. */ if (!first) { *psb = elf_gp (output_bfd); return bfd_reloc_ok; } - sda_base = first->vma + first->rawsize; + + if (final && (final->vma + final->rawsize - first->vma) <= 0x4000) + sda_base = final->vma / 2 + final->rawsize / 2 + first->vma / 2; + else + sda_base = first->vma + 0x2000; } sda_base -= first->vma; @@ -3201,24 +3774,34 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, sda_rela_sec = first; - table = nds32_elf_hash_table (info); - relax_fp_as_gp = table->relax_fp_as_gp; - if (relax_fp_as_gp) - { - h2 = bfd_link_hash_lookup (info->hash, FP_BASE_NAME, - FALSE, FALSE, FALSE); - /* Define a weak FP_BASE_NAME here to prevent the undefined symbol. - And set FP equal to SDA_BASE to do relaxation for - la $fp, _FP_BASE_. */ - if (!_bfd_generic_link_add_one_symbol - (info, output_bfd, FP_BASE_NAME, BSF_GLOBAL | BSF_WEAK, - first, (bfd_vma) sda_base, (const char *) NULL, - FALSE, get_elf_backend_data (output_bfd)->collect, &h2)) - return FALSE; - } } - if (add_symbol) + /* Set _FP_BASE_ to _SDA_BASE_. */ + table = nds32_elf_hash_table (info); + relax_fp_as_gp = table->relax_fp_as_gp; + h2 = bfd_link_hash_lookup (info->hash, FP_BASE_NAME, FALSE, FALSE, FALSE); + /* _SDA_BASE_ is difined in linker script. */ + if (!first) + { + first = h->u.def.section; + sda_base = h->u.def.value; + } + + if (relax_fp_as_gp && h2 + && (h2->type == bfd_link_hash_undefweak + || h2->type == bfd_link_hash_undefined)) + { + /* Define a weak FP_BASE_NAME here to prevent the undefined symbol. + And set FP equal to SDA_BASE to do relaxation for + la $fp, _FP_BASE_. */ + if (!_bfd_generic_link_add_one_symbol + (info, output_bfd, FP_BASE_NAME, BSF_GLOBAL | BSF_WEAK, + first, sda_base, (const char *) NULL, + FALSE, get_elf_backend_data (output_bfd)->collect, &h2)) + return FALSE; + } + + if (add_symbol == TRUE) { if (h) { @@ -3229,7 +3812,7 @@ nds32_elf_final_sda_base (bfd *output_bfd, struct bfd_link_info *info, } else { - _bfd_error_handler (_("error: Can't find symbol: _SDA_BASE_.")); + _bfd_error_handler (_("error: can't find symbol: %s"), "_SDA_BASE_"); return bfd_reloc_dangerous; } } @@ -3275,6 +3858,8 @@ nds32_elf_link_hash_newfunc (struct bfd_hash_entry *entry, eh = (struct elf_nds32_link_hash_entry *) ret; eh->dyn_relocs = NULL; eh->tls_type = GOT_UNKNOWN; + eh->offset_to_gp = 0; + eh->indirect_call = FALSE; } return (struct bfd_hash_entry *) ret; @@ -3303,22 +3888,61 @@ nds32_elf_link_hash_table_create (bfd *abfd) return NULL; } + ret->sdynbss = NULL; + ret->srelbss = NULL; + ret->sym_ld_script = NULL; + return &ret->root.root; } +/* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up + shortcuts to them in our hash table. */ + +static bfd_boolean +create_got_section (bfd *dynobj, struct bfd_link_info *info) +{ + struct elf_link_hash_table *ehtab; + + if (!_bfd_elf_create_got_section (dynobj, info)) + return FALSE; + + ehtab = elf_hash_table (info); + ehtab->sgot = bfd_get_section_by_name (dynobj, ".got"); + ehtab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + if (!ehtab->sgot || !ehtab->sgotplt) + abort (); + + /* _bfd_elf_create_got_section will create it for us. */ + ehtab->srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + if (ehtab->srelgot == NULL + || !bfd_set_section_flags (dynobj, ehtab->srelgot, + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (dynobj, ehtab->srelgot, 2)) + return FALSE; + + return TRUE; +} + /* Create dynamic sections when linking against a dynamic object. */ static bfd_boolean nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) { + struct elf_link_hash_table *ehtab; struct elf_nds32_link_hash_table *htab; flagword flags, pltflags; register asection *s; const struct elf_backend_data *bed; int ptralign = 2; /* 32-bit */ + const char *secname; + char *relname; + flagword secflags; + asection *sec; bed = get_elf_backend_data (abfd); - + ehtab = elf_hash_table (info); htab = nds32_elf_hash_table (info); /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and @@ -3335,7 +3959,7 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) pltflags |= SEC_READONLY; s = bfd_make_section (abfd, ".plt"); - htab->root.splt = s; + ehtab->splt = s; if (s == NULL || !bfd_set_section_flags (abfd, s, pltflags) || !bfd_set_section_alignment (abfd, s, bed->plt_alignment)) @@ -3364,40 +3988,33 @@ nds32_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) s = bfd_make_section (abfd, bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"); - htab->root.srelplt = s; + ehtab->srelplt = s; if (s == NULL || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || !bfd_set_section_alignment (abfd, s, ptralign)) return FALSE; - if (htab->root.sgot == NULL && !_bfd_elf_create_got_section (abfd, info)) + if (ehtab->sgot == NULL && !create_got_section (abfd, info)) return FALSE; - { - const char *secname; - char *relname; - flagword secflags; - asection *sec; - - for (sec = abfd->sections; sec; sec = sec->next) - { - secflags = bfd_get_section_flags (abfd, sec); - if ((secflags & (SEC_DATA | SEC_LINKER_CREATED)) - || ((secflags & SEC_HAS_CONTENTS) != SEC_HAS_CONTENTS)) - continue; - secname = bfd_get_section_name (abfd, sec); - relname = (char *) bfd_malloc ((bfd_size_type) strlen (secname) + 6); - strcpy (relname, ".rela"); - strcat (relname, secname); - if (bfd_get_section_by_name (abfd, secname)) - continue; - s = bfd_make_section (abfd, relname); - if (s == NULL - || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || !bfd_set_section_alignment (abfd, s, ptralign)) - return FALSE; - } - } + for (sec = abfd->sections; sec; sec = sec->next) + { + secflags = bfd_get_section_flags (abfd, sec); + if ((secflags & (SEC_DATA | SEC_LINKER_CREATED)) + || ((secflags & SEC_HAS_CONTENTS) != SEC_HAS_CONTENTS)) + continue; + secname = bfd_get_section_name (abfd, sec); + relname = (char *) bfd_malloc ((bfd_size_type) strlen (secname) + 6); + strcpy (relname, ".rela"); + strcat (relname, secname); + if (bfd_get_section_by_name (abfd, secname)) + continue; + s = bfd_make_section (abfd, relname); + if (s == NULL + || !bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || !bfd_set_section_alignment (abfd, s, ptralign)) + return FALSE; + } if (bed->want_dynbss) { @@ -3453,8 +4070,8 @@ nds32_elf_copy_indirect_symbol (struct bfd_link_info *info, { if (edir->dyn_relocs != NULL) { - struct elf_dyn_relocs **pp; - struct elf_dyn_relocs *p; + struct elf_nds32_dyn_relocs **pp; + struct elf_nds32_dyn_relocs *p; if (ind->root.type == bfd_link_hash_indirect) abort (); @@ -3463,7 +4080,7 @@ nds32_elf_copy_indirect_symbol (struct bfd_link_info *info, list. Merge any entries against the same section. */ for (pp = &eind->dyn_relocs; (p = *pp) != NULL;) { - struct elf_dyn_relocs *q; + struct elf_nds32_dyn_relocs *q; for (q = edir->dyn_relocs; q != NULL; q = q->next) if (q->sec == p->sec) @@ -3483,25 +4100,18 @@ nds32_elf_copy_indirect_symbol (struct bfd_link_info *info, eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (info, dir, ind); -} - -/* Find dynamic relocs for H that apply to read-only sections. */ - -static asection * -readonly_dynrelocs (struct elf_link_hash_entry *h) -{ - struct elf_dyn_relocs *p; - - for (p = elf32_nds32_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) + if (ind->root.type == bfd_link_hash_indirect) { - asection *s = p->sec->output_section; - - if (s != NULL && (s->flags & SEC_READONLY) != 0) - return p->sec; + if (dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } } - return NULL; + + _bfd_elf_link_hash_copy_indirect (info, dir, ind); } + /* Adjust a symbol defined by a dynamic object and referenced by a regular object. The current definition is in some section of the @@ -3514,6 +4124,8 @@ nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info, struct elf_link_hash_entry *h) { struct elf_nds32_link_hash_table *htab; + struct elf_nds32_link_hash_entry *eh; + struct elf_nds32_dyn_relocs *p; bfd *dynobj; asection *s; unsigned int power_of_two; @@ -3558,7 +4170,8 @@ nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info, if (h->is_weakalias) { struct elf_link_hash_entry *def = weakdef (h); - BFD_ASSERT (def->root.type == bfd_link_hash_defined); + BFD_ASSERT (def->root.type == bfd_link_hash_defined + || def->root.type == bfd_link_hash_defweak); h->root.u.def.section = def->root.u.def.section; h->root.u.def.value = def->root.u.def.value; return TRUE; @@ -3580,15 +4193,24 @@ nds32_elf_adjust_dynamic_symbol (struct bfd_link_info *info, return TRUE; /* If -z nocopyreloc was given, we won't generate them either. */ - if (0 && info->nocopyreloc) + if (info->nocopyreloc) { h->non_got_ref = 0; return TRUE; } - /* If we don't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (0 && !readonly_dynrelocs (h)) + eh = (struct elf_nds32_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & (SEC_READONLY | SEC_HAS_CONTENTS)) != 0) + break; + } + + /* If we didn't find any dynamic relocs in sections which needs the + copy reloc, then we'll be keeping the dynamic relocs and avoiding + the copy reloc. */ + if (p == NULL) { h->non_got_ref = 0; return TRUE; @@ -3653,25 +4275,31 @@ static bfd_boolean allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; + struct elf_link_hash_table *ehtab; struct elf_nds32_link_hash_table *htab; struct elf_nds32_link_hash_entry *eh; - struct elf_dyn_relocs *p; + struct elf_nds32_dyn_relocs *p; if (h->root.type == bfd_link_hash_indirect) return TRUE; + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ if (h->root.type == bfd_link_hash_warning) - /* When warning symbols are created, they **replace** the "real" - entry in the hash table, thus we never get to see the real - symbol in a hash traversal. So look at it now. */ h = (struct elf_link_hash_entry *) h->root.u.i.link; + eh = (struct elf_nds32_link_hash_entry *) h; + info = (struct bfd_link_info *) inf; + ehtab = elf_hash_table (info); htab = nds32_elf_hash_table (info); + if (htab == NULL) + return FALSE; - eh = (struct elf_nds32_link_hash_entry *) h; - - if (htab->root.dynamic_sections_created && h->plt.refcount > 0) + if ((htab->root.dynamic_sections_created || h->type == STT_GNU_IFUNC) + && h->plt.refcount > 0 + && !(bfd_link_pie (info) && h->def_regular)) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ @@ -3683,7 +4311,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, bfd_link_pic (info), h)) { - asection *s = htab->root.splt; + asection *s = ehtab->splt; /* If this is the first .plt entry, make room for the special first entry. */ @@ -3708,10 +4336,12 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) /* We also need to make an entry in the .got.plt section, which will be placed in the .got section by the linker script. */ - htab->root.sgotplt->size += 4; + ehtab->sgotplt->size += 4; /* We also need to make an entry in the .rel.plt section. */ - htab->root.srelplt->size += sizeof (Elf32_External_Rela); + ehtab->srelplt->size += sizeof (Elf32_External_Rela); + if (htab->tls_desc_trampoline) + htab->next_tls_desc_index++; } else { @@ -3727,7 +4357,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) if (h->got.refcount > 0) { - asection *s; + asection *sgot; bfd_boolean dyn; int tls_type = elf32_nds32_hash_entry (h)->tls_type; @@ -3739,22 +4369,44 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) return FALSE; } - s = htab->root.sgot; - h->got.offset = s->size; + sgot = elf_hash_table (info)->sgot; + h->got.offset = sgot->size; if (tls_type == GOT_UNKNOWN) abort (); - else if (tls_type == GOT_NORMAL - || tls_type == GOT_TLS_IE) - /* Need a GOT slot. */ - s->size += 4; + + /* Non-TLS symbols, and TLS_IE need one GOT slot. */ + if (tls_type & (GOT_NORMAL | GOT_TLS_IE | GOT_TLS_IEGP)) + sgot->size += 4; + else + { + /* TLS_DESC, TLS_GD, and TLS_LD need 2 consecutive GOT slots. */ + if (tls_type & GOT_TLS_DESC) + sgot->size += 8; + } dyn = htab->root.dynamic_sections_created; + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h)) - htab->root.srelgot->size += sizeof (Elf32_External_Rela); + { + if (tls_type == GOT_TLS_DESC && htab->tls_desc_trampoline) + { + /* TLS_DESC with trampoline needs a relocation slot + within .rela.plt. */ + htab->num_tls_desc++; + ehtab->srelplt->size += sizeof (Elf32_External_Rela); + htab->tls_trampoline = -1; + } + else + { + /* other relocations, including TLS_DESC without trampoline, need + a relocation slot within .rela.got. */ + ehtab->srelgot->size += sizeof (Elf32_External_Rela); + } + } } else - h->got.offset = (bfd_vma) - 1; + h->got.offset = (bfd_vma) -1; if (eh->dyn_relocs == NULL) return TRUE; @@ -3769,7 +4421,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { if (h->def_regular && (h->forced_local || info->symbolic)) { - struct elf_dyn_relocs **pp; + struct elf_nds32_dyn_relocs **pp; for (pp = &eh->dyn_relocs; (p = *pp) != NULL;) { @@ -3810,7 +4462,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) eh->dyn_relocs = NULL; - keep:; +keep:; } /* Finally, allocate space. */ @@ -3823,29 +4475,50 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) return TRUE; } -/* Set DF_TEXTREL if we find any dynamic relocs that apply to - read-only sections. */ +/* Add relocation REL to the end of relocation section SRELOC. */ + +static void +elf32_nds32_add_dynreloc (bfd *output_bfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sreloc, Elf_Internal_Rela *rel) +{ + bfd_byte *loc; + if (sreloc == NULL) + abort (); + + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); + if (sreloc->reloc_count * sizeof (Elf32_External_Rela) > sreloc->size) + abort (); + + bfd_elf32_swap_reloca_out (output_bfd, rel, loc); +} + +/* Find any dynamic relocs that apply to read-only sections. */ static bfd_boolean -maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { - asection *sec; + struct elf_nds32_link_hash_entry *eh; + struct elf_nds32_dyn_relocs *p; - if (h->root.type == bfd_link_hash_indirect) - return TRUE; + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; - sec = readonly_dynrelocs (h); - if (sec != NULL) + eh = (struct elf_nds32_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) { - struct bfd_link_info *info = (struct bfd_link_info *) info_p; + asection *s = p->sec->output_section; - info->flags |= DF_TEXTREL; - info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), - sec->owner, h->root.root.string, sec); + if (s != NULL && (s->flags & SEC_READONLY) != 0) + { + struct bfd_link_info *info = (struct bfd_link_info *) inf; - /* Not an error, just cut short the traversal. */ - return FALSE; + info->flags |= DF_TEXTREL; + + /* Not an error, just cut short the traversal. */ + return FALSE; + } } return TRUE; } @@ -3856,20 +4529,24 @@ static bfd_boolean nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) { - struct elf_nds32_link_hash_table *htab; bfd *dynobj; asection *s; + bfd_boolean plt; bfd_boolean relocs; bfd *ibfd; + struct elf_nds32_link_hash_table *htab; htab = nds32_elf_hash_table (info); - dynobj = htab->root.dynobj; + if (htab == NULL) + return FALSE; + + dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); - if (htab->root.dynamic_sections_created) + if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (bfd_link_executable (info) && !info->nointerp) + if (bfd_link_executable (info)) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -3886,16 +4563,19 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, bfd_signed_vma *end_local_got; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; - asection *srel; + asection *sgot; + char *local_tls_type; + unsigned long symndx; + bfd_vma *local_tlsdesc_gotent; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) continue; for (s = ibfd->sections; s != NULL; s = s->next) { - struct elf_dyn_relocs *p; + struct elf_nds32_dyn_relocs *p; - for (p = ((struct elf_dyn_relocs *) + for (p = ((struct elf_nds32_dyn_relocs *) elf_section_data (s)->local_dynrel); p != NULL; p = p->next) { @@ -3909,8 +4589,8 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, } else if (p->count != 0) { - srel = elf_section_data (p->sec)->sreloc; - srel->size += p->count * sizeof (Elf32_External_Rela); + asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->size += p->count * sizeof (Elf32_External_Rela); if ((p->sec->output_section->flags & SEC_READONLY) != 0) info->flags |= DF_TEXTREL; } @@ -3924,19 +4604,57 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; - s = htab->root.sgot; - srel = htab->root.srelgot; - for (; local_got < end_local_got; ++local_got) + sgot = elf_hash_table (info)->sgot; + local_tls_type = elf32_nds32_local_got_tls_type (ibfd); + local_tlsdesc_gotent = elf32_nds32_local_tlsdesc_gotent (ibfd); + for (symndx = 0; local_got < end_local_got; + ++local_got, ++local_tls_type, ++local_tlsdesc_gotent, ++symndx) { if (*local_got > 0) { - *local_got = s->size; - s->size += 4; - if (bfd_link_pic (info)) - srel->size += sizeof (Elf32_External_Rela); + int num_of_got_entry_needed = 0; + *local_got = sgot->size; + *local_tlsdesc_gotent = sgot->size; + + /* TLS_NORMAL, and TLS_IE need one slot in .got. */ + if (*local_tls_type & (GOT_NORMAL | GOT_TLS_IE | GOT_TLS_IEGP)) + num_of_got_entry_needed = 1; + /* TLS_GD, TLS_LD, and TLS_DESC need an 8-byte structure in the GOT. */ + else if (*local_tls_type & GOT_TLS_DESC) + num_of_got_entry_needed = 2; + + sgot->size += (num_of_got_entry_needed << 2); + + /* non-relax-able TLS_DESCs need a slot in .rela.plt. + others need a slot in .rela.got. */ + if (*local_tls_type == GOT_TLS_DESC) + { + if (bfd_link_pic (info)) + { + if (htab->tls_desc_trampoline) + { + htab->num_tls_desc++; + htab->root.srelplt->size += sizeof (Elf32_External_Rela); + htab->tls_trampoline = -1; + } + else + htab->root.srelgot->size += sizeof (Elf32_External_Rela); + } + else + { + /* TLS_DESC -> TLS_LE */ + } + } + else + { + htab->root.srelgot->size += sizeof (Elf32_External_Rela); + } } else - *local_got = (bfd_vma) - 1; + { + *local_got = (bfd_vma) -1; + *local_tlsdesc_gotent = (bfd_vma) -1; + } } } @@ -3944,8 +4662,36 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, sym dynamic relocs. */ elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (void *) info); + /* For every jump slot reserved in the sgotplt, reloc_count is + incremented. However, when we reserve space for TLS descriptors, + it's not incremented, so in order to compute the space reserved + for them, it suffices to multiply the reloc count by the jump + slot size. */ + if (htab->tls_desc_trampoline && htab->root.srelplt) + htab->sgotplt_jump_table_size = elf32_nds32_compute_jump_table_size (htab); + + if (htab->tls_trampoline) + { + htab->tls_trampoline = htab->root.splt->size; + + /* If we're not using lazy TLS relocations, don't generate the + PLT and GOT entries they require. */ + if (!(info->flags & DF_BIND_NOW)) + { + htab->dt_tlsdesc_got = htab->root.sgot->size; + htab->root.sgot->size += 4; + + htab->dt_tlsdesc_plt = htab->root.splt->size; + htab->root.splt->size += 4 * ARRAY_SIZE (dl_tlsdesc_lazy_trampoline); + } + } + /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ + /* The check_relocs and adjust_dynamic_symbol entry points have + determined the sizes of the various dynamic sections. Allocate + memory for them. */ + plt = FALSE; relocs = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { @@ -3956,18 +4702,19 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, { /* Strip this section if we don't need it; see the comment below. */ + plt = s->size != 0; } - else if (s == htab->root.sgot) + else if (s == elf_hash_table (info)->sgot) { got_size += s->size; } - else if (s == htab->root.sgotplt) + else if (s == elf_hash_table (info)->sgotplt) { got_size += s->size; } else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) { - if (s->size != 0 && s != htab->root.srelplt) + if (s->size != 0 && s != elf_hash_table (info)->srelplt) relocs = TRUE; /* We use the reloc_count field as a counter if we need @@ -4013,16 +4760,15 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, must add the entries now so that we get the correct size for the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ -#define add_dynamic_entry(TAG, VAL) \ - _bfd_elf_add_dynamic_entry (info, TAG, VAL) +#define add_dynamic_entry(TAG, VAL) _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (!bfd_link_pic (info)) + if (bfd_link_executable (info)) { if (!add_dynamic_entry (DT_DEBUG, 0)) return FALSE; } - if (htab->root.splt->size != 0) + if (elf_hash_table (info)->splt->size != 0) { if (!add_dynamic_entry (DT_PLTGOT, 0) || !add_dynamic_entry (DT_PLTRELSZ, 0) @@ -4031,6 +4777,14 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, return FALSE; } + if (htab->tls_desc_trampoline && plt) + { + if (htab->dt_tlsdesc_plt + && (!add_dynamic_entry (DT_TLSDESC_PLT, 0) + || !add_dynamic_entry (DT_TLSDESC_GOT, 0))) + return FALSE; + } + if (relocs) { if (!add_dynamic_entry (DT_RELA, 0) @@ -4041,7 +4795,7 @@ nds32_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->root, maybe_set_textrel, + elf_link_hash_traverse (&htab->root, readonly_dynrelocs, (void *) info); if ((info->flags & DF_TEXTREL) != 0) @@ -4076,10 +4830,11 @@ nds32_relocate_contents (reloc_howto_type *howto, bfd *input_bfd, switch (size) { default: + case 0: + case 1: + case 8: abort (); break; - case 0: - return bfd_reloc_ok; case 2: x = bfd_getb16 (location); break; @@ -4297,9 +5052,9 @@ nds32_elf_output_symbol_hook (struct bfd_link_info *info, else source = input_sec->owner->filename; - fprintf (sym_ld_script, "\t%s = 0x%08lx;\t /* %s */\n", + fprintf (sym_ld_script, "\t%s = 0x%08lx;\t /* %s */\n", h->root.root.string, - (long) (h->root.u.def.value + (h->root.u.def.value + h->root.u.def.section->output_section->vma + h->root.u.def.section->output_offset), source); } @@ -4340,52 +5095,243 @@ nds32_elf_output_symbol_hook (struct bfd_link_info *info, section, which means that the addend must be adjusted accordingly. */ +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +/* Return the relocation value for @gottpoff relocation + if STT_TLS virtual address is ADDRESS. */ static bfd_vma -dtpoff_base (struct bfd_link_info *info) +gottpoff (struct bfd_link_info *info, bfd_vma address) { + bfd_vma tp_base; + bfd_vma tp_offset; + /* If tls_sec is NULL, we should have signalled an error already. */ if (elf_hash_table (info)->tls_sec == NULL) return 0; - return elf_hash_table (info)->tls_sec->vma; + + tp_base = elf_hash_table (info)->tls_sec->vma; + tp_offset = address - tp_base; + + return tp_offset; } -static bfd_boolean -nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, - struct bfd_link_info * info, - bfd * input_bfd, - asection * input_section, - bfd_byte * contents, - Elf_Internal_Rela * relocs, - Elf_Internal_Sym * local_syms, - asection ** local_sections) +/* Move all SECURITY_16 to the final one for each instruction. */ + +static void +nds32_elf_crc_adjust_reloc (Elf_Internal_Rela *relocs, + Elf_Internal_Rela *relend) { - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - Elf_Internal_Rela *rel, *relend; - bfd_boolean ret = TRUE; /* Assume success. */ - int align = 0; - bfd_reloc_status_type r; - const char *errmsg = NULL; - bfd_vma gp; - struct elf_nds32_link_hash_table *htab; - bfd *dynobj; - bfd_vma *local_got_offsets; + Elf_Internal_Rela *rel, *crc_rel = NULL; + Elf_Internal_Rela rel_temp; + + for (rel = relocs; rel < relend; rel++) + { + if (crc_rel && crc_rel->r_offset == rel->r_offset) + { + memcpy (&rel_temp, rel, sizeof (Elf_Internal_Rela)); + memcpy (rel, crc_rel, sizeof (Elf_Internal_Rela)); + memcpy (crc_rel, &rel_temp, sizeof (Elf_Internal_Rela)); + crc_rel = rel; + } + else if (ELF32_R_TYPE (rel->r_info) == R_NDS32_SECURITY_16) + { + crc_rel = rel; + continue; + } + } +} + +static bfd_boolean +patch_tls_desc_to_ie (bfd_byte *contents, Elf_Internal_Rela *rel, bfd *ibfd) +{ + /* TLS_GD/TLS_LD model #1 + 46 00 00 00 sethi $r0,#0x0 + 58 00 00 00 ori $r0,$r0,#0x0 + 40 00 74 00 add $r0,$r0,$gp + 04 10 00 00 lwi $r1,[$r0+#0x0] + 4b e0 04 01 jral $lp,$r1 */ + + /* TLS_GD/TLS_LD model #2 + 46 00 00 00 sethi $r0,#0x0 + 58 00 00 00 ori $r0,$r0,#0x0 + 38 10 74 02 lw $r1,[$r0+($gp<<#0x0)] <= TODO: not necessary $r1 register allocation + 40 00 74 00 add $r0,$r0,$gp + 4b e0 04 01 jral $lp,$r1 */ + + /* TLS_IE model (non-PIC) + 46 00 00 00 sethi $r0,#0x0 + 04 00 00 00 lwi $r0,[$r0+#0x0] + 38 00 64 02 lw $r0,[$r0+($r25<<#0x0)] */ + + /* TLS_IE model (PIC) + 46 00 00 00 sethi $r0,#0x0 + 58 00 00 00 ori $r0,$r0,#0x0 + 38 00 74 02 lw $r0,[$r0+($gp<<#0x0)] + 38 00 64 02 lw $r0,[$r0+($r25<<#0x0)] */ + + /* TLS_GD_TO_IE model + 46 00 00 00 sethi $r0,#0x0 + 58 00 00 00 ori $r0,$r0,#0x0 + 40 00 74 00 add $r0,$rM,$gp + 04 00 00 01 lwi $r0,[$r0+#0x4] + 40 00 64 00 add $r0,$r0,$r25 */ + + bfd_boolean rz = FALSE; + + typedef struct + { + uint32_t opcode; + uint32_t mask; + } pat_t; + + uint32_t patch[3] = + { + 0x40007400, /* add $r0,$rM,$gp */ + 0x04000001, /* lwi $r0,[$r0+#0x4] */ + 0x40006400, /* add $r0,$r0,$r25 */ + }; + + pat_t mode0[3] = + { + { 0x40000000, 0xfe0003ff }, + { 0x04000000, 0xfe000000 }, + { 0x4be00001, 0xffff83ff }, + }; + + pat_t mode1[3] = + { + { 0x38007402, 0xfe007fff }, + { 0x40007400, 0xfe007fff }, + { 0x4be00001, 0xffff83ff }, + }; + + unsigned char *p = contents + rel->r_offset; + + uint32_t insn; + uint32_t regidx = 0; + insn = bfd_getb32 (p); + if (INSN_SETHI == (0xfe0fffffu & insn)) + { + regidx = 0x1f & (insn >> 20); + p += 4; + } + + insn = bfd_getb32 (p); + if (INSN_ORI == (0xfe007fffu & insn)) + { + regidx = 0x1f & (insn >> 20); + p += 4; + } + + if (patch[2] == bfd_getb32 (p + 8)) /* character instruction */ + { + /* already patched? */ + if ((patch[0] == (0xfff07fffu & bfd_getb32 (p + 0))) && + (patch[1] == bfd_getb32 (p + 4))) + rz = TRUE; + } + else if (mode0[0].opcode == (mode0[0].mask & bfd_getb32 (p + 0))) + { + if ((mode0[1].opcode == (mode0[1].mask & bfd_getb32 (p + 4))) && + (mode0[2].opcode == (mode0[2].mask & bfd_getb32 (p + 8)))) + { + bfd_putb32 (patch[0] | (regidx << 15), p + 0); + bfd_putb32 (patch[1], p + 4); + bfd_putb32 (patch[2], p + 8); + rz = TRUE; + } + } + else if (mode1[0].opcode == (mode1[0].mask & bfd_getb32 (p + 0))) + { + if ((mode1[1].opcode == (mode1[1].mask & bfd_getb32 (p + 4))) && + (mode1[2].opcode == (mode1[2].mask & bfd_getb32 (p + 8)))) + { + bfd_putb32 (patch[0] | (regidx << 15), p + 0); + bfd_putb32 (patch[1], p + 4); + bfd_putb32 (patch[2], p + 8); + rz = TRUE; + } + } + + if (!rz) + { + printf ("%s: %s @ 0x%08x\n", __func__, ibfd->filename, + (int) rel->r_offset); + BFD_ASSERT(0); /* unsupported pattern */ + } + + return rz; +} + +static enum elf_nds32_tls_type +get_tls_type (enum elf_nds32_reloc_type r_type, struct elf_link_hash_entry *h); + +static unsigned int +ones32 (register unsigned int x) +{ + /* 32-bit recursive reduction using SWAR... + but first step is mapping 2-bit values + into sum of 2 1-bit values in sneaky way. */ + x -= ((x >> 1) & 0x55555555); + x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); + x = (((x >> 4) + x) & 0x0f0f0f0f); + x += (x >> 8); + x += (x >> 16); + return (x & 0x0000003f); +} + +static unsigned int +fls (register unsigned int x) +{ + return ffs (x & (-x)); +} + +#define nds32_elf_local_tlsdesc_gotent(bfd) \ + (elf_nds32_tdata (bfd)->local_tlsdesc_gotent) + +static bfd_boolean +nds32_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info, bfd *input_bfd, + asection *input_section, bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel, *relend; + bfd_boolean ret = TRUE; /* Assume success. */ + int align = 0; + bfd_reloc_status_type r; + const char *errmsg = NULL; + bfd_vma gp; + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_table *htab; + bfd *dynobj; + bfd_vma *local_got_offsets; asection *sgot, *splt, *sreloc; bfd_vma high_address; struct elf_nds32_link_hash_table *table; int eliminate_gc_relocs; bfd_vma fpbase_addr; + Elf_Internal_Rela *crc_rel = NULL; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); + ehtab = elf_hash_table (info); htab = nds32_elf_hash_table (info); high_address = bfd_get_section_limit (input_bfd, input_section); dynobj = htab->root.dynobj; local_got_offsets = elf_local_got_offsets (input_bfd); - sgot = htab->root.sgot; - splt = htab->root.splt; + sgot = ehtab->sgot; + splt = ehtab->splt; sreloc = NULL; rel = relocs; @@ -4393,6 +5339,8 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, table = nds32_elf_hash_table (info); eliminate_gc_relocs = table->eliminate_gc_relocs; + + /* explain _SDA_BASE_ */ /* By this time, we can adjust the value of _SDA_BASE_. */ if ((!bfd_link_relocatable (info))) { @@ -4402,40 +5350,37 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, return FALSE; } - if (is_ITB_BASE_set == 0) - { - /* Set the _ITB_BASE_. */ - if (!nds32_elf_ex9_itb_base (info)) - { - _bfd_error_handler (_("%B: error: Cannot set _ITB_BASE_"), - output_bfd); - bfd_set_error (bfd_error_bad_value); - } - } - - if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON) - if (!nds32_elf_ifc_reloc ()) - _bfd_error_handler (_("error: IFC relocation error.")); +#ifdef NDS32_LINUX_TOOLCHAIN + /* Do TLS model conversion once at first. */ + nds32_elf_unify_tls_model (input_bfd, input_section, contents, info); +#endif - /* Relocation for .ex9.itable. */ - if (table->target_optimize & NDS32_RELAX_EX9_ON - || (table->ex9_import_file && table->update_ex9_table)) - nds32_elf_ex9_reloc_jmp (info); + if (indirect_call_table.count > 0) + nds32_elf_ict_relocate (output_bfd, info); /* Use gp as fp to prevent truncated fit. Because in relaxation time the fp value is set as gp, and it has be reverted for instruction setting fp. */ fpbase_addr = elf_gp (output_bfd); + /* Move all SECURITY_16 to the final one for each instruction. */ + nds32_elf_crc_adjust_reloc (relocs, relend); + + /* Deal with (dynamic) relocations. */ for (rel = relocs; rel < relend; rel++) { enum elf_nds32_reloc_type r_type; reloc_howto_type *howto = NULL; unsigned long r_symndx; struct elf_link_hash_entry *h = NULL; + struct bfd_link_hash_entry *h2; Elf_Internal_Sym *sym = NULL; asection *sec; bfd_vma relocation; + struct elf_nds32_ict_hash_entry *entry; + bfd_vma relocation_sym = 0xdeadbeef; + Elf_Internal_Rela *lorel; + bfd_vma off; /* We can't modify r_addend here as elf_link_input_bfd has an assert to ensure it's zero (we use REL relocs, not RELA). Therefore this @@ -4449,7 +5394,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, if (r_type >= R_NDS32_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: error: unknown relocation type %d."), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), input_bfd, r_type); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -4463,12 +5408,17 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, || r_type == R_NDS32_RELA_GNU_VTINHERIT || (r_type >= R_NDS32_INSN16 && r_type <= R_NDS32_25_FIXED_RELA) || r_type == R_NDS32_DATA - || r_type == R_NDS32_TRAN - || (r_type >= R_NDS32_LONGCALL4 && r_type <= R_NDS32_LONGJUMP7)) + || r_type == R_NDS32_TRAN) continue; - /* If we enter the fp-as-gp region. Resolve the address - of best fp-base. */ + /* Save security beginning. */ + if (r_type == R_NDS32_SECURITY_16 && crc_rel == NULL) + { + crc_rel = rel; + continue; + } + + /* If we enter the fp-as-gp region. Resolve the address of best fp-base. */ if (ELF32_R_TYPE (rel->r_info) == R_NDS32_RELAX_REGION_BEGIN && (rel->r_addend & R_NDS32_RELAX_REGION_OMIT_FP_FLAG)) { @@ -4485,9 +5435,13 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, fpbase_addr = elf_gp (output_bfd); } - if (((r_type >= R_NDS32_DWARF2_OP1_RELA - && r_type <= R_NDS32_DWARF2_LEB_RELA) - || r_type >= R_NDS32_RELAX_ENTRY) && !bfd_link_relocatable (info)) + /* Skip the relocations used for relaxation. */ + /* Fix ticket-11832, we have to update LONGCALL and LONGJUMP + relocations when generating the relocatable files. */ + if (!bfd_link_relocatable (info) + && (r_type >= R_NDS32_RELAX_ENTRY + || (r_type >= R_NDS32_LONGCALL4 + && r_type <= R_NDS32_LONGJUMP7))) continue; howto = bfd_elf32_bfd_reloc_type_table_lookup (r_type); @@ -4506,10 +5460,26 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); addend = rel->r_addend; + + /* keep symbol location for static TLS_IE GOT entry */ + relocation_sym = relocation; + if (bfd_link_relocatable (info)) + { + /* This is a relocatable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + rel->r_addend += sec->output_offset + sym->st_value; + + continue; + } } else { /* External symbol. */ + if (bfd_link_relocatable (info)) + continue; bfd_boolean warned, ignored, unresolved_reloc; int symndx = r_symndx - symtab_hdr->sh_info; @@ -4518,10 +5488,27 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, relocation, unresolved_reloc, warned, ignored); + /* keep symbol location for static TLS_IE GOT entry */ + relocation_sym = relocation; + /* la $fp, _FP_BASE_ is per-function (region). Handle it specially. */ switch ((int) r_type) { + case R_NDS32_HI20_RELA: + case R_NDS32_LO12S0_RELA: + if (strcmp (elf_sym_hashes (input_bfd)[symndx]->root.root.string, + FP_BASE_NAME) == 0) + { + if (!bfd_link_pie (info)) + { + _bfd_error_handler + ("%pB: warning: _FP_BASE_ setting insns relaxation failed.", + input_bfd); + } + relocation = fpbase_addr; + break; + } case R_NDS32_SDA19S0_RELA: case R_NDS32_SDA15S0_RELA: case R_NDS32_20_RELA: @@ -4532,19 +5519,6 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, break; } } - - } - - if (bfd_link_relocatable (info)) - { - /* This is a relocatable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (sym != NULL && ELF_ST_TYPE (sym->st_info) == STT_SECTION) - rel->r_addend += sec->output_offset + sym->st_value; - - continue; } /* Sanity check the address. */ @@ -4554,16 +5528,14 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, goto check_reloc; } - if ((r_type >= R_NDS32_DWARF2_OP1_RELA - && r_type <= R_NDS32_DWARF2_LEB_RELA) - || r_type >= R_NDS32_RELAX_ENTRY) + if (r_type >= R_NDS32_RELAX_ENTRY) continue; switch ((int) r_type) { case R_NDS32_GOTOFF: /* Relocation is relative to the start of the global offset - table (for ld24 rx, #uimm24), e.g. access at label+addend + table (for ld24 rx, #uimm24), e.g. access at label + addend ld24 rx. #label@GOTOFF + addend sub rx, r12. */ @@ -4605,12 +5577,18 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, case R_NDS32_PLT_GOTREL_LO15: case R_NDS32_PLT_GOTREL_LO19: case R_NDS32_PLT_GOTREL_LO20: - if (h == NULL || h->forced_local || h->plt.offset == (bfd_vma) - 1) + if (h == NULL + || h->forced_local + || h->plt.offset == (bfd_vma) -1 + || (bfd_link_pie (info) && h->def_regular)) { + /* TODO: find better checking to optimize PIE PLT relocations. */ /* We didn't make a PLT entry for this symbol. This happens when statically linking PIC code, or when using -Bsymbolic. */ - relocation -= elf_gp (output_bfd); + if (h) + h->plt.offset = (bfd_vma) -1; /* cancel PLT trampoline. */ + relocation -= elf_gp(output_bfd); break; } @@ -4661,21 +5639,18 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, case R_NDS32_GOTPC_HI20: case R_NDS32_GOTPC_LO12: - { - /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation - bl .+4 - seth rx,#high(_GLOBAL_OFFSET_TABLE_) - or3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4) - or - bl .+4 - seth rx,#shigh(_GLOBAL_OFFSET_TABLE_) - add3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4) - */ - relocation = elf_gp (output_bfd); - relocation -= (input_section->output_section->vma - + input_section->output_offset + rel->r_offset); - break; - } + /* .got(_GLOBAL_OFFSET_TABLE_) - pc relocation + bl .+4 + seth rx,#high(_GLOBAL_OFFSET_TABLE_) + or3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4) + or + bl .+4 + seth rx,#shigh(_GLOBAL_OFFSET_TABLE_) + add3 rx,rx,#low(_GLOBAL_OFFSET_TABLE_ +4) */ + relocation = elf_gp (output_bfd); + relocation -= (input_section->output_section->vma + + input_section->output_offset + rel->r_offset); + break; case R_NDS32_GOT20: /* Fall through. */ @@ -4687,17 +5662,14 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, offset table. */ BFD_ASSERT (sgot != NULL); - if (h != NULL) + if (h != NULL) /* External symbol */ { bfd_boolean dyn; - bfd_vma off; off = h->got.offset; BFD_ASSERT (off != (bfd_vma) - 1); dyn = htab->root.dynamic_sections_created; - if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, - bfd_link_pic (info), - h) + if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h) || (bfd_link_pic (info) && (info->symbolic || h->dynindx == -1 @@ -4707,28 +5679,27 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, -Bsymbolic link and the symbol is defined locally, or the symbol was forced to be local because of a version file. We must initialize - this entry in the global offset table. Since the + this entry in the global offset table. Since the offset must always be a multiple of 4, we use the least significant bit to record whether we have initialized it already. When doing a dynamic link, we create a .rela.got - relocation entry to initialize the value. This + relocation entry to initialize the value. This is done in the finish_dynamic_symbol routine. */ - if ((off & 1) != 0) + if ((off & 1) != 0) /* clear LSB */ off &= ~1; else { bfd_put_32 (output_bfd, relocation, sgot->contents + off); - h->got.offset |= 1; + h->got.offset |= 1; /* mark initialized */ } } relocation = sgot->output_section->vma + sgot->output_offset + off - - elf_gp (output_bfd); + - elf_gp (output_bfd); } - else + else /* Local symbol */ { - bfd_vma off; bfd_byte *loc; BFD_ASSERT (local_got_offsets != NULL @@ -4736,10 +5707,10 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, off = local_got_offsets[r_symndx]; - /* The offset must always be a multiple of 4. We use + /* The offset must always be a multiple of 4. We use the least significant bit to record whether we have already processed this entry. */ - if ((off & 1) != 0) + if ((off & 1) != 0) /* clear LSB */ off &= ~1; else { @@ -4752,7 +5723,7 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, /* We need to generate a R_NDS32_RELATIVE reloc for the dynamic linker. */ - srelgot = htab->root.srelgot; + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); BFD_ASSERT (srelgot != NULL); outrel.r_offset = (elf_gp (output_bfd) @@ -4768,11 +5739,57 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, local_got_offsets[r_symndx] |= 1; } relocation = sgot->output_section->vma + sgot->output_offset + off - - elf_gp (output_bfd); + - elf_gp (output_bfd); } break; + case R_NDS32_25_PCREL_RELA: + case R_NDS32_HI20_RELA: + case R_NDS32_LO12S0_RELA: + case R_NDS32_LO12S2_RELA: + /* Merge normal and indirect call functions. */ + if (!ignore_indirect_call && h + && elf32_nds32_hash_entry (h)->indirect_call) + { + if (ict_model == R_NDS32_RELAX_ENTRY_ICT_LARGE) + { + _bfd_error_handler + (_("%pB: Error: there are mixed indirect call function in" + " ICT large model\'%s\'\n"), + input_bfd, h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + else + _bfd_error_handler + (_("%pB: Warning: there are mixed indirect call function" + " \'%s\'\n"), input_bfd, h->root.root.string); + + entry = (struct elf_nds32_ict_hash_entry*) + bfd_hash_lookup (&indirect_call_table, h->root.root.string, + FALSE, FALSE); + if (!entry) + { + _bfd_error_handler + (_("%pB %pA: internal error indirect call relocation " + "0x%lx without hash.\n"), + input_bfd, sec, rel->r_offset); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + h2 = bfd_link_hash_lookup (info->hash, + "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + relocation = ((h2->u.def.value + + h2->u.def.section->output_section->vma + + h2->u.def.section->output_offset) + + (entry->order * 4)); + break; + } + + /* Fall through. */ case R_NDS32_16_RELA: case R_NDS32_20_RELA: case R_NDS32_5_RELA: @@ -4782,14 +5799,10 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, case R_NDS32_10_UPCREL_RELA: case R_NDS32_15_PCREL_RELA: case R_NDS32_17_PCREL_RELA: - case R_NDS32_25_PCREL_RELA: - case R_NDS32_HI20_RELA: case R_NDS32_LO12S3_RELA: - case R_NDS32_LO12S2_RELA: case R_NDS32_LO12S2_DP_RELA: case R_NDS32_LO12S2_SP_RELA: case R_NDS32_LO12S1_RELA: - case R_NDS32_LO12S0_RELA: case R_NDS32_LO12S0_ORI_RELA: if (bfd_link_pic (info) && r_symndx != 0 && (input_section->flags & SEC_ALLOC) != 0 @@ -4863,15 +5876,37 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, become local. */ if (h == NULL || ((info->symbolic || h->dynindx == -1) - && h->def_regular)) + && h->def_regular) + || (bfd_link_pie (info) && h->def_regular)) { relocate = TRUE; outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE); outrel.r_addend = relocation + rel->r_addend; + if (h) + { + h->plt.offset = (bfd_vma) -1; /* cancel PLT trampoline. */ + + BFD_ASSERT (sgot != NULL); + /* If we did not allocate got entry for the symbol, we can not + fill the nonexistent got entry. */ + if (h->got.offset != (bfd_vma) -1 && (h->got.offset & 1) == 0) + { + bfd_put_32 (output_bfd, outrel.r_addend, + sgot->contents + h->got.offset); + } + } } else { - BFD_ASSERT (h->dynindx != -1); + if (h->dynindx == -1) + { + _bfd_error_handler + (_("%pB: relocation %s against `%s' can not be used when" + "making a shared object; recompile with -fPIC"), + input_bfd, nds32_elf_howto_table[r_type].name, h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; } @@ -4895,8 +5930,8 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, if (bfd_link_pic (info)) { _bfd_error_handler - (_("%B: warning: cannot deal R_NDS32_25_ABS_RELA in shared " - "mode."), input_bfd); + (_("%s: warning: cannot deal R_NDS32_25_ABS_RELA in shared mode."), + bfd_get_filename (input_bfd)); return FALSE; } break; @@ -4908,128 +5943,120 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, goto check_reloc; case R_NDS32_HI20: + /* We allow an arbitrary number of HI20 relocs before the + LO12 reloc. This permits GCC to emit the HI and LO relocs + itself. */ + for (lorel = rel + 1; + (lorel < relend + && ELF32_R_TYPE (lorel->r_info) == R_NDS32_HI20); lorel++) + continue; + if (lorel < relend + && (ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S3 + || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S2 + || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S1 + || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S0)) { - Elf_Internal_Rela *lorel; - - /* We allow an arbitrary number of HI20 relocs before the - LO12 reloc. This permits gcc to emit the HI and LO relocs - itself. */ - for (lorel = rel + 1; - (lorel < relend - && ELF32_R_TYPE (lorel->r_info) == R_NDS32_HI20); lorel++) - continue; - if (lorel < relend - && (ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S3 - || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S2 - || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S1 - || ELF32_R_TYPE (lorel->r_info) == R_NDS32_LO12S0)) - { - nds32_elf_relocate_hi20 (input_bfd, r_type, rel, lorel, - contents, relocation + addend); - r = bfd_reloc_ok; - } - else - r = _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, offset, relocation, - addend); + nds32_elf_relocate_hi20 (input_bfd, r_type, rel, lorel, + contents, relocation + addend); + r = bfd_reloc_ok; } + else + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, offset, relocation, + addend); goto check_reloc; case R_NDS32_GOT17S2_RELA: case R_NDS32_GOT15S2_RELA: + BFD_ASSERT (sgot != NULL); + + if (h != NULL) { - bfd_vma off; + bfd_boolean dyn; - BFD_ASSERT (sgot != NULL); + off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) - 1); - if (h != NULL) + dyn = htab->root.dynamic_sections_created; + if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL + (dyn, bfd_link_pic (info), h) || (bfd_link_pic (info) + && (info->symbolic + || h->dynindx == -1 + || h->forced_local) + && h->def_regular)) { - bfd_boolean dyn; - - off = h->got.offset; - BFD_ASSERT (off != (bfd_vma) - 1); - - dyn = htab->root.dynamic_sections_created; - if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL - (dyn, bfd_link_pic (info), h) - || (bfd_link_pic (info) - && (info->symbolic - || h->dynindx == -1 - || h->forced_local) - && h->def_regular)) + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally, or the symbol was forced to be local + because of a version file. We must initialize + this entry in the global offset table. Since the + offset must always be a multiple of 4, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rela.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) + off &= ~1; + else { - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 4, we use the - least significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rela.got - relocation entry to initialize the value. This - is done in the finish_dynamic_symbol routine. */ - if ((off & 1) != 0) - off &= ~1; - else - { - bfd_put_32 (output_bfd, relocation, - sgot->contents + off); - h->got.offset |= 1; - } + bfd_put_32 (output_bfd, relocation, + sgot->contents + off); + h->got.offset |= 1; } } - else - { - bfd_byte *loc; + } + else + { + bfd_byte *loc; + + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) - 1); - BFD_ASSERT (local_got_offsets != NULL - && local_got_offsets[r_symndx] != (bfd_vma) - 1); + off = local_got_offsets[r_symndx]; - off = local_got_offsets[r_symndx]; + /* The offset must always be a multiple of 4. We use + the least significant bit to record whether we have + already processed this entry. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_32 (output_bfd, relocation, sgot->contents + off); - /* The offset must always be a multiple of 4. We use - the least significant bit to record whether we have - already processed this entry. */ - if ((off & 1) != 0) - off &= ~1; - else + if (bfd_link_pic (info)) { - bfd_put_32 (output_bfd, relocation, sgot->contents + off); + asection *srelgot; + Elf_Internal_Rela outrel; - if (bfd_link_pic (info)) - { - asection *srelgot; - Elf_Internal_Rela outrel; - - /* We need to generate a R_NDS32_RELATIVE reloc - for the dynamic linker. */ - srelgot = htab->root.srelgot; - BFD_ASSERT (srelgot != NULL); - - outrel.r_offset = (elf_gp (output_bfd) - + sgot->output_offset + off); - outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE); - outrel.r_addend = relocation; - loc = srelgot->contents; - loc += - srelgot->reloc_count * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - ++srelgot->reloc_count; - } - local_got_offsets[r_symndx] |= 1; + /* We need to generate a R_NDS32_RELATIVE reloc + for the dynamic linker. */ + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (elf_gp (output_bfd) + + sgot->output_offset + off); + outrel.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE); + outrel.r_addend = relocation; + loc = srelgot->contents; + loc += + srelgot->reloc_count * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + ++srelgot->reloc_count; } + local_got_offsets[r_symndx] |= 1; } - relocation = sgot->output_section->vma + sgot->output_offset + off - - elf_gp (output_bfd); } + relocation = sgot->output_section->vma + sgot->output_offset + off + - elf_gp (output_bfd); + if (relocation & align) { /* Incorrect alignment. */ _bfd_error_handler - (_("%B: warning: unaligned access to GOT entry."), input_bfd); + (_("%pB: warning: unaligned access to GOT entry."), input_bfd); ret = FALSE; r = bfd_reloc_dangerous; goto check_reloc; @@ -5060,50 +6087,48 @@ nds32_elf_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED, case R_NDS32_SDA19S0_RELA: case R_NDS32_SDA15S0_RELA: case R_NDS32_SDA15S0: - { - align = 0x0; + align = 0x0; handle_sda: - BFD_ASSERT (sec != NULL); + BFD_ASSERT (sec != NULL); - /* If the symbol is in the abs section, the out_bfd will be null. - This happens when the relocation has a symbol@GOTOFF. */ - r = nds32_elf_final_sda_base (output_bfd, info, &gp, FALSE); - if (r != bfd_reloc_ok) - { - _bfd_error_handler - (_("%B: warning: relocate SDA_BASE failed."), input_bfd); - ret = FALSE; - goto check_reloc; - } + /* If the symbol is in the abs section, the out_bfd will be null. + This happens when the relocation has a symbol@GOTOFF. */ + r = nds32_elf_final_sda_base (output_bfd, info, &gp, FALSE); + if (r != bfd_reloc_ok) + { + _bfd_error_handler + (_("%pB: warning: relocate SDA_BASE failed."), input_bfd); + ret = FALSE; + goto check_reloc; + } - /* At this point `relocation' contains the object's - address. */ - if (r_type == R_NDS32_SDA_FP7U2_RELA) - { - relocation -= fpbase_addr; - } - else - relocation -= gp; - /* Now it contains the offset from _SDA_BASE_. */ + /* At this point `relocation' contains the object's + address. */ + if (r_type == R_NDS32_SDA_FP7U2_RELA) + { + relocation -= fpbase_addr; + } + else + relocation -= gp; + /* Now it contains the offset from _SDA_BASE_. */ - /* Make sure alignment is correct. */ + /* Make sure alignment is correct. */ - if (relocation & align) - { - /* Incorrect alignment. */ - _bfd_error_handler - /* xgettext:c-format */ - (_("%B(%A): warning: unaligned small data access of type %d."), - input_bfd, input_section, r_type); - ret = FALSE; - goto check_reloc; - } + if (relocation & align) + { + /* Incorrect alignment. */ + _bfd_error_handler + (_("%pB(%pA): warning: unaligned small data access of type %d."), + input_bfd, input_section, r_type); + ret = FALSE; + goto check_reloc; } break; case R_NDS32_17IFC_PCREL_RELA: case R_NDS32_10IFCU_PCREL_RELA: - /* do nothing */ + ifc_flag = TRUE; + /* do nothing */ break; case R_NDS32_TLS_LE_HI20: @@ -5112,28 +6137,38 @@ handle_sda: case R_NDS32_TLS_LE_15S0: case R_NDS32_TLS_LE_15S1: case R_NDS32_TLS_LE_15S2: + /* TODO: we do not have garbage collection for got entries. + IE to LE may have one empty entry, and DESC to LE may + have two. */ if (elf_hash_table (info)->tls_sec != NULL) relocation -= (elf_hash_table (info)->tls_sec->vma + TP_OFFSET); break; case R_NDS32_TLS_IE_HI20: case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + case R_NDS32_TLS_IE_LO12: + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: { /* Relocation is to the entry for this symbol in the global offset table. */ - unsigned int tls_type; + enum elf_nds32_tls_type tls_type, org_tls_type, eff_tls_type; asection *srelgot; Elf_Internal_Rela outrel; - bfd_vma off; bfd_byte *loc; int indx = 0; + eff_tls_type = org_tls_type = get_tls_type (r_type, h); + BFD_ASSERT (sgot != NULL); if (h != NULL) { bfd_boolean dyn; off = h->got.offset; - BFD_ASSERT (off != (bfd_vma) - 1); + BFD_ASSERT (off != (bfd_vma) -1); dyn = htab->root.dynamic_sections_created; tls_type = ((struct elf_nds32_link_hash_entry *) h)->tls_type; if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h) @@ -5143,64 +6178,184 @@ handle_sda: } else { - /* Never happen currently. */ BFD_ASSERT (local_got_offsets != NULL && local_got_offsets[r_symndx] != (bfd_vma) - 1); off = local_got_offsets[r_symndx]; - tls_type = elf32_nds32_local_got_tls_type (input_bfd)[r_symndx]; } + relocation = sgot->output_section->vma + sgot->output_offset + off; - if (r_type == R_NDS32_TLS_IE_LO12S2) - break; + if (1 < ones32 (tls_type)) + { + eff_tls_type = 1 << (fls (tls_type) - 1); + /* TLS model shall be handled in nds32_elf_unify_tls_model () */ + + /* TLS model X -> LE is not implement yet! + * workaround here! */ + if (eff_tls_type == GOT_TLS_LE) + { + eff_tls_type = 1 << (fls (tls_type ^ eff_tls_type) - 1); + } + } /* The offset must always be a multiple of 4. We use the least significant bit to record whether we have already processed this entry. */ - if ((off & 1) != 0) - off &= ~1; + bfd_boolean need_relocs = FALSE; + srelgot = ehtab->srelgot; + if ((bfd_link_pic (info) || indx != 0) + && (h == NULL || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) + { + need_relocs = TRUE; + BFD_ASSERT (srelgot != NULL); + } + + if (off & 1) + { + off &= ~1; + relocation &= ~1; + + if (eff_tls_type & GOT_TLS_DESC) + { + relocation -= elf_gp (output_bfd); + if ((R_NDS32_TLS_DESC_HI20 == r_type) && (!need_relocs)) + { + /* TLS model shall be converted */ + BFD_ASSERT(0); + } + } + else if (eff_tls_type & GOT_TLS_IEGP) + { + relocation -= elf_gp (output_bfd); + } + } else { - bfd_boolean need_relocs = FALSE; - srelgot = htab->root.srelgot; - if ((bfd_link_pic (info) || indx != 0) - && (h == NULL - || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT - || h->root.type != bfd_link_hash_undefweak)) + if ((eff_tls_type & GOT_TLS_LE) && (tls_type ^ eff_tls_type)) { - need_relocs = TRUE; - BFD_ASSERT (srelgot != NULL); + /* TLS model workaround shall be applied */ + BFD_ASSERT(0); } - if (tls_type & GOT_TLS_IE) + else if (eff_tls_type & (GOT_TLS_IE | GOT_TLS_IEGP)) { + if (eff_tls_type & GOT_TLS_IEGP) + relocation -= elf_gp(output_bfd); + if (need_relocs) { - if (h->dynindx == 0) - outrel.r_addend = relocation - dtpoff_base (info); + if (indx == 0) + outrel.r_addend = gottpoff (info, relocation_sym); else outrel.r_addend = 0; outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + off); - outrel.r_info = - ELF32_R_INFO (h->dynindx, R_NDS32_TLS_TPOFF); - - loc = srelgot->contents; - loc += - srelgot->reloc_count * sizeof (Elf32_External_Rela); - bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - ++srelgot->reloc_count; + + sgot->output_offset + off); + outrel.r_info = ELF32_R_INFO (indx, R_NDS32_TLS_TPOFF); + + elf32_nds32_add_dynreloc (output_bfd, info, srelgot, + &outrel); } else - bfd_put_32 (output_bfd, h->root.u.def.value - TP_OFFSET, - sgot->contents + off); + { + bfd_put_32 (output_bfd, gottpoff (info, relocation_sym), + sgot->contents + off); + } + } + else if (eff_tls_type & GOT_TLS_DESC) + { + relocation -= elf_gp (output_bfd); + if (need_relocs) + { + if (indx == 0) + outrel.r_addend = gottpoff (info, relocation_sym); + else + outrel.r_addend = 0; + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + off); + outrel.r_info = ELF32_R_INFO (indx, R_NDS32_TLS_DESC); + + if (htab->tls_desc_trampoline) + { + asection *srelplt; + srelplt = ehtab->srelplt; + loc = srelplt->contents; + loc += htab->next_tls_desc_index++ * sizeof (Elf32_External_Rela); + BFD_ASSERT (loc + sizeof (Elf32_External_Rela) + <= srelplt->contents + srelplt->size); + + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } + else + { + loc = srelgot->contents; + loc += srelgot->reloc_count * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + ++srelgot->reloc_count; + } + } + else + { + /* feed me! */ + bfd_put_32 (output_bfd, 0xdeadbeef, + sgot->contents + off); + bfd_put_32 (output_bfd, gottpoff (info, relocation_sym), + sgot->contents + off + 4); + patch_tls_desc_to_ie (contents, rel, input_bfd); + BFD_ASSERT(0); + } + } + else + { + /* TLS model workaround shall be applied */ + BFD_ASSERT(0); } + + if (h != NULL) + h->got.offset |= 1; + else + local_got_offsets[r_symndx] |= 1; } } - break; + break; + + case R_NDS32_SECURITY_16: + relocation = 0; + crc_rel->r_addend = NDS32_SECURITY_NONE; + r = nds32_elf_final_link_relocate (howto, input_bfd, + input_section, contents, + crc_rel->r_offset, relocation, + crc_rel->r_addend); + crc_rel = NULL; + goto check_reloc; + break; + /* DON'T fall through. */ + case R_NDS32_ICT_HI20: + case R_NDS32_ICT_LO12: + case R_NDS32_ICT_25PC: + case R_NDS32_ICT_LO12S2: + entry = (struct elf_nds32_ict_hash_entry*) + bfd_hash_lookup (&indirect_call_table, h->root.root.string, + FALSE, FALSE); + if (!entry) + { + _bfd_error_handler + (_("%pB %pA: internal error indirect call relocation " + "0x%lx without hash.\n"), + input_bfd, sec, rel->r_offset); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + h2 = bfd_link_hash_lookup (info->hash, + "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + relocation = ((h2->u.def.value + + h2->u.def.section->output_section->vma + + h2->u.def.section->output_offset) + + (entry->order * 4)); + break; /* DON'T fall through. */ default: @@ -5275,6 +6430,12 @@ handle_sda: case R_NDS32_TLS_LE_15S0: case R_NDS32_TLS_LE_15S1: case R_NDS32_TLS_LE_15S2: + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + case R_NDS32_TLS_IE_LO12: + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: /* Instruction related relocs must handle endian properly. */ /* NOTE: PIC IS NOT HANDLE YET; DO IT LATER. */ r = nds32_elf_final_link_relocate (howto, input_bfd, @@ -5283,6 +6444,15 @@ handle_sda: rel->r_addend); break; + case R_NDS32_ICT_HI20: + case R_NDS32_ICT_LO12: + case R_NDS32_ICT_25PC: + case R_NDS32_ICT_LO12S2: + r = nds32_elf_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, 0); + break; + default: /* All other relocs can use default handler. */ r = _bfd_final_link_relocate (howto, input_bfd, input_section, @@ -5314,6 +6484,17 @@ check_reloc: switch (r) { case bfd_reloc_overflow: + if (r_type == R_NDS32_17IFC_PCREL_RELA) + { + _bfd_error_handler + (_("\n%pB: (%pA+0x%x): The IFC optimization range exceeded.\n" + "Please turn off the IFC optimization (-mno-ifc) when " + "compiling the file %s.\n"), + input_bfd, sec, (int) rel->r_offset, + h->root.u.def.section->owner->filename); + bfd_set_error (bfd_error_bad_value); + } + (*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, input_bfd, input_section, offset); @@ -5340,14 +6521,18 @@ check_reloc: errmsg = _("internal error: unknown error"); /* Fall through. */ - common_error: - (*info->callbacks->warning) (info, errmsg, name, input_bfd, - input_section, offset); +common_error: + (*info->callbacks->warning) + (info, errmsg, name, input_bfd, input_section, offset); break; } } } + /* Resotre header size to avoid overflow load. */ + if (elf_nds32_tdata (input_bfd)->hdr_size != 0) + symtab_hdr->sh_size = elf_nds32_tdata (input_bfd)->hdr_size; + return ret; } @@ -5356,12 +6541,15 @@ check_reloc: static bfd_boolean nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, - struct elf_link_hash_entry *h, Elf_Internal_Sym *sym) + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { - struct elf_nds32_link_hash_table *htab; + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_entry *hent; bfd_byte *loc; - htab = nds32_elf_hash_table (info); + ehtab = elf_hash_table (info); + hent = (struct elf_nds32_link_hash_entry *) h; if (h->plt.offset != (bfd_vma) - 1) { @@ -5379,9 +6567,9 @@ nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, BFD_ASSERT (h->dynindx != -1); - splt = htab->root.splt; - sgot = htab->root.sgotplt; - srela = htab->root.srelplt; + splt = ehtab->splt; + sgot = ehtab->sgotplt; + srela = ehtab->srelplt; BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); /* Get the index in the procedure linkage table which @@ -5417,7 +6605,7 @@ nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, bfd_putb32 (insn, splt->contents + h->plt.offset + 12); insn = PLT_ENTRY_WORD4 - + (((unsigned int) ((-(h->plt.offset + 16)) >> 1)) & 0xffffff); + + (((unsigned int) ((-(h->plt.offset + 16)) >> 1)) & 0xffffff); bfd_putb32 (insn, splt->contents + h->plt.offset + 16); local_plt_offset = 12; } @@ -5428,9 +6616,8 @@ nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, long offset; /* FIXME, sda_base is 65536, it will damage opcode. */ - /* insn = PLT_PIC_ENTRY_WORD0 + (((got_offset - sda_base) >> 2) & 0x7fff); */ offset = sgot->output_section->vma + sgot->output_offset + got_offset - - elf_gp (output_bfd); + - elf_gp (output_bfd); insn = PLT_PIC_ENTRY_WORD0 + ((offset >> 12) & 0xfffff); bfd_putb32 (insn, splt->contents + h->plt.offset); @@ -5479,18 +6666,18 @@ nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, } } - if (h->got.offset != (bfd_vma) - 1) + if ((h->got.offset != (bfd_vma) -1) && (hent->tls_type == GOT_NORMAL)) { asection *sgot; - asection *srela; + asection *srelagot; Elf_Internal_Rela rela; /* This symbol has an entry in the global offset table. Set it up. */ - sgot = htab->root.sgot; - srela = htab->root.srelgot; - BFD_ASSERT (sgot != NULL && srela != NULL); + sgot = ehtab->sgot; + srelagot = ehtab->srelgot; + BFD_ASSERT (sgot != NULL && srelagot != NULL); rela.r_offset = (sgot->output_section->vma + sgot->output_offset + (h->got.offset & ~1)); @@ -5500,14 +6687,24 @@ nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, the symbol was forced to be local because of a version file. The entry in the global offset table will already have been initialized in the relocate_section function. */ - if (bfd_link_pic (info) - && (info->symbolic - || h->dynindx == -1 || h->forced_local) && h->def_regular) + if ((bfd_link_pic (info) + && (info->symbolic || h->dynindx == -1 || h->forced_local) + && h->def_regular) + || (bfd_link_pie (info) && h->def_regular)) { rela.r_info = ELF32_R_INFO (0, R_NDS32_RELATIVE); rela.r_addend = (h->root.u.def.value - + h->root.u.def.section->output_section->vma - + h->root.u.def.section->output_offset); + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + + /* FIXME: cancel PLT trampoline, too late ?? */ + /* h->plt.offset = (bfd_vma) -1; */ + + if ((h->got.offset & 1) == 0) + { + bfd_put_32 (output_bfd, rela.r_addend, + sgot->contents + h->got.offset); + } } else { @@ -5518,10 +6715,11 @@ nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, rela.r_addend = 0; } - loc = srela->contents; - loc += srela->reloc_count * sizeof (Elf32_External_Rela); + loc = srelagot->contents; + loc += srelagot->reloc_count * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); - ++srela->reloc_count; + ++srelagot->reloc_count; + BFD_ASSERT (loc < (srelagot->contents + srelagot->size)); } if (h->needs_copy) @@ -5563,23 +6761,32 @@ nds32_elf_finish_dynamic_symbol (bfd *output_bfd, struct bfd_link_info *info, static bfd_boolean nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { - struct elf_nds32_link_hash_table *htab; bfd *dynobj; asection *sdyn; - asection *sgot; + asection *sgotplt; + struct elf_link_hash_table *ehtab; + struct elf_nds32_link_hash_table *htab; + ehtab = elf_hash_table (info); htab = nds32_elf_hash_table (info); - dynobj = htab->root.dynobj; + if (htab == NULL) + return FALSE; - sgot = htab->root.sgotplt; + dynobj = elf_hash_table (info)->dynobj; + + sgotplt = ehtab->sgotplt; + /* A broken linker script might have discarded the dynamic sections. + Catch this here so that we do not seg-fault later on. */ + if (sgotplt != NULL && bfd_is_abs_section (sgotplt->output_section)) + return FALSE; sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); - if (htab->root.dynamic_sections_created) + if (elf_hash_table (info)->dynamic_sections_created) { asection *splt; Elf32_External_Dyn *dyncon, *dynconend; - BFD_ASSERT (sgot != NULL && sdyn != NULL); + BFD_ASSERT (sgotplt != NULL && sdyn != NULL); dyncon = (Elf32_External_Dyn *) sdyn->contents; dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->size); @@ -5597,25 +6804,60 @@ nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) break; case DT_PLTGOT: - s = htab->root.sgotplt; + /* name = ".got"; */ + s = ehtab->sgot->output_section; goto get_vma; case DT_JMPREL: - s = htab->root.srelplt; - get_vma: - dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + s = ehtab->srelplt->output_section; +get_vma: + BFD_ASSERT (s != NULL); + dyn.d_un.d_ptr = s->vma; bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; case DT_PLTRELSZ: - s = htab->root.srelplt; + s = ehtab->srelplt->output_section; + BFD_ASSERT (s != NULL); dyn.d_un.d_val = s->size; bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; + + case DT_RELASZ: + /* My reading of the SVR4 ABI indicates that the + procedure linkage table relocs (DT_JMPREL) should be + included in the overall relocs (DT_RELA). This is + what Solaris does. However, UnixWare can not handle + that case. Therefore, we override the DT_RELASZ entry + here to make it not include the JMPREL relocs. Since + the linker script arranges for .rela.plt to follow all + other relocation sections, we don't have to worry + about changing the DT_RELA entry. */ + if (ehtab->srelplt != NULL) + { + s = ehtab->srelplt->output_section; + dyn.d_un.d_val -= s->size; + } + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_TLSDESC_PLT: + s = htab->root.splt; + dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset + + htab->dt_tlsdesc_plt); + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_TLSDESC_GOT: + s = htab->root.sgot; + dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset + + htab->dt_tlsdesc_got); + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; } } /* Fill in the first entry in the procedure linkage table. */ - splt = htab->root.splt; + splt = ehtab->splt; if (splt && splt->size > 0) { if (bfd_link_pic (info)) @@ -5624,13 +6866,11 @@ nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) long offset; /* FIXME, sda_base is 65536, it will damage opcode. */ - /* insn = PLT_PIC_ENTRY_WORD0 + (((got_offset - sda_base) >> 2) & 0x7fff); */ - offset = sgot->output_section->vma + sgot->output_offset + 4 - - elf_gp (output_bfd); + offset = sgotplt->output_section->vma + sgotplt->output_offset + 4 + - elf_gp (output_bfd); insn = PLT0_PIC_ENTRY_WORD0 | ((offset >> 12) & 0xfffff); bfd_putb32 (insn, splt->contents); - /* insn = PLT0_PIC_ENTRY_WORD0 | (((8 - sda_base) >> 2) & 0x7fff) ; */ /* here has a typo? */ insn = PLT0_PIC_ENTRY_WORD1 | (offset & 0xfff); bfd_putb32 (insn, splt->contents + 4); @@ -5652,8 +6892,8 @@ nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) unsigned long insn; unsigned long addr; - /* addr = .got + 4 */ - addr = sgot->output_section->vma + sgot->output_offset + 4; + /* addr = .got + 4 */ + addr = sgotplt->output_section->vma + sgotplt->output_offset + 4; insn = PLT0_ENTRY_WORD0 | ((addr >> 12) & 0xfffff); bfd_putb32 (insn, splt->contents); @@ -5673,21 +6913,48 @@ nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) elf_section_data (splt->output_section)->this_hdr.sh_entsize = PLT_ENTRY_SIZE; } + + if (htab->dt_tlsdesc_plt) + { + /* Calculate addresses. */ + asection *sgot = sgot = ehtab->sgot; + bfd_vma pltgot = sgotplt->output_section->vma + + sgotplt->output_offset; + bfd_vma tlsdesc_got = sgot->output_section->vma + sgot->output_offset + + htab->dt_tlsdesc_got; + + /* Get GP offset. */ + pltgot -= elf_gp (output_bfd) - 4; /* PLTGOT[1] */ + tlsdesc_got -= elf_gp (output_bfd); + + /* Do relocation. */ + dl_tlsdesc_lazy_trampoline[0] += ((1 << 20) - 1) & (tlsdesc_got >> 12); + dl_tlsdesc_lazy_trampoline[1] += 0xfff & tlsdesc_got; + dl_tlsdesc_lazy_trampoline[4] += ((1 << 20) - 1) & (pltgot >> 12); + dl_tlsdesc_lazy_trampoline[5] += 0xfff & pltgot; + + /* TODO: relaxation. */ + + /* Insert .plt. */ + nds32_put_trampoline (splt->contents + htab->dt_tlsdesc_plt, + dl_tlsdesc_lazy_trampoline, + ARRAY_SIZE (dl_tlsdesc_lazy_trampoline)); + } } /* Fill in the first three entries in the global offset table. */ - if (sgot && sgot->size > 0) + if (sgotplt && sgotplt->size > 0) { if (sdyn == NULL) - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, sgotplt->contents); else bfd_put_32 (output_bfd, sdyn->output_section->vma + sdyn->output_offset, - sgot->contents); - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 4); - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + 8); + sgotplt->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, sgotplt->contents + 4); + bfd_put_32 (output_bfd, (bfd_vma) 0, sgotplt->contents + 8); - elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; + elf_section_data (sgotplt->output_section)->this_hdr.sh_entsize = 4; } return TRUE; @@ -5738,6 +7005,7 @@ nds32_elf_final_write_processing (bfd *abfd, { unsigned long val; static unsigned int cur_mach = 0; + unsigned int i; if (bfd_mach_n1 != bfd_get_mach (abfd)) { @@ -5771,6 +7039,36 @@ nds32_elf_final_write_processing (bfd *abfd, elf_elfheader (abfd)->e_flags &= ~EF_NDS_ARCH; elf_elfheader (abfd)->e_flags |= val; + if (ifc_flag) + elf_elfheader (abfd)->e_flags |= E_NDS32_HAS_IFC_INST ; + + if (ict_file) + { + fprintf (ict_file, ".section " NDS32_ICT_SECTION ", \"ax\"\n"); + if (ict_model == R_NDS32_RELAX_ENTRY_ICT_LARGE) + fprintf (ict_file, ".ict_model\tlarge\n"); + else + fprintf (ict_file, ".ict_model\tsmall\n"); + fprintf (ict_file, ".globl _INDIRECT_CALL_TABLE_BASE_\n" + "_INDIRECT_CALL_TABLE_BASE_:\n"); + /* Output rom patch entries. */ + indirect_call_table.frozen = 1; + for (i = 0; i < indirect_call_table.size; i++) + { + struct bfd_hash_entry *p; + struct elf_nds32_ict_hash_entry *entry; + + for (p = indirect_call_table.table[i]; p != NULL; p = p->next) + { + entry = (struct elf_nds32_ict_hash_entry *) p; + if (ict_model == R_NDS32_RELAX_ENTRY_ICT_LARGE) + fprintf (ict_file, "\t.word\t%s\n", entry->root.string); + else + fprintf (ict_file, "\tj\t%s\n", entry->root.string); + } + } + indirect_call_table.frozen = 0; + } } /* Function to keep NDS32 specific file flags. */ @@ -5839,13 +7137,11 @@ nds32_check_vec_size (bfd *ibfd) nds32_vec_size = (flag_t & 0x3); else if (nds32_vec_size != (flag_t & 0x3)) { - _bfd_error_handler - /* xgettext:c-format */ - (_("%B: ISR vector size mismatch" - " with previous modules, previous %u-byte, current %u-byte"), - ibfd, - nds32_vec_size == 1 ? 4 : nds32_vec_size == 2 ? 16 : 0xffffffff, - (flag_t & 0x3) == 1 ? 4 : (flag_t & 0x3) == 2 ? 16 : 0xffffffff); + _bfd_error_handler (_("%pB: ISR vector size mismatch" + " with previous modules, previous %u-byte, current %u-byte"), + ibfd, + nds32_vec_size == 1 ? 4 : nds32_vec_size == 2 ? 16 : 0xffffffff, + (flag_t & 0x3) == 1 ? 4 : (flag_t & 0x3) == 2 ? 16 : 0xffffffff); return FALSE; } else @@ -5856,13 +7152,27 @@ nds32_check_vec_size (bfd *ibfd) return TRUE; } +static unsigned int +nds32_elf_force_to_set_output_abi (char *str) +{ + flagword flags; + + if (strcmp (str, "AABI") == 0) + flags = E_NDS_ABI_AABI; + else if (strcmp (str, "V2FP+") == 0) + flags = E_NDS_ABI_V2FP_PLUS; + else + flags = 0; + + return flags; +} + /* Merge backend specific data from an object file to the output object file when linking. */ static bfd_boolean nds32_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { - bfd *obfd = info->output_bfd; flagword out_flags; flagword in_flags; flagword out_16regs; @@ -5873,6 +7183,7 @@ nds32_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) flagword in_version; flagword out_fpu_config; flagword in_fpu_config; + bfd *obfd = info->output_bfd; /* TODO: Revise to use object-attributes instead. */ if (!nds32_check_vec_size (ibfd)) @@ -5885,141 +7196,177 @@ nds32_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (bfd_little_endian (ibfd) != bfd_little_endian (obfd)) { _bfd_error_handler - (_("%B: warning: Endian mismatch with previous modules."), ibfd); + (_("%pB: warning: Endian mismatch with previous modules."), ibfd); bfd_set_error (bfd_error_bad_value); return FALSE; } - in_version = elf_elfheader (ibfd)->e_flags & EF_NDS32_ELF_VERSION; - if (in_version == E_NDS32_ELF_VER_1_2) - { - _bfd_error_handler - (_("%B: warning: Older version of object file encountered, " - "Please recompile with current tool chain."), ibfd); - } - - /* We may need to merge V1 and V2 arch object files to V2. */ - if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) - != (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)) + /* [Bug 11585] [Ticket 7067] -B option in objcopy cannot work as expected. + e_flags = 0 shall be treat as generic one. + no checking, and no merging. */ + if (elf_elfheader (ibfd)->e_flags) { - /* Need to convert version. */ - if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) - == E_NDS_ARCH_STAR_RESERVED) + in_version = elf_elfheader (ibfd)->e_flags & EF_NDS32_ELF_VERSION; + if (in_version == E_NDS32_ELF_VER_1_2) { - elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + _bfd_error_handler + (_("%pB: warning: Older version of object file encountered, " + "Please recompile with current tool chain."), ibfd); } - else if ((elf_elfheader (obfd)->e_flags & EF_NDS_ARCH) == E_NDS_ARCH_STAR_V0_9 - || (elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) - > (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)) + + if (output_abi != NULL) { - elf_elfheader (obfd)->e_flags = - convert_e_flags (elf_elfheader (obfd)->e_flags, - (elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH)); + elf_elfheader (ibfd)->e_flags &= ~(EF_NDS_ABI); + elf_elfheader (ibfd)->e_flags + |= nds32_elf_force_to_set_output_abi (output_abi); + elf_elfheader (obfd)->e_flags &= ~(EF_NDS_ABI); + elf_elfheader (obfd)->e_flags + |= nds32_elf_force_to_set_output_abi (output_abi); } - else + + /* We may need to merge V1 and V2 arch object files to V2. */ + if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) + != (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)) { - elf_elfheader (ibfd)->e_flags = - convert_e_flags (elf_elfheader (ibfd)->e_flags, - (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)); - } - } - - /* Extract some flags. */ - in_flags = elf_elfheader (ibfd)->e_flags - & (~(E_NDS32_HAS_REDUCED_REGS | EF_NDS32_ELF_VERSION - | E_NDS32_HAS_NO_MAC_INST | E_NDS32_FPU_REG_CONF)); - - /* The following flags need special treatment. */ - in_16regs = elf_elfheader (ibfd)->e_flags & E_NDS32_HAS_REDUCED_REGS; - in_no_mac = elf_elfheader (ibfd)->e_flags & E_NDS32_HAS_NO_MAC_INST; - in_fpu_config = elf_elfheader (ibfd)->e_flags & E_NDS32_FPU_REG_CONF; - - /* Extract some flags. */ - out_flags = elf_elfheader (obfd)->e_flags - & (~(E_NDS32_HAS_REDUCED_REGS | EF_NDS32_ELF_VERSION - | E_NDS32_HAS_NO_MAC_INST | E_NDS32_FPU_REG_CONF)); - - /* The following flags need special treatment. */ - out_16regs = elf_elfheader (obfd)->e_flags & E_NDS32_HAS_REDUCED_REGS; - out_no_mac = elf_elfheader (obfd)->e_flags & E_NDS32_HAS_NO_MAC_INST; - out_fpu_config = elf_elfheader (obfd)->e_flags & E_NDS32_FPU_REG_CONF; - out_version = elf_elfheader (obfd)->e_flags & EF_NDS32_ELF_VERSION; - if (!elf_flags_init (obfd)) - { - /* If the input is the default architecture then do not - bother setting the flags for the output architecture, - instead allow future merges to do this. If no future - merges ever set these flags then they will retain their - unitialised values, which surprise surprise, correspond - to the default values. */ - if (bfd_get_arch_info (ibfd)->the_default) - return TRUE; + /* Need to convert version. */ + if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) + == E_NDS_ARCH_STAR_RESERVED) + { + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + } + else if ((elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) + == E_NDS_ARCH_STAR_V3_M + && (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH) + == E_NDS_ARCH_STAR_V3_0) + { + elf_elfheader (ibfd)->e_flags = + (elf_elfheader (ibfd)->e_flags & (~EF_NDS_ARCH)) + | E_NDS_ARCH_STAR_V3_0; + } + else if ((elf_elfheader (obfd)->e_flags & EF_NDS_ARCH) + == E_NDS_ARCH_STAR_V0_9 + || (elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH) + > (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)) + { + elf_elfheader (obfd)->e_flags = + convert_e_flags (elf_elfheader (obfd)->e_flags, + (elf_elfheader (ibfd)->e_flags & EF_NDS_ARCH)); + } + else + { + elf_elfheader (ibfd)->e_flags = + convert_e_flags (elf_elfheader (ibfd)->e_flags, + (elf_elfheader (obfd)->e_flags & EF_NDS_ARCH)); + } + } - elf_flags_init (obfd) = TRUE; - elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + /* Extract some flags. */ + in_flags = elf_elfheader (ibfd)->e_flags + & (~(E_NDS32_HAS_REDUCED_REGS | EF_NDS32_ELF_VERSION + | E_NDS32_HAS_NO_MAC_INST | E_NDS32_FPU_REG_CONF)); + + /* The following flags need special treatment. */ + in_16regs = elf_elfheader (ibfd)->e_flags & E_NDS32_HAS_REDUCED_REGS; + in_no_mac = elf_elfheader (ibfd)->e_flags & E_NDS32_HAS_NO_MAC_INST; + in_fpu_config = elf_elfheader (ibfd)->e_flags & E_NDS32_FPU_REG_CONF; + + /* Extract some flags. */ + out_flags = elf_elfheader (obfd)->e_flags + & (~(E_NDS32_HAS_REDUCED_REGS | EF_NDS32_ELF_VERSION + | E_NDS32_HAS_NO_MAC_INST | E_NDS32_FPU_REG_CONF)); + + /* The following flags need special treatment. */ + out_16regs = elf_elfheader (obfd)->e_flags & E_NDS32_HAS_REDUCED_REGS; + out_no_mac = elf_elfheader (obfd)->e_flags & E_NDS32_HAS_NO_MAC_INST; + out_fpu_config = elf_elfheader (obfd)->e_flags & E_NDS32_FPU_REG_CONF; + out_version = elf_elfheader (obfd)->e_flags & EF_NDS32_ELF_VERSION; + if (!elf_flags_init (obfd)) + { + /* If the input is the default architecture then do not + bother setting the flags for the output architecture, + instead allow future merges to do this. If no future + merges ever set these flags then they will retain their + unitialised values, which surprise surprise, correspond + to the default values. */ + if (bfd_get_arch_info (ibfd)->the_default) + return TRUE; - if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) - && bfd_get_arch_info (obfd)->the_default) - { - return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), - bfd_get_mach (ibfd)); + elf_flags_init (obfd) = TRUE; + elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), + bfd_get_mach (ibfd)); + } + + return TRUE; } - return TRUE; - } + /* Check flag compatibility. */ + if ((in_flags & EF_NDS_ABI) != (out_flags & EF_NDS_ABI)) + { + asection *section = NULL; + bfd_byte *contents = NULL; + section = bfd_get_section_by_name (ibfd, ".note.v2abi_compatible"); + if (section) + bfd_get_full_section_contents (ibfd, section, &contents); - /* Check flag compatibility. */ - if ((in_flags & EF_NDS_ABI) != (out_flags & EF_NDS_ABI)) - { - _bfd_error_handler - (_("%B: error: ABI mismatch with previous modules."), ibfd); + /* Only enable v3f/v3s toolchain to link v2abi compatible objects. */ + if ((contents == NULL) + || bfd_getb32 (contents) != 1 + || (out_flags & EF_NDS_ABI) != E_NDS_ABI_V2FP_PLUS) + { + _bfd_error_handler + (_("%pB: error: ABI mismatch with previous modules."), ibfd); - bfd_set_error (bfd_error_bad_value); - return FALSE; - } + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } - if ((in_flags & EF_NDS_ARCH) != (out_flags & EF_NDS_ARCH)) - { - if (((in_flags & EF_NDS_ARCH) != E_N1_ARCH)) + if ((in_flags & EF_NDS_ARCH) != (out_flags & EF_NDS_ARCH)) { - _bfd_error_handler - (_("%B: error: Instruction set mismatch with previous modules."), ibfd); + if (((in_flags & EF_NDS_ARCH) != E_N1_ARCH)) + { + _bfd_error_handler + (_("%pB: error: Instruction set mismatch with previous modules."), ibfd); - bfd_set_error (bfd_error_bad_value); - return FALSE; + bfd_set_error (bfd_error_bad_value); + return FALSE; + } } - } - /* When linking with V1.2 and V1.3 objects together the output is V1.2. - and perf ext1 and DIV are mergerd to perf ext1. */ - if (in_version == E_NDS32_ELF_VER_1_2 || out_version == E_NDS32_ELF_VER_1_2) - { - elf_elfheader (obfd)->e_flags = - (in_flags & (~(E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) - | (out_flags & (~(E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) - | (((in_flags & (E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) - ? E_NDS32_HAS_EXT_INST : 0) - | (((out_flags & (E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) - ? E_NDS32_HAS_EXT_INST : 0) - | (in_16regs & out_16regs) | (in_no_mac & out_no_mac) - | ((in_version > out_version) ? out_version : in_version); - } - else - { - if (in_version != out_version) - _bfd_error_handler - /* xgettext:c-format */ - (_("%B: warning: Incompatible elf-versions %s and %s."), - ibfd, nds32_elfver_strtab[out_version], - nds32_elfver_strtab[in_version]); + /* When linking with V1.2 and V1.3 objects together the output is V1.2. + and perf ext1 and DIV are mergerd to perf ext1. */ + if (in_version == E_NDS32_ELF_VER_1_2 || out_version == E_NDS32_ELF_VER_1_2) + { + elf_elfheader (obfd)->e_flags = + (in_flags & (~(E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) + | (out_flags & (~(E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) + | (((in_flags & (E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) + ? E_NDS32_HAS_EXT_INST : 0) + | (((out_flags & (E_NDS32_HAS_EXT_INST | E_NDS32_HAS_DIV_INST))) + ? E_NDS32_HAS_EXT_INST : 0) + | (in_16regs & out_16regs) | (in_no_mac & out_no_mac) + | ((in_version > out_version) ? out_version : in_version); + } + else + { + if (in_version != out_version) + _bfd_error_handler + (_("%pB: warning: Incompatible elf-versions %s and %s."), ibfd, + nds32_elfver_strtab[out_version], + nds32_elfver_strtab[in_version]); - elf_elfheader (obfd)->e_flags = in_flags | out_flags - | (in_16regs & out_16regs) | (in_no_mac & out_no_mac) - | (in_fpu_config > out_fpu_config ? in_fpu_config : out_fpu_config) - | (in_version > out_version ? out_version : in_version); + elf_elfheader (obfd)->e_flags = in_flags | out_flags + | (in_16regs & out_16regs) | (in_no_mac & out_no_mac) + | (in_fpu_config > out_fpu_config ? in_fpu_config : out_fpu_config) + | (in_version > out_version ? out_version : in_version); + } } - return TRUE; } @@ -6081,6 +7428,79 @@ nds32_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info, return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } +static enum elf_nds32_tls_type +get_tls_type (enum elf_nds32_reloc_type r_type, + struct elf_link_hash_entry *h ATTRIBUTE_UNUSED) +{ + enum elf_nds32_tls_type tls_type; + switch (r_type) + { + case R_NDS32_TLS_LE_HI20: + case R_NDS32_TLS_LE_LO12: + tls_type = GOT_TLS_LE; + break; + case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_IE_LO12: + tls_type = GOT_TLS_IE; + break; + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: + tls_type = GOT_TLS_IEGP; + break; + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + case R_NDS32_TLS_DESC_ADD: + case R_NDS32_TLS_DESC_FUNC: + case R_NDS32_TLS_DESC_CALL: + tls_type = GOT_TLS_DESC; + break; + default: + tls_type = GOT_NORMAL; + break; + } + return tls_type; +} + +/* Ensure that we have allocated bookkeeping structures for ABFD's local + symbols. */ + +static bfd_boolean +elf32_nds32_allocate_local_sym_info (bfd *abfd) +{ + if (elf_local_got_refcounts (abfd) == NULL) + { + bfd_size_type num_syms; + bfd_size_type size; + char *data; + + num_syms = elf_tdata (abfd)->symtab_hdr.sh_info; + /* This space is for got_refcounts, got_tls_type, tlsdesc_gotent, and + gp_offset. The details can refer to struct elf_nds32_obj_tdata. */ + size = num_syms * (sizeof (bfd_signed_vma) + sizeof (char) + + sizeof (bfd_vma) + sizeof (int) + + sizeof (bfd_boolean) + sizeof (bfd_vma)); + data = bfd_zalloc (abfd, size); + if (data == NULL) + return FALSE; + + elf_local_got_refcounts (abfd) = (bfd_signed_vma *) data; + data += num_syms * sizeof (bfd_signed_vma); + + elf32_nds32_local_got_tls_type (abfd) = (char *) data; + data += num_syms * sizeof (char); + + elf32_nds32_local_tlsdesc_gotent (abfd) = (bfd_vma *) data; + data += num_syms * sizeof (bfd_vma); + + elf32_nds32_local_gp_offset (abfd) = (int *) data; + data += num_syms * sizeof (int); + } + + return TRUE; +} + /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ @@ -6093,21 +7513,17 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; + struct elf_link_hash_table *ehtab; struct elf_nds32_link_hash_table *htab; bfd *dynobj; asection *sreloc = NULL; + /* No need for relocation if relocatable already. */ if (bfd_link_relocatable (info)) - return TRUE; - - /* Don't do anything special with non-loaded, non-alloced sections. - In particular, any relocs in such sections should not affect GOT - and PLT reference counting (ie. we don't allow them to create GOT - or PLT entries), there's no possibility or desire to optimize TLS - relocs, and there's not much point in propagating relocs to shared - libs that the dynamic linker won't relocate. */ - if ((sec->flags & SEC_ALLOC) == 0) - return TRUE; + { + elf32_nds32_check_relax_group (abfd, sec); + return TRUE; + } symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); @@ -6116,6 +7532,7 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; + ehtab = elf_hash_table (info); htab = nds32_elf_hash_table (info); dynobj = htab->root.dynobj; @@ -6125,7 +7542,8 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, enum elf_nds32_reloc_type r_type; struct elf_link_hash_entry *h; unsigned long r_symndx; - int tls_type, old_tls_type; + enum elf_nds32_tls_type tls_type, old_tls_type; + struct elf_nds32_ict_hash_entry *entry; r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); @@ -6139,10 +7557,11 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, h = (struct elf_link_hash_entry *) h->root.u.i.link; } - /* Some relocs require a global offset table. We create - got section here, since these relocation need got section - and it is not created yet. */ - if (htab->root.sgot == NULL) + /* create .got section if necessary + Some relocs require a global offset table. We create + got section here, since these relocation need a got section + and if it is not created yet. */ + if (ehtab->sgot == NULL) { switch (r_type) { @@ -6162,10 +7581,16 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_NDS32_GOTPC_LO12: case R_NDS32_GOT20: case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12: case R_NDS32_TLS_IE_LO12S2: + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: if (dynobj == NULL) htab->root.dynobj = dynobj = abfd; - if (!_bfd_elf_create_got_section (dynobj, info)) + if (!create_got_section (dynobj, info)) return FALSE; break; @@ -6174,59 +7599,54 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, } } + /* Check relocation type. */ switch ((int) r_type) { + case R_NDS32_TLS_LE_HI20: + case R_NDS32_TLS_LE_LO12: case R_NDS32_GOT_HI20: case R_NDS32_GOT_LO12: case R_NDS32_GOT_LO15: case R_NDS32_GOT_LO19: case R_NDS32_GOT20: case R_NDS32_TLS_IE_HI20: + case R_NDS32_TLS_IE_LO12: case R_NDS32_TLS_IE_LO12S2: - switch (r_type) - { - case R_NDS32_TLS_IE_HI20: - case R_NDS32_TLS_IE_LO12S2: - tls_type = GOT_TLS_IE; - break; - default: - tls_type = GOT_NORMAL; - break; - } - if (h != NULL) + case R_NDS32_TLS_IEGP_HI20: + case R_NDS32_TLS_IEGP_LO12: + case R_NDS32_TLS_IEGP_LO12S2: + case R_NDS32_TLS_DESC_HI20: + case R_NDS32_TLS_DESC_LO12: + tls_type = get_tls_type (r_type, h); + if (h) { + if (tls_type != GOT_TLS_LE) + h->got.refcount += 1; old_tls_type = elf32_nds32_hash_entry (h)->tls_type; - h->got.refcount += 1; } else { - bfd_signed_vma *local_got_refcounts; - - /* This is a global offset table entry for a local - symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); - if (local_got_refcounts == NULL) - { - bfd_size_type size; + /* This is a global offset table entry for a local symbol. */ + if (!elf32_nds32_allocate_local_sym_info (abfd)) + return FALSE; - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = (bfd_signed_vma *) bfd_zalloc (abfd, size); - if (local_got_refcounts == NULL) - return FALSE; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; + BFD_ASSERT (r_symndx < symtab_hdr->sh_info); + if (tls_type != GOT_TLS_LE) + elf_local_got_refcounts (abfd)[r_symndx] += 1; old_tls_type = elf32_nds32_local_got_tls_type (abfd)[r_symndx]; } - /* We will already have issued an error message if there + /* We would already issued an error message if there is a TLS/non-TLS mismatch, based on the symbol - type. So just combine any TLS types needed. */ + type. So just combine any TLS types needed. */ if (old_tls_type != GOT_UNKNOWN && old_tls_type != GOT_NORMAL && tls_type != GOT_NORMAL) tls_type |= old_tls_type; + /* DESC to IE/IEGP if link to executable */ + if ((tls_type & (GOT_TLS_DESC | GOT_TLS_IEGP)) && (bfd_link_executable (info))) + tls_type |= (bfd_link_pie (info) ? GOT_TLS_IEGP : GOT_TLS_IE); + if (old_tls_type != tls_type) { if (h != NULL) @@ -6235,6 +7655,7 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, elf32_nds32_local_got_tls_type (abfd)[r_symndx] = tls_type; } break; + case R_NDS32_9_PLTREL: case R_NDS32_25_PLTREL: case R_NDS32_PLTREL_HI20: @@ -6244,19 +7665,20 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_NDS32_PLT_GOTREL_LO15: case R_NDS32_PLT_GOTREL_LO19: case R_NDS32_PLT_GOTREL_LO20: - - /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, + /* This symbol requires a procedure linkage table entry. + We actually build the entry in adjust_dynamic_symbol, because this might be a case of linking PIC code without linking in any dynamic objects, in which case we don't need to generate a procedure linkage table after all. */ /* If this is a local symbol, we resolve it directly without creating a procedure linkage table entry. */ + /* explain: continue v.s. break here following: */ if (h == NULL) continue; - if (h->forced_local) + if (h->forced_local + || (bfd_link_pie (info) && h->def_regular)) break; elf32_nds32_hash_entry (h)->tls_type = GOT_NORMAL; @@ -6330,8 +7752,8 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, && (h->root.type == bfd_link_hash_defweak || !h->def_regular))) { - struct elf_dyn_relocs *p; - struct elf_dyn_relocs **head; + struct elf_nds32_dyn_relocs *p; + struct elf_nds32_dyn_relocs **head; if (dynobj == NULL) htab->root.dynobj = dynobj = abfd; @@ -6380,7 +7802,6 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, else { asection *s; - void *vpp; Elf_Internal_Sym *isym; isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); @@ -6392,15 +7813,15 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (s == NULL) return FALSE; - vpp = &elf_section_data (s)->local_dynrel; - head = (struct elf_dyn_relocs **) vpp; + head = ((struct elf_nds32_dyn_relocs **) + &elf_section_data (s)->local_dynrel); } p = *head; if (p == NULL || p->sec != sec) { bfd_size_type amt = sizeof (*p); - p = (struct elf_dyn_relocs *) bfd_alloc (dynobj, amt); + p = (struct elf_nds32_dyn_relocs *) bfd_alloc (dynobj, amt); if (p == NULL) return FALSE; p->next = *head; @@ -6411,13 +7832,92 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, } p->count += 1; + + /* FIXME: Since eh_frame is readonly, R_NDS32_32_RELA + reloc for eh_frame will cause shared library has + TEXTREL entry in the dynamic section. This lead glibc + testsuites to failure (bug-13092) and cause kernel fail + (bug-11819). I think the best solution is to replace + absolute reloc with pc relative reloc in the eh_frame. + To do that, we need to support the following issues: + + === For GCC === + * gcc/config/nds32/nds32.h: Define + ASM_PREFERRED_EH_DATA_FORMAT to encode DW_EH_PE_pcrel + and DW_EH_PE_sdata4 into DWARF exception header when + option have '-fpic'. + + === For binutils === + * bfd/: Define new reloc R_NDS32_32_PCREL_RELA. + * gas/config/tc-nds32.h: Define DIFF_EXPR_OK. This + may break our nds DIFF mechanism, therefore, we + must disable all linker relaxations to ensure + correctness. + * gas/config/tc-nds32.c (nds32_apply_fix): Replace + R_NDS32_32_RELA with R_NDS32_32_PCREL_RELA, and + do the necessary modification. + + Unfortunately, it still have some problems for nds32 + to support pc relative reloc in the eh_frame. So I use + another solution to fix this issue. + + However, I find that ld always emit TEXTREL marker for + R_NDS32_NONE relocs in rel.dyn. These none relocs are + correspond to R_NDS32_32_RELA for .eh_frame section. + It means that we always reserve redundant entries of rel.dyn + for these relocs which actually do nothing in dynamic linker. + + Therefore, we regard these relocs as pc relative relocs + here and increase the pc_count. */ if (ELF32_R_TYPE (rel->r_info) == R_NDS32_25_PCREL_RELA || ELF32_R_TYPE (rel->r_info) == R_NDS32_15_PCREL_RELA - || ELF32_R_TYPE (rel->r_info) == R_NDS32_17_PCREL_RELA) + || ELF32_R_TYPE (rel->r_info) == R_NDS32_17_PCREL_RELA + || (r_type == R_NDS32_32_RELA + && strcmp (sec->name, ".eh_frame") == 0)) p->pc_count += 1; } break; + /* Merge jump-patch table symbol here. */ + case R_NDS32_ICT_HI20: + case R_NDS32_ICT_LO12: + case R_NDS32_ICT_25PC: + if (rel->r_addend != 0) + { + _bfd_error_handler + (_("%pB %s: Error: Rom-patch relocation offset: 0x%lx " + "with addend 0x%lx\n"), + abfd, sec->name, rel->r_offset, rel->r_addend); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + if (h) + { + elf32_nds32_hash_entry (h)->indirect_call = TRUE; + entry = (struct elf_nds32_ict_hash_entry *) + bfd_hash_lookup (&indirect_call_table, h->root.root.string, + TRUE, TRUE); + entry->h = h; + if (entry == NULL) + { + _bfd_error_handler + (_("%pB: failed creating indirect call %s hash table\n"), + abfd, h->root.root.string); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } + else + { + /* Rom-patch functions cannot be local. */ + _bfd_error_handler + (_("%pB: indirect call relocation with local symbol.\n"), abfd); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + break; + /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_NDS32_RELA_GNU_VTINHERIT: @@ -6436,6 +7936,18 @@ nds32_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) return FALSE; break; + case R_NDS32_RELAX_ENTRY: + if (ict_model == 0) + ict_model = rel->r_addend & R_NDS32_RELAX_ENTRY_ICT_MASK; + else if (ict_model != (rel->r_addend & R_NDS32_RELAX_ENTRY_ICT_MASK) + && (rel->r_addend & R_NDS32_RELAX_ENTRY_ICT_MASK) != 0) + { + _bfd_error_handler + (_("%pB Error: mixed ict model objects.\n"), abfd); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + break; } } @@ -6464,8 +7976,7 @@ write_uleb128 (bfd_byte *p, unsigned int val) static bfd_signed_vma calculate_offset (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, - Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr, - int *pic_ext_target) + Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr) { bfd_signed_vma foff; bfd_vma symval, addend; @@ -6494,7 +8005,6 @@ calculate_offset (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, { unsigned long indx; struct elf_link_hash_entry *h; - bfd *owner; /* An external symbol. */ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; @@ -6507,9 +8017,6 @@ calculate_offset (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, symbol. Just ignore it--it will be caught by the regular reloc processing. */ return 0; - owner = h->root.u.def.section->owner; - if (owner && (elf_elfheader (owner)->e_flags & E_NDS32_HAS_PIC)) - *pic_ext_target = 1; if (h->root.u.def.section->flags & SEC_MERGE) { @@ -6563,15 +8070,15 @@ calculate_plt_memory_address (bfd *abfd, struct bfd_link_info *link_info, { unsigned long indx; struct elf_link_hash_entry *h; - struct elf_nds32_link_hash_table *htab; + struct elf_link_hash_table *ehtab; asection *splt; /* An external symbol. */ indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; h = elf_sym_hashes (abfd)[indx]; BFD_ASSERT (h != NULL); - htab = nds32_elf_hash_table (link_info); - splt = htab->root.splt; + ehtab = elf_hash_table (link_info); + splt = ehtab->splt; while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) @@ -6582,8 +8089,8 @@ calculate_plt_memory_address (bfd *abfd, struct bfd_link_info *link_info, if (h->root.type != bfd_link_hash_defined && h->root.type != bfd_link_hash_defweak) /* This appears to be a reference to an undefined - * symbol. Just ignore it--it will be caught by the - * regular reloc processing. */ + symbol. Just ignore it--it will be caught by the + regular reloc processing. */ return 0; symval = (h->root.u.def.value + h->root.u.def.section->output_section->vma @@ -6620,7 +8127,7 @@ nds32_convert_32_to_16_alu1 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, int *pinsn_type) { uint16_t insn16 = 0; - int insn_type = 0; + int insn_type; unsigned long mach = bfd_get_mach (abfd); if (N32_SH5 (insn) != 0) @@ -6919,8 +8426,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, else if (N32_IS_RT4 (insn) && N32_RT5 (insn) == N32_RA5 (insn) && N32_IMM15S (insn) > -32) { - insn16 = N16_TYPE45 (SUBI45, N32_RT54 (insn), - 0 - N32_IMM15S (insn)); + insn16 = N16_TYPE45 (SUBI45, N32_RT54 (insn), 0 - N32_IMM15S (insn)); insn_type = NDS32_INSN_SUBI45; } else if (mach >= MACH_V2 && N32_RT5 (insn) == REG_SP @@ -6981,7 +8487,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, if (__builtin_popcount (imm15u) == 1) { - /* BMSKI33 */ + /* BMSKI33 */ int imm3u = __builtin_ctz (imm15u); insn16 = N16_BFMI333 (BMSKI33, N32_RT5 (insn), imm3u); @@ -6989,7 +8495,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, } else if (imm15u != 0 && __builtin_popcount (imm15u + 1) == 1) { - /* FEXTI33 */ + /* FEXTI33 */ int imm3u = __builtin_ctz (imm15u + 1) - 1; insn16 = N16_BFMI333 (FEXTI33, N32_RT5 (insn), imm3u); @@ -7150,7 +8656,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, if ((insn & N32_BIT (14)) == 0) { - /* N32_BR1_BEQ */ + /* N32_BR1_BEQ */ if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5 && N32_RT5 (insn) != REG_R5) insn16 = N16_TYPE38 (BEQS38, N32_RT5 (insn), N32_IMM14S (insn)); @@ -7162,7 +8668,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, } else { - /* N32_BR1_BNE */ + /* N32_BR1_BNE */ if (N32_IS_RT3 (insn) && N32_RA5 (insn) == REG_R5 && N32_RT5 (insn) != REG_R5) insn16 = N16_TYPE38 (BNES38, N32_RT5 (insn), N32_IMM14S (insn)); @@ -7183,8 +8689,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, insn16 = N16_TYPE38 (BEQZ38, N32_RT5 (insn), N32_IMM16S (insn)); insn_type = NDS32_INSN_BEQZ38; } - else if (N32_RT5 (insn) == REG_R15 - && IS_WITHIN_S (N32_IMM16S (insn), 8)) + else if (N32_RT5 (insn) == REG_R15 && IS_WITHIN_S (N32_IMM16S (insn), 8)) { insn16 = N16_TYPE8 (BEQZS8, N32_IMM16S (insn)); insn_type = NDS32_INSN_BEQZS8; @@ -7197,16 +8702,15 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, insn16 = N16_TYPE38 (BNEZ38, N32_RT5 (insn), N32_IMM16S (insn)); insn_type = NDS32_INSN_BNEZ38; } - else if (N32_RT5 (insn) == REG_R15 - && IS_WITHIN_S (N32_IMM16S (insn), 8)) + else if (N32_RT5 (insn) == REG_R15 && IS_WITHIN_S (N32_IMM16S (insn), 8)) { insn16 = N16_TYPE8 (BNEZS8, N32_IMM16S (insn)); insn_type = NDS32_INSN_BNEZS8; } break; - case N32_BR2_IFCALL: - if (IS_WITHIN_U (N32_IMM16S (insn), 9)) + case N32_BR2_SOP0: + if (__GF (insn, 20, 5) == 0 && IS_WITHIN_U (N32_IMM16S (insn), 9)) { insn16 = N16_TYPE9 (IFCALL9, N32_IMM16S (insn)); insn_type = NDS32_INSN_IFCALL9; @@ -7218,7 +8722,7 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, case N32_OP6_JI: if ((insn & N32_BIT (24)) == 0) { - /* N32_JI_J */ + /* N32_JI_J */ if (IS_WITHIN_S (N32_IMM24S (insn), 8)) { insn16 = N16_TYPE8 (J8, N32_IMM24S (insn)); @@ -7236,19 +8740,19 @@ nds32_convert_32_to_16 (bfd *abfd, uint32_t insn, uint16_t *pinsn16, case N32_JREG_JR: if (N32_JREG_HINT (insn) == 0) { - /* jr */ + /* jr */ insn16 = N16_TYPE5 (JR5, N32_RB5 (insn)); insn_type = NDS32_INSN_JR5; } else if (N32_JREG_HINT (insn) == 1) { - /* ret */ + /* ret */ insn16 = N16_TYPE5 (RET5, N32_RB5 (insn)); insn_type = NDS32_INSN_RET5; } else if (N32_JREG_HINT (insn) == 3) { - /* ifret = mov55 $sp, $sp */ + /* ifret = mov55 $sp, $sp */ insn16 = N16_TYPE55 (MOV55, REG_SP, REG_SP); insn_type = NDS32_INSN_IFRET; } @@ -7347,184 +8851,162 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) switch (__GF (insn16, 9, 6)) { - case 0x4: /* add45 */ - insn = N32_ALU1 (ADD, N16_RT4 (insn16), N16_RT4 (insn16), - N16_RA5 (insn16)); + case 0x4: /* add45 */ + insn = N32_ALU1 (ADD, N16_RT4 (insn16), N16_RT4 (insn16), N16_RA5 (insn16)); goto done; - case 0x5: /* sub45 */ - insn = N32_ALU1 (SUB, N16_RT4 (insn16), N16_RT4 (insn16), - N16_RA5 (insn16)); + case 0x5: /* sub45 */ + insn = N32_ALU1 (SUB, N16_RT4 (insn16), N16_RT4 (insn16), N16_RA5 (insn16)); goto done; - case 0x6: /* addi45 */ - insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), - N16_IMM5U (insn16)); + case 0x6: /* addi45 */ + insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); goto done; - case 0x7: /* subi45 */ - insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), - -N16_IMM5U (insn16)); + case 0x7: /* subi45 */ + insn = N32_TYPE2 (ADDI, N16_RT4 (insn16), N16_RT4 (insn16), -N16_IMM5U (insn16)); goto done; - case 0x8: /* srai45 */ - insn = N32_ALU1 (SRAI, N16_RT4 (insn16), N16_RT4 (insn16), - N16_IMM5U (insn16)); + case 0x8: /* srai45 */ + insn = N32_ALU1 (SRAI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); goto done; - case 0x9: /* srli45 */ - insn = N32_ALU1 (SRLI, N16_RT4 (insn16), N16_RT4 (insn16), - N16_IMM5U (insn16)); + case 0x9: /* srli45 */ + insn = N32_ALU1 (SRLI, N16_RT4 (insn16), N16_RT4 (insn16), N16_IMM5U (insn16)); goto done; - case 0xa: /* slli333 */ - insn = N32_ALU1 (SLLI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + + case 0xa: /* slli333 */ + insn = N32_ALU1 (SLLI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0xc: /* add333 */ - insn = N32_ALU1 (ADD, N16_RT3 (insn16), N16_RA3 (insn16), - N16_RB3 (insn16)); + case 0xc: /* add333 */ + insn = N32_ALU1 (ADD, N16_RT3 (insn16), N16_RA3 (insn16), N16_RB3 (insn16)); goto done; - case 0xd: /* sub333 */ - insn = N32_ALU1 (SUB, N16_RT3 (insn16), N16_RA3 (insn16), - N16_RB3 (insn16)); + case 0xd: /* sub333 */ + insn = N32_ALU1 (SUB, N16_RT3 (insn16), N16_RA3 (insn16), N16_RB3 (insn16)); goto done; - case 0xe: /* addi333 */ - insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + case 0xe: /* addi333 */ + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0xf: /* subi333 */ - insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), - -N16_IMM3U (insn16)); + case 0xf: /* subi333 */ + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), N16_RA3 (insn16), -N16_IMM3U (insn16)); goto done; - case 0x10: /* lwi333 */ - insn = N32_TYPE2 (LWI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + + case 0x10: /* lwi333 */ + insn = N32_TYPE2 (LWI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0x12: /* lhi333 */ - insn = N32_TYPE2 (LHI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + case 0x12: /* lhi333 */ + insn = N32_TYPE2 (LHI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0x13: /* lbi333 */ - insn = N32_TYPE2 (LBI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + case 0x13: /* lbi333 */ + insn = N32_TYPE2 (LBI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0x11: /* lwi333.bi */ - insn = N32_TYPE2 (LWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + case 0x11: /* lwi333.bi */ + insn = N32_TYPE2 (LWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0x14: /* swi333 */ - insn = N32_TYPE2 (SWI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + case 0x14: /* swi333 */ + insn = N32_TYPE2 (SWI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0x16: /* shi333 */ - insn = N32_TYPE2 (SHI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + case 0x16: /* shi333 */ + insn = N32_TYPE2 (SHI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0x17: /* sbi333 */ - insn = N32_TYPE2 (SBI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + case 0x17: /* sbi333 */ + insn = N32_TYPE2 (SBI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0x15: /* swi333.bi */ - insn = N32_TYPE2 (SWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), - N16_IMM3U (insn16)); + case 0x15: /* swi333.bi */ + insn = N32_TYPE2 (SWI_BI, N16_RT3 (insn16), N16_RA3 (insn16), N16_IMM3U (insn16)); goto done; - case 0x18: /* addri36.sp */ - insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), REG_SP, - N16_IMM6U (insn16) << 2); + + case 0x18: /* addri36.sp */ + insn = N32_TYPE2 (ADDI, N16_RT3 (insn16), REG_SP, N16_IMM6U (insn16) << 2); goto done; - case 0x19: /* lwi45.fe */ - insn = N32_TYPE2 (LWI, N16_RT4 (insn16), REG_R8, - (N16_IMM5U (insn16) - 32)); + + case 0x19: /* lwi45.fe */ + insn = N32_TYPE2 (LWI, N16_RT4 (insn16), REG_R8, (N16_IMM5U (insn16) - 32)); goto done; - case 0x1a: /* lwi450 */ + case 0x1a: /* lwi450 */ insn = N32_TYPE2 (LWI, N16_RT4 (insn16), N16_RA5 (insn16), 0); goto done; - case 0x1b: /* swi450 */ + case 0x1b: /* swi450 */ insn = N32_TYPE2 (SWI, N16_RT4 (insn16), N16_RA5 (insn16), 0); goto done; - /* These are r15 implied instructions. */ - case 0x30: /* slts45 */ + /* These are r15 implied instructions. */ + case 0x30: /* slts45 */ insn = N32_ALU1 (SLTS, REG_TA, N16_RT4 (insn16), N16_RA5 (insn16)); goto done; - case 0x31: /* slt45 */ + case 0x31: /* slt45 */ insn = N32_ALU1 (SLT, REG_TA, N16_RT4 (insn16), N16_RA5 (insn16)); goto done; - case 0x32: /* sltsi45 */ + case 0x32: /* sltsi45 */ insn = N32_TYPE2 (SLTSI, REG_TA, N16_RT4 (insn16), N16_IMM5U (insn16)); goto done; - case 0x33: /* slti45 */ + case 0x33: /* slti45 */ insn = N32_TYPE2 (SLTI, REG_TA, N16_RT4 (insn16), N16_IMM5U (insn16)); goto done; - case 0x34: /* beqzs8, bnezs8 */ + case 0x34: /* beqzs8, bnezs8 */ if (insn16 & N32_BIT (8)) insn = N32_BR2 (BNEZ, REG_TA, N16_IMM8S (insn16)); else insn = N32_BR2 (BEQZ, REG_TA, N16_IMM8S (insn16)); goto done; - case 0x35: /* break16, ex9.it */ + case 0x35: /* break16, ex9.it */ /* Only consider range of v3 break16. */ insn = N32_TYPE0 (MISC, (N16_IMM5U (insn16) << 5) | N32_MISC_BREAK); goto done; - case 0x3c: /* ifcall9 */ - insn = N32_BR2 (IFCALL, 0, N16_IMM9U (insn16)); + case 0x3c: /* ifcall9 */ + insn = N32_BR2 (SOP0, 0, N16_IMM9U (insn16)); goto done; - case 0x3d: /* movpi45 */ + case 0x3d: /* movpi45 */ insn = N32_TYPE1 (MOVI, N16_RT4 (insn16), N16_IMM5U (insn16) + 16); goto done; - case 0x3f: /* MISC33 */ + case 0x3f: /* MISC33 */ switch (insn16 & 0x7) { - case 2: /* neg33 */ + case 2: /* neg33 */ insn = N32_TYPE2 (SUBRI, N16_RT3 (insn16), N16_RA3 (insn16), 0); break; - case 3: /* not33 */ - insn = N32_ALU1 (NOR, N16_RT3 (insn16), N16_RA3 (insn16), - N16_RA3 (insn16)); + case 3: /* not33 */ + insn = N32_ALU1 (NOR, N16_RT3 (insn16), N16_RA3 (insn16), N16_RA3 (insn16)); break; - case 4: /* mul33 */ - insn = N32_ALU2 (MUL, N16_RT3 (insn16), N16_RT3 (insn16), - N16_RA3 (insn16)); + case 4: /* mul33 */ + insn = N32_ALU2 (MUL, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); break; - case 5: /* xor33 */ - insn = N32_ALU1 (XOR, N16_RT3 (insn16), N16_RT3 (insn16), - N16_RA3 (insn16)); + case 5: /* xor33 */ + insn = N32_ALU1 (XOR, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); break; - case 6: /* and33 */ - insn = N32_ALU1 (AND, N16_RT3 (insn16), N16_RT3 (insn16), - N16_RA3 (insn16)); + case 6: /* and33 */ + insn = N32_ALU1 (AND, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); break; - case 7: /* or33 */ - insn = N32_ALU1 (OR, N16_RT3 (insn16), N16_RT3 (insn16), - N16_RA3 (insn16)); + case 7: /* or33 */ + insn = N32_ALU1 (OR, N16_RT3 (insn16), N16_RT3 (insn16), N16_RA3 (insn16)); break; } goto done; - case 0xb: + case 0xb: /* ... */ switch (insn16 & 0x7) { - case 0: /* zeb33 */ + case 0: /* zeb33 */ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 0xff); break; - case 1: /* zeh33 */ + case 1: /* zeh33 */ insn = N32_ALU1 (ZEH, N16_RT3 (insn16), N16_RA3 (insn16), 0); break; - case 2: /* seb33 */ + case 2: /* seb33 */ insn = N32_ALU1 (SEB, N16_RT3 (insn16), N16_RA3 (insn16), 0); break; - case 3: /* seh33 */ + case 3: /* seh33 */ insn = N32_ALU1 (SEH, N16_RT3 (insn16), N16_RA3 (insn16), 0); break; - case 4: /* xlsb33 */ + case 4: /* xlsb33 */ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 1); break; - case 5: /* x11b33 */ + case 5: /* x11b33 */ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RA3 (insn16), 0x7ff); break; - case 6: /* bmski33 */ + case 6: /* bmski33 */ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RT3 (insn16), 1 << __GF (insn16, 3, 3)); break; - case 7: /* fexti33 */ + case 7: /* fexti33 */ insn = N32_TYPE2 (ANDI, N16_RT3 (insn16), N16_RT3 (insn16), (1 << (__GF (insn16, 3, 3) + 1)) - 1); break; @@ -7534,70 +9016,70 @@ nds32_convert_16_to_32 (bfd *abfd, uint16_t insn16, uint32_t *pinsn) switch (__GF (insn16, 10, 5)) { - case 0x0: /* mov55 or ifret16 */ + case 0x0: /* mov55 or ifret16 */ if (mach >= MACH_V3 && N16_RT5 (insn16) == REG_SP && N16_RT5 (insn16) == N16_RA5 (insn16)) - insn = N32_JREG (JR, 0, 0, 0, 3); + insn = N32_JREG (JR, 0, 0, 0, 3); else - insn = N32_TYPE2 (ADDI, N16_RT5 (insn16), N16_RA5 (insn16), 0); + insn = N32_TYPE2 (ADDI, N16_RT5 (insn16), N16_RA5 (insn16), 0); goto done; - case 0x1: /* movi55 */ + case 0x1: /* movi55 */ insn = N32_TYPE1 (MOVI, N16_RT5 (insn16), N16_IMM5S (insn16)); goto done; - case 0x1b: /* addi10s (V2) */ + case 0x1b: /* addi10s (V2) */ insn = N32_TYPE2 (ADDI, REG_SP, REG_SP, N16_IMM10S (insn16)); goto done; } switch (__GF (insn16, 11, 4)) { - case 0x7: /* lwi37.fp/swi37.fp */ - if (insn16 & N32_BIT (7)) /* swi37.fp */ + case 0x7: /* lwi37.fp/swi37.fp */ + if (insn16 & N32_BIT (7)) /* swi37.fp */ insn = N32_TYPE2 (SWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16)); - else /* lwi37.fp */ + else /* lwi37.fp */ insn = N32_TYPE2 (LWI, N16_RT38 (insn16), REG_FP, N16_IMM7U (insn16)); goto done; - case 0x8: /* beqz38 */ + case 0x8: /* beqz38 */ insn = N32_BR2 (BEQZ, N16_RT38 (insn16), N16_IMM8S (insn16)); goto done; - case 0x9: /* bnez38 */ + case 0x9: /* bnez38 */ insn = N32_BR2 (BNEZ, N16_RT38 (insn16), N16_IMM8S (insn16)); goto done; - case 0xa: /* beqs38/j8, implied r5 */ + case 0xa: /* beqs38/j8, implied r5 */ if (N16_RT38 (insn16) == 5) insn = N32_JI (J, N16_IMM8S (insn16)); else insn = N32_BR1 (BEQ, N16_RT38 (insn16), REG_R5, N16_IMM8S (insn16)); goto done; - case 0xb: /* bnes38 and others */ + case 0xb: /* bnes38 and others */ if (N16_RT38 (insn16) == 5) { switch (__GF (insn16, 5, 3)) { - case 0: /* jr5 */ + case 0: /* jr5 */ insn = N32_JREG (JR, 0, N16_RA5 (insn16), 0, 0); break; - case 4: /* ret5 */ + case 4: /* ret5 */ insn = N32_JREG (JR, 0, N16_RA5 (insn16), 0, 1); break; - case 1: /* jral5 */ + case 1: /* jral5 */ insn = N32_JREG (JRAL, REG_LP, N16_RA5 (insn16), 0, 0); break; - case 2: /* ex9.it imm5 */ + case 2: /* ex9.it imm5 */ /* ex9.it had no 32-bit variantl. */ break; - case 5: /* add5.pc */ + case 5: /* add5.pc */ /* add5.pc had no 32-bit variantl. */ break; } } - else /* bnes38 */ + else /* bnes38 */ insn = N32_BR1 (BNE, N16_RT38 (insn16), REG_R5, N16_IMM8S (insn16)); goto done; - case 0xe: /* lwi37/swi37 */ - if (insn16 & (1 << 7)) /* swi37.sp */ + case 0xe: /* lwi37/swi37 */ + if (insn16 & (1 << 7)) /* swi37.sp */ insn = N32_TYPE2 (SWI, N16_RT38 (insn16), REG_SP, N16_IMM7U (insn16)); - else /* lwi37.sp */ + else /* lwi37.sp */ insn = N32_TYPE2 (LWI, N16_RT38 (insn16), REG_SP, N16_IMM7U (insn16)); goto done; } @@ -7650,19 +9132,19 @@ turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn) switch (N32_OP6 (insn)) { case N32_OP6_LBI: - /* lbi.gp */ + /* lbi.gp */ oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), 0); break; case N32_OP6_LBSI: - /* lbsi.gp */ + /* lbsi.gp */ oinsn = N32_TYPE1 (LBGP, N32_RT5 (insn), N32_BIT (19)); break; case N32_OP6_SBI: - /* sbi.gp */ + /* sbi.gp */ oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), 0); break; case N32_OP6_ORI: - /* addi.gp */ + /* addi.gp */ oinsn = N32_TYPE1 (SBGP, N32_RT5 (insn), N32_BIT (19)); break; } @@ -7672,15 +9154,15 @@ turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn) switch (N32_OP6 (insn)) { case N32_OP6_LHI: - /* lhi.gp */ + /* lhi.gp */ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), 0); break; case N32_OP6_LHSI: - /* lhsi.gp */ + /* lhsi.gp */ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), N32_BIT (18)); break; case N32_OP6_SHI: - /* shi.gp */ + /* shi.gp */ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), N32_BIT (19)); break; } @@ -7690,11 +9172,11 @@ turn_insn_to_sda_access (uint32_t insn, bfd_signed_vma type, uint32_t *pinsn) switch (N32_OP6 (insn)) { case N32_OP6_LWI: - /* lwi.gp */ + /* lwi.gp */ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (6, 17, 3)); break; case N32_OP6_SWI: - /* swi.gp */ + /* swi.gp */ oinsn = N32_TYPE1 (HWGP, N32_RT5 (insn), __MF (7, 17, 3)); break; } @@ -7835,7 +9317,7 @@ calculate_got_memory_address (bfd *abfd, struct bfd_link_info *link_info, bfd_vma *local_got_offsets; /* Get the value of the symbol referred to by the reloc. */ struct elf_link_hash_entry *h; - struct elf_nds32_link_hash_table *htab = nds32_elf_hash_table (link_info); + struct elf_link_hash_table *ehtab = elf_hash_table (link_info); /* An external symbol. */ symndx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; @@ -7847,18 +9329,13 @@ calculate_got_memory_address (bfd *abfd, struct bfd_link_info *link_info, if (symndx >= 0) { BFD_ASSERT (h != NULL); - return (htab->root.sgot->output_section->vma - + htab->root.sgot->output_offset - + h->got.offset); - } - else - { - local_got_offsets = elf_local_got_offsets (abfd); - BFD_ASSERT (local_got_offsets != NULL); - return (htab->root.sgot->output_section->vma - + htab->root.sgot->output_offset - + local_got_offsets[ELF32_R_SYM (irel->r_info)]); + return ehtab->sgot->output_section->vma + ehtab->sgot->output_offset + + h->got.offset; } + local_got_offsets = elf_local_got_offsets (abfd); + BFD_ASSERT (local_got_offsets != NULL); + return ehtab->sgot->output_section->vma + ehtab->sgot->output_offset + + local_got_offsets[ELF32_R_SYM (irel->r_info)]; /* The _GLOBAL_OFFSET_TABLE_ may be undefweak(or should be?). */ /* The check of h->root.type is passed. */ @@ -7899,7 +9376,6 @@ is_convert_32_to_16 (bfd *abfd, asection *sec, bfd_vma mem_addr; uint32_t insn = 0; Elf_Internal_Rela *pc_rel; - int pic_ext_target = 0; Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Sym *isymbuf = NULL; int convert_type; @@ -7938,8 +9414,7 @@ is_convert_32_to_16 (bfd *abfd, asection *sec, || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PCREL_RELA || ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_25_PLTREL) { - off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr, - &pic_ext_target); + off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr); if (off >= ACCURATE_8BIT_S1 || off < -ACCURATE_8BIT_S1 || off == 0) return FALSE; @@ -7948,10 +9423,8 @@ is_convert_32_to_16 (bfd *abfd, asection *sec, else if (ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_20_RELA) { /* movi => movi55 */ - mem_addr = calculate_memory_address (abfd, pc_rel, isymbuf, - symtab_hdr); - /* mem_addr is unsigned, but the value should - be between [-16, 15]. */ + mem_addr = calculate_memory_address (abfd, pc_rel, isymbuf, symtab_hdr); + /* mem_addr is unsigned, but the value should be between [-16, 15]. */ if ((mem_addr + 0x10) >> 5) return FALSE; break; @@ -7980,14 +9453,12 @@ is_convert_32_to_16 (bfd *abfd, asection *sec, || ((ELF32_R_TYPE (pc_rel->r_info) > R_NDS32_LOADSTORE) && (ELF32_R_TYPE (pc_rel->r_info) < R_NDS32_DWARF2_OP1_RELA))) { - /* Prevent unresolved addi instruction translate - to addi45 or addi333. */ + /* Prevent unresolved addi instruction translate to addi45 or addi333. */ return FALSE; } else if ((ELF32_R_TYPE (pc_rel->r_info) == R_NDS32_17IFC_PCREL_RELA)) { - off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr, - &pic_ext_target); + off = calculate_offset (abfd, sec, pc_rel, isymbuf, symtab_hdr); if (off >= ACCURATE_U9BIT_S1 || off <= 0) return FALSE; break; @@ -8085,7 +9556,7 @@ static Elf_Internal_Rela * find_relocs_at_address_addr (Elf_Internal_Rela *reloc, Elf_Internal_Rela *relocs, Elf_Internal_Rela *irelend, - enum elf_nds32_reloc_type reloc_type, + unsigned char reloc_type, bfd_vma offset_p) { Elf_Internal_Rela *rel_t = NULL; @@ -8281,8 +9752,9 @@ insert_nds32_elf_blank (nds32_elf_blank_t **blank_p, bfd_vma addr, bfd_vma len) if (addr < blank_t->offset + blank_t->size) { - if (addr > blank_t->offset + blank_t->size) - blank_t->size = addr - blank_t->offset; + /* Extend the origin blank. */ + if (addr + len > blank_t->offset + blank_t->size) + blank_t->size = addr + len - blank_t->offset; } else { @@ -8414,7 +9886,7 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, /* Relocations MUST be kept in memory, because relaxation adjust them. */ internal_relocs = _bfd_elf_link_read_relocs (abfd, sect, NULL, NULL, - TRUE /* keep_memory */); + TRUE /* keep_memory */); irelend = internal_relocs + sect->reloc_count; blank_t = blank_head; @@ -8436,7 +9908,7 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, unsigned long val = 0; unsigned long mask; long before, between; - long offset = 0; + long offset; switch (ELF32_R_TYPE (irel->r_info)) { @@ -8468,28 +9940,23 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, -- before ---| ***************** --------------------- between ---| - We only care how much data are relax between DIFF, - marked as ***. */ + We only care how much data are relax between DIFF, marked as ***. */ before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0); - between = get_nds32_elf_blank_total (&blank_t, - irel->r_addend + offset, 0); + between = get_nds32_elf_blank_total (&blank_t, irel->r_addend + offset, 0); if (between == before) goto done_adjust_diff; switch (ELF32_R_TYPE (irel->r_info)) { case R_NDS32_DIFF8: - bfd_put_8 (abfd, offset - (between - before), - contents + irel->r_offset); + bfd_put_8 (abfd, offset - (between - before), contents + irel->r_offset); break; case R_NDS32_DIFF16: - bfd_put_16 (abfd, offset - (between - before), - contents + irel->r_offset); + bfd_put_16 (abfd, offset - (between - before), contents + irel->r_offset); break; case R_NDS32_DIFF32: - bfd_put_32 (abfd, offset - (between - before), - contents + irel->r_offset); + bfd_put_32 (abfd, offset - (between - before), contents + irel->r_offset); break; } } @@ -8501,12 +9968,10 @@ nds32_elf_relax_delete_blanks (bfd *abfd, asection *sec, unsigned long before, between; bfd_byte *endp, *p; - val = _bfd_read_unsigned_leb128 (abfd, contents + irel->r_offset, - &len); + val = _bfd_read_unsigned_leb128 (abfd, contents + irel->r_offset, &len); before = get_nds32_elf_blank_total (&blank_t, irel->r_addend, 0); - between = get_nds32_elf_blank_total (&blank_t, - irel->r_addend + val, 0); + between = get_nds32_elf_blank_total (&blank_t, irel->r_addend + val, 0); if (between == before) goto done_adjust_diff; @@ -8523,16 +9988,14 @@ done_adjust_diff: if (sec == sect) { raddr = irel->r_offset; - irel->r_offset -= get_nds32_elf_blank_total (&blank_t2, - irel->r_offset, 1); + irel->r_offset -= get_nds32_elf_blank_total (&blank_t2, irel->r_offset, 1); if (ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE) continue; if (blank_t2 && blank_t2->next - && (blank_t2->offset > raddr - || blank_t2->next->offset <= raddr)) - _bfd_error_handler - (_("%B: Error: search_nds32_elf_blank reports wrong node\n"), abfd); + && (blank_t2->offset > raddr || blank_t2->next->offset <= raddr)) + _bfd_error_handler (_("%pB: %s\n"), abfd, + "Error: search_nds32_elf_blank reports wrong node"); /* Mark reloc in deleted portion as NONE. For some relocs like R_NDS32_LABEL that doesn't modify the @@ -8584,11 +10047,9 @@ done_adjust_diff: isym->st_value -= ahead; /* Adjust function size. */ - if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC - && isym->st_size > 0) - isym->st_size -= - get_nds32_elf_blank_total - (&blank_t, orig_addr + isym->st_size, 0) - ahead; + if (ELF32_ST_TYPE (isym->st_info) == STT_FUNC && isym->st_size > 0) + isym->st_size -= get_nds32_elf_blank_total + (&blank_t, orig_addr + isym->st_size, 0) - ahead; } } } @@ -8617,9 +10078,8 @@ done_adjust_diff: /* Adjust function size. */ if (sym_hash->type == STT_FUNC) - sym_hash->size -= - get_nds32_elf_blank_total - (&blank_t, orig_addr + sym_hash->size, 0) - ahead; + sym_hash->size -= get_nds32_elf_blank_total + (&blank_t, orig_addr + sym_hash->size, 0) - ahead; } } @@ -8743,7 +10203,7 @@ relax_range_measurement (bfd *abfd) bfd_vma align; static int decide_relax_range = 0; int i; - int range_number = sizeof (sdata_init_range) / sizeof (sdata_init_range[0]); + int range_number = ARRAY_SIZE (sdata_init_range); if (decide_relax_range) return; @@ -8789,11 +10249,7 @@ relax_range_measurement (bfd *abfd) #define IS_OPTIMIZE(addend) ((addend) & 0x40000000) #define IS_16BIT_ON(addend) ((addend) & 0x20000000) -static const char * unrecognized_reloc_msg = - /* xgettext:c-format */ - N_("%B: warning: %s points to unrecognized reloc at %#Lx"); - -/* Relax LONGCALL1 relocation for nds32_elf_relax_section. */ +/* Relax LONGCALL1 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longcall1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -8803,19 +10259,19 @@ nds32_elf_relax_longcall1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, { /* There are 3 variations for LONGCALL1 case 4-4-2; 16-bit on, optimize off or optimize for space - sethi ta, hi20(symbol) ; LONGCALL1/HI20 + sethi ta, hi20(symbol) ; LONGCALL1/HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jral5 ta ; + jral5 ta ; case 4-4-4; 16-bit off, optimize don't care - sethi ta, hi20(symbol) ; LONGCALL1/HI20 + sethi ta, hi20(symbol) ; LONGCALL1/HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jral ta ; + jral ta ; case 4-4-4; 16-bit on, optimize for speed - sethi ta, hi20(symbol) ; LONGCALL1/HI20 + sethi ta, hi20(symbol) ; LONGCALL1/HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jral ta ; + jral ta ; Check code for -mlong-calls output. */ /* Get the reloc for the address from which the register is @@ -8826,7 +10282,6 @@ nds32_elf_relax_longcall1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, int seq_len; /* Original length of instruction sequence. */ uint32_t insn; Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *irelend; - int pic_ext_target = 0; bfd_signed_vma foff; uint16_t insn16; @@ -8843,21 +10298,21 @@ nds32_elf_relax_longcall1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (hi_irelfn == irelend || lo_irelfn == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGCALL1", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL1 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr); /* This condition only happened when symbol is undefined. */ - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1) return FALSE; - /* Relax to: jal symbol; 25_PCREL */ + /* Relax to: jal symbol; 25_PCREL */ /* For simplicity of coding, we are going to modify the section contents, the section relocs, and the BFD symbol table. We must tell the rest of the code not to free up this @@ -8894,7 +10349,7 @@ nds32_elf_relax_longcall1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, } #define CONVERT_CONDITION_CALL(insn) (((insn) & 0xffff0000) ^ 0x90000) -/* Relax LONGCALL2 relocation for nds32_elf_relax_section. */ +/* Relax LONGCALL2 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longcall2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -8904,7 +10359,7 @@ nds32_elf_relax_longcall2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, { /* bltz rt, .L1 ; LONGCALL2 jal symbol ; 25_PCREL - .L1: */ + .L1: */ /* Get the reloc for the address from which the register is being loaded. This reloc will tell us which function is @@ -8913,7 +10368,6 @@ nds32_elf_relax_longcall2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, bfd_vma laddr; uint32_t insn; Elf_Internal_Rela *i1_irelfn, *cond_irelfn, *irelend; - int pic_ext_target = 0; bfd_signed_vma foff; irelend = internal_relocs + sec->reloc_count; @@ -8924,23 +10378,23 @@ nds32_elf_relax_longcall2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (i1_irelfn == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGCALL2", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL2 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } insn = bfd_getb32 (contents + laddr); /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, i1_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, i1_irelfn, isymbuf, symtab_hdr); if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 || foff >= CONSERVATIVE_16BIT_S1) return FALSE; /* Relax to bgezal rt, label ; 17_PCREL - or bltzal rt, label ; 17_PCREL */ + or bltzal rt, label ; 17_PCREL */ /* Convert to complimentary conditional call. */ insn = CONVERT_CONDITION_CALL (insn); @@ -8974,7 +10428,7 @@ nds32_elf_relax_longcall2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGCALL3 relocation for nds32_elf_relax_section. */ +/* Relax LONGCALL3 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -8984,25 +10438,25 @@ nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, { /* There are 3 variations for LONGCALL3 case 4-4-4-2; 16-bit on, optimize off or optimize for space - bltz rt, $1 ; LONGCALL3 - sethi ta, hi20(symbol) ; HI20 + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jral5 ta ; + jral5 ta ; $1 case 4-4-4-4; 16-bit off, optimize don't care - bltz rt, $1 ; LONGCALL3 - sethi ta, hi20(symbol) ; HI20 + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jral ta ; + jral ta ; $1 case 4-4-4-4; 16-bit on, optimize for speed - bltz rt, $1 ; LONGCALL3 - sethi ta, hi20(symbol) ; HI20 + bltz rt, $1 ; LONGCALL3 + sethi ta, hi20(symbol) ; HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jral ta ; - $1 */ + jral ta ; + $1 */ /* Get the reloc for the address from which the register is being loaded. This reloc will tell us which function is @@ -9012,7 +10466,6 @@ nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, int seq_len; /* Original length of instruction sequence. */ uint32_t insn; Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *cond_irelfn, *irelend; - int pic_ext_target = 0; bfd_signed_vma foff; uint16_t insn16; @@ -9030,16 +10483,16 @@ nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (hi_irelfn == irelend || lo_irelfn == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGCALL3", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL3 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr); - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1) return FALSE; @@ -9047,7 +10500,7 @@ nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) { /* Relax to bgezal rt, label ; 17_PCREL - or bltzal rt, label ; 17_PCREL */ + or bltzal rt, label ; 17_PCREL */ /* Convert to complimentary conditional call. */ insn = CONVERT_CONDITION_CALL (insn); @@ -9112,7 +10565,7 @@ nds32_elf_relax_longcall3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGJUMP1 relocation for nds32_elf_relax_section. */ +/* Relax LONGJUMP1 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longjump1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -9122,19 +10575,19 @@ nds32_elf_relax_longjump1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, { /* There are 3 variations for LONGJUMP1 case 4-4-2; 16-bit bit on, optimize off or optimize for space - sethi ta, hi20(symbol) ; LONGJUMP1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr5 ta ; + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr5 ta ; case 4-4-4; 16-bit off, optimize don't care - sethi ta, hi20(symbol) ; LONGJUMP1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr ta ; + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; case 4-4-4; 16-bit on, optimize for speed - sethi ta, hi20(symbol) ; LONGJUMP1/HI20 - ori ta, ta, lo12(symbol) ; LO12S0 - jr ta ; */ + sethi ta, hi20(symbol) ; LONGJUMP1/HI20 + ori ta, ta, lo12(symbol) ; LO12S0 + jr ta ; */ /* Get the reloc for the address from which the register is being loaded. This reloc will tell us which function is @@ -9145,7 +10598,6 @@ nds32_elf_relax_longjump1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, int insn16_on; /* 16-bit on/off. */ uint32_t insn; Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *irelend; - int pic_ext_target = 0; bfd_signed_vma foff; uint16_t insn16; unsigned long reloc; @@ -9164,23 +10616,23 @@ nds32_elf_relax_longjump1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, R_NDS32_LO12S0_ORI_RELA, laddr + 4); if (hi_irelfn == irelend || lo_irelfn == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGJUMP1", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGJUMP1 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr); - if (pic_ext_target || foff == 0 || foff >= CONSERVATIVE_24BIT_S1 + if (foff == 0 || foff >= CONSERVATIVE_24BIT_S1 || foff < -CONSERVATIVE_24BIT_S1) return FALSE; if (insn16_on && foff >= -ACCURATE_8BIT_S1 && foff < ACCURATE_8BIT_S1 && (seq_len & 0x2)) { - /* j8 label */ + /* j8 label */ /* 16-bit on, but not optimized for speed. */ reloc = R_NDS32_9_PCREL_RELA; insn16 = INSN_J8; @@ -9191,7 +10643,7 @@ nds32_elf_relax_longjump1 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, } else { - /* j label */ + /* j label */ reloc = R_NDS32_25_PCREL_RELA; insn = INSN_J; bfd_putb32 (insn, contents + irel->r_offset); @@ -9275,14 +10727,14 @@ nds32_elf_convert_branch (uint16_t insn16, uint32_t insn, switch ((insn16 & 0xf000) >> 12) { case 0xc: - /* beqz38 or bnez38 */ + /* beqz38 or bnez38 */ comp_insn16 = (insn16 ^ 0x0800) & 0xff00; comp_insn = (comp_insn16 & 0x0800) ? INSN_BNEZ : INSN_BEQZ; comp_insn |= ((comp_insn16 & 0x0700) >> 8) << 20; break; case 0xd: - /* beqs38 or bnes38 */ + /* beqs38 or bnes38 */ comp_insn16 = (insn16 ^ 0x0800) & 0xff00; comp_insn = (comp_insn16 & 0x0800) ? INSN_BNE : INSN_BEQ; comp_insn |= (((comp_insn16 & 0x0700) >> 8) << 20) @@ -9290,7 +10742,7 @@ nds32_elf_convert_branch (uint16_t insn16, uint32_t insn, break; case 0xe: - /* beqzS8 or bnezS8 */ + /* beqzS8 or bnezS8 */ comp_insn16 = (insn16 ^ 0x0100) & 0xff00; comp_insn = (comp_insn16 & 0x0100) ? INSN_BNEZ : INSN_BEQZ; comp_insn |= REG_R15 << 20; @@ -9306,7 +10758,7 @@ nds32_elf_convert_branch (uint16_t insn16, uint32_t insn, *re_insn16 = comp_insn16; } -/* Relax LONGJUMP2 relocation for nds32_elf_relax_section. */ +/* Relax LONGJUMP2 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -9329,7 +10781,7 @@ nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, case 4-4; 1st insn convertible, 16-bit on, optimize for speed bne rt, ra, $1 ; LONGJUMP2 j label ; 25_PCREL - $1: */ + $1: */ /* Get the reloc for the address from which the register is being loaded. This reloc will tell us which function is @@ -9338,7 +10790,7 @@ nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, bfd_vma laddr; int seq_len; /* Original length of instruction sequence. */ Elf_Internal_Rela *i2_irelfn, *cond_irelfn, *irelend; - int pic_ext_target = 0, first_size; + int first_size; unsigned int i; bfd_signed_vma foff; uint32_t insn, re_insn = 0; @@ -9359,7 +10811,7 @@ nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, irelend, R_NDS32_25_PCREL_RELA, laddr + first_size); - for (i = 0; i < sizeof (checked_types) / sizeof(checked_types[0]); i++) + for (i = 0; i < ARRAY_SIZE (checked_types); i++) { cond_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, @@ -9370,16 +10822,16 @@ nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (i2_irelfn == irelend || cond_irelfn == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGJUMP2", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGJUMP2 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ foff = - calculate_offset (abfd, sec, i2_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + calculate_offset (abfd, sec, i2_irelfn, isymbuf, symtab_hdr); + if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 || foff >= CONSERVATIVE_16BIT_S1) return FALSE; @@ -9422,7 +10874,7 @@ nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, && (foff >= -(ACCURATE_14BIT_S1 - first_size) && foff < ACCURATE_14BIT_S1 - first_size)) { - /* beqs label ; 15_PCREL */ + /* beqs label ; 15_PCREL */ bfd_putb32 (re_insn, contents + irel->r_offset); *insn_len = 4; reloc = R_NDS32_15_PCREL_RELA; @@ -9432,7 +10884,7 @@ nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) { - /* beqz label ; 17_PCREL */ + /* beqz label ; 17_PCREL */ bfd_putb32 (re_insn, contents + irel->r_offset); *insn_len = 4; reloc = R_NDS32_17_PCREL_RELA; @@ -9465,7 +10917,7 @@ nds32_elf_relax_longjump2 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGJUMP3 relocation for nds32_elf_relax_section. */ +/* Relax LONGJUMP3 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -9476,42 +10928,42 @@ nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, /* There are 5 variations for LONGJUMP3 case 1: 2-4-4-2; 1st insn convertible, 16-bit on, optimize off or optimize for space - bnes38 rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 + bnes38 rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jr5 ta ; - $1: ; + jr5 ta ; + $1: ; case 2: 2-4-4-2; 1st insn convertible, 16-bit on, optimize for speed - bnes38 rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 + bnes38 rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jr5 ta ; - $1: ; LABEL + jr5 ta ; + $1: ; LABEL case 3: 4-4-4-2; 1st insn not convertible, 16-bit on, optimize off or optimize for space - bne rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jr5 ta ; - $1: ; + jr5 ta ; + $1: ; case 4: 4-4-4-4; 1st insn don't care, 16-bit off, optimize don't care 16-bit off if no INSN16 - bne rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jr ta ; - $1: ; + jr ta ; + $1: ; case 5: 4-4-4-4; 1st insn not convertible, 16-bit on, optimize for speed 16-bit off if no INSN16 - bne rt, ra, $1 ; LONGJUMP3 - sethi ta, hi20(symbol) ; HI20 + bne rt, ra, $1 ; LONGJUMP3 + sethi ta, hi20(symbol) ; HI20 ori ta, ta, lo12(symbol) ; LO12S0 - jr ta ; - $1: ; LABEL */ + jr ta ; + $1: ; LABEL */ /* Get the reloc for the address from which the register is being loaded. This reloc will tell us which function is @@ -9523,7 +10975,7 @@ nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, bfd_vma laddr; int seq_len; /* Original length of instruction sequence. */ Elf_Internal_Rela *hi_irelfn, *lo_irelfn, *cond_irelfn, *irelend; - int pic_ext_target = 0, first_size; + int first_size; unsigned int i; bfd_signed_vma foff; uint32_t insn, re_insn = 0; @@ -9551,7 +11003,7 @@ nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, R_NDS32_LO12S0_ORI_RELA, laddr + first_size + 4); - for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++) + for (i = 0; i < ARRAY_SIZE (checked_types); i++) { cond_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, @@ -9562,16 +11014,16 @@ nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (hi_irelfn == irelend || lo_irelfn == irelend || cond_irelfn == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGJUMP3", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGJUMP3 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, hi_irelfn, isymbuf, symtab_hdr); - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1) return FALSE; @@ -9624,7 +11076,7 @@ nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, && (foff >= -(ACCURATE_14BIT_S1 - first_size) && foff < ACCURATE_14BIT_S1 - first_size)) { - /* beqs label ; 15_PCREL */ + /* beqs label ; 15_PCREL */ bfd_putb32 (re_insn, contents + irel->r_offset); *insn_len = 4; reloc = R_NDS32_15_PCREL_RELA; @@ -9635,7 +11087,7 @@ nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) { - /* beqz label ; 17_PCREL */ + /* beqz label ; 17_PCREL */ bfd_putb32 (re_insn, contents + irel->r_offset); *insn_len = 4; reloc = R_NDS32_17_PCREL_RELA; @@ -9661,7 +11113,7 @@ nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, case 4-4; 1st insn convertible, 16-bit on, optimize for speed bne rt, ra, $1 ; LONGJUMP2 j label ; 25_PCREL - $1 */ + $1 */ /* Offset for first instruction. */ @@ -9711,7 +11163,7 @@ nds32_elf_relax_longjump3 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGCALL4 relocation for nds32_elf_relax_section. */ +/* Relax LONGCALL4 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longcall4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -9728,7 +11180,6 @@ nds32_elf_relax_longcall4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, uint32_t insn; Elf_Internal_Rela *hi_irel, *ptr_irel, *insn_irel, *em_irel, *call_irel; Elf_Internal_Rela *irelend; - int pic_ext_target = 0; bfd_signed_vma foff; irelend = internal_relocs + sec->reloc_count; @@ -9742,21 +11193,21 @@ nds32_elf_relax_longcall4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (hi_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGCALL4", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL4 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr); /* This condition only happened when symbol is undefined. */ - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1) return FALSE; - /* Relax to: jal symbol; 25_PCREL */ + /* Relax to: jal symbol; 25_PCREL */ /* For simplicity of coding, we are going to modify the section contents, the section relocs, and the BFD symbol table. We must tell the rest of the code not to free up this @@ -9772,8 +11223,9 @@ nds32_elf_relax_longcall4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (ptr_irel == irelend || em_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGCALL4", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL4 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Check these is enough space to insert jal in R_NDS32_EMPTY. */ @@ -9812,7 +11264,7 @@ nds32_elf_relax_longcall4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGCALL5 relocation for nds32_elf_relax_section. */ +/* Relax LONGCALL5 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longcall5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -9828,7 +11280,6 @@ nds32_elf_relax_longcall5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, bfd_vma laddr; uint32_t insn; Elf_Internal_Rela *cond_irel, *irelend; - int pic_ext_target = 0; bfd_signed_vma foff; irelend = internal_relocs + sec->reloc_count; @@ -9843,21 +11294,21 @@ nds32_elf_relax_longcall5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, R_NDS32_25_PCREL_RELA, irel->r_addend); if (cond_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGCALL5", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL5 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr); if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 || foff >= CONSERVATIVE_16BIT_S1) return FALSE; /* Relax to bgezal rt, label ; 17_PCREL - or bltzal rt, label ; 17_PCREL */ + or bltzal rt, label ; 17_PCREL */ /* Convert to complimentary conditional call. */ insn = CONVERT_CONDITION_CALL (insn); @@ -9889,7 +11340,7 @@ nds32_elf_relax_longcall5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGCALL6 relocation for nds32_elf_relax_section. */ +/* Relax LONGCALL6 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -9907,7 +11358,6 @@ nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, bfd_vma laddr; uint32_t insn; Elf_Internal_Rela *em_irel, *cond_irel, *irelend; - int pic_ext_target = 0; bfd_signed_vma foff; irelend = internal_relocs + sec->reloc_count; @@ -9921,16 +11371,16 @@ nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (em_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGCALL6", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL6 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr); - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1) return FALSE; @@ -9943,7 +11393,7 @@ nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) { /* Relax to bgezal rt, label ; 17_PCREL - or bltzal rt, label ; 17_PCREL */ + or bltzal rt, label ; 17_PCREL */ /* Convert to complimentary conditional call. */ *insn_len = 0; @@ -9959,8 +11409,9 @@ nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, R_NDS32_PTR_RESOLVED, irel->r_addend); if (cond_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, - "R_NDS32_LONGCALL6", irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL6 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } cond_irel->r_addend = 1; @@ -10008,8 +11459,9 @@ nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, R_NDS32_PTR_RESOLVED, irel->r_addend); if (cond_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, - "R_NDS32_LONGCALL6", irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGCALL6 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } cond_irel->r_addend = 1; @@ -10024,7 +11476,7 @@ nds32_elf_relax_longcall6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGJUMP4 relocation for nds32_elf_relax_section. */ +/* Relax LONGJUMP4 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longjump4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -10041,7 +11493,6 @@ nds32_elf_relax_longjump4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, int seq_len; /* Original length of instruction sequence. */ uint32_t insn; Elf_Internal_Rela *hi_irel, *ptr_irel, *em_irel, *call_irel, *irelend; - int pic_ext_target = 0; bfd_signed_vma foff; irelend = internal_relocs + sec->reloc_count; @@ -10058,21 +11509,21 @@ nds32_elf_relax_longjump4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (hi_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGJUMP4", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGJUMP4 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, hi_irel, isymbuf, symtab_hdr); - if (pic_ext_target || foff == 0 || foff >= CONSERVATIVE_24BIT_S1 + if (foff == 0 || foff >= CONSERVATIVE_24BIT_S1 || foff < -CONSERVATIVE_24BIT_S1) return FALSE; /* Convert it to "j label", it may be converted to j8 in the final - pass of relaxation. Therefore, we do not consider this currently. */ + pass of relaxation. Therefore, we do not consider this currently.*/ ptr_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, R_NDS32_PTR_RESOLVED, irel->r_addend); em_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, @@ -10080,8 +11531,9 @@ nds32_elf_relax_longjump4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (ptr_irel == irelend || em_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGJUMP4", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGJUMP4 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } @@ -10109,7 +11561,7 @@ nds32_elf_relax_longjump4 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGJUMP5 relocation for nds32_elf_relax_section. */ +/* Relax LONGJUMP5 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longjump5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -10131,7 +11583,6 @@ nds32_elf_relax_longjump5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, bfd_vma laddr; Elf_Internal_Rela *cond_irel, *irelend; - int pic_ext_target = 0; unsigned int i; bfd_signed_vma foff; uint32_t insn, re_insn = 0; @@ -10154,16 +11605,16 @@ nds32_elf_relax_longjump5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, R_NDS32_25_PCREL_RELA, irel->r_addend); if (cond_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGJUMP5", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGJUMP5 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr); - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_16BIT_S1 + if (foff == 0 || foff < -CONSERVATIVE_16BIT_S1 || foff >= CONSERVATIVE_16BIT_S1) return FALSE; @@ -10208,7 +11659,7 @@ nds32_elf_relax_longjump5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, /* Clean relocations. */ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++) + for (i = 0; i < ARRAY_SIZE (checked_types); i++) { cond_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, checked_types[i], laddr); @@ -10234,7 +11685,7 @@ nds32_elf_relax_longjump5 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGJUMP6 relocation for nds32_elf_relax_section. */ +/* Relax LONGJUMP6 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -10265,7 +11716,6 @@ nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, int reloc_off = 0, cond_removed = 0; bfd_vma laddr; Elf_Internal_Rela *cond_irel, *em_irel, *irelend, *insn_irel; - int pic_ext_target = 0; unsigned int i; bfd_signed_vma foff; uint32_t insn, re_insn = 0; @@ -10283,16 +11733,16 @@ nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (em_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGJUMP6", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGJUMP6 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, em_irel, isymbuf, symtab_hdr); - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_24BIT_S1 + if (foff == 0 || foff < -CONSERVATIVE_24BIT_S1 || foff >= CONSERVATIVE_24BIT_S1) return FALSE; @@ -10318,7 +11768,7 @@ nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (N32_OP6 (re_insn) == N32_OP6_BR1 && (foff >= -CONSERVATIVE_14BIT_S1 && foff < CONSERVATIVE_14BIT_S1)) { - /* beqs label ; 15_PCREL */ + /* beqs label ; 15_PCREL */ bfd_putb32 (re_insn, contents + em_irel->r_offset); reloc = R_NDS32_15_PCREL_RELA; cond_removed = 1; @@ -10326,7 +11776,7 @@ nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, else if (N32_OP6 (re_insn) == N32_OP6_BR2 && foff >= -CONSERVATIVE_16BIT_S1 && foff < CONSERVATIVE_16BIT_S1) { - /* beqz label ; 17_PCREL */ + /* beqz label ; 17_PCREL */ bfd_putb32 (re_insn, contents + em_irel->r_offset); reloc = R_NDS32_17_PCREL_RELA; cond_removed = 1; @@ -10383,7 +11833,7 @@ nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, /* Clear relocations. */ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); - for (i = 0; i < sizeof (checked_types) / sizeof (checked_types[0]); i++) + for (i = 0; i < ARRAY_SIZE (checked_types); i++) { cond_irel = find_relocs_at_address_addr (irel, internal_relocs, irelend, @@ -10415,7 +11865,7 @@ nds32_elf_relax_longjump6 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } -/* Relax LONGJUMP7 relocation for nds32_elf_relax_section. */ +/* Relax LONGJUMP7 relocation for nds32_elf_relax_section.*/ static bfd_boolean nds32_elf_relax_longjump7 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, @@ -10435,7 +11885,6 @@ nds32_elf_relax_longjump7 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, bfd_vma laddr; Elf_Internal_Rela *cond_irel, *irelend, *insn_irel; - int pic_ext_target = 0; bfd_signed_vma foff; uint32_t insn, re_insn = 0; uint16_t insn16; @@ -10453,16 +11902,16 @@ nds32_elf_relax_longjump7 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, R_NDS32_15_PCREL_RELA, irel->r_addend); if (cond_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LONGJUMP7", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_LONGJUMP7 points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); return FALSE; } /* Get the value of the symbol referred to by the reloc. */ - foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr, - &pic_ext_target); + foff = calculate_offset (abfd, sec, cond_irel, isymbuf, symtab_hdr); - if (pic_ext_target || foff == 0 || foff < -CONSERVATIVE_8BIT_S1 + if (foff == 0 || foff < -CONSERVATIVE_8BIT_S1 || foff >= CONSERVATIVE_8BIT_S1) return FALSE; @@ -10516,6 +11965,123 @@ nds32_elf_relax_longjump7 (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, return TRUE; } +/* Record the offset to gp, and check if it changed after relaxing. + If the offset is fixed or the offset is near enough, try to relax + the pattern. This is avoid truncated to fit when relaxing fixed + address symbol. Ex: _stack. */ +static bfd_boolean +nds32_elf_relax_guard (bfd_vma *access_addr, bfd_vma local_sda, asection *sec, + Elf_Internal_Rela *irel, bfd_boolean *again, + bfd_boolean init, + struct elf_nds32_link_hash_table *table, + Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr) + +{ + /* The default linker script value. */ + int offset_to_gp; + static bfd_boolean sec_pass = FALSE; + static asection *first_sec = NULL, *sym_sec; + /* Record the number of instructions which may be removed. */ + static int count = 0, record_count; + Elf_Internal_Sym *isym; + struct elf_link_hash_entry *h = NULL; + int indx; + unsigned long r_symndx; + bfd *abfd = sec->owner; + static bfd_vma record_sda = 0; + int sda_offset = 0; + + /* Force doing relaxation when hyper-relax is high. */ + if (table->hyper_relax == 2) + return TRUE; + + /* Record the first section to get the round. */ + if (init) + { + if (!first_sec) + first_sec = sec; + else if (first_sec == sec) + { + record_count = count; + count = 0; + sec_pass = TRUE; + } + + if (!sec_pass) + *again = TRUE; + + return TRUE; + } + + if (record_sda == 0) + record_sda = local_sda; + else if (local_sda > record_sda) + /* In normal case, SDA is fixed or smaller except there is + DATA_SEGMENT_ALIGN in linker script.*/ + sda_offset = local_sda - record_sda; + + /* Although we doesn't delete all instructions here, counting all of + them to be conservative. */ + count++; + + r_symndx = ELF32_R_SYM (irel->r_info); + /* Global symbols. */ + if (r_symndx >= symtab_hdr->sh_info) + { + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + sym_sec = h->root.u.def.section; + if (NDS32_GUARD_SEC_P (sym_sec->flags) + || bfd_is_abs_section (sym_sec)) + { + /* Forbid doing relaxation when hyper-relax is low. */ + if (table->hyper_relax == 0) + return FALSE; + + offset_to_gp = *access_addr - local_sda; + if (elf32_nds32_hash_entry (h)->offset_to_gp == 0) + elf32_nds32_hash_entry (h)->offset_to_gp = offset_to_gp; + else if (abs (elf32_nds32_hash_entry (h)->offset_to_gp) + < abs (offset_to_gp) - sda_offset) + { + if (*access_addr >= local_sda) + *access_addr += (record_count * 4); + else + *access_addr -= (record_count * 4); + } + return sec_pass; + } + } + else + { + if (!elf32_nds32_allocate_local_sym_info (abfd)) + return FALSE; + isym = isymbuf + r_symndx; + + sym_sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + if (NDS32_GUARD_SEC_P (sym_sec->flags)) + { + /* Forbid doing relaxation when hyper-relax is low. */ + if (table->hyper_relax == 0) + return FALSE; + + offset_to_gp = *access_addr - local_sda; + if (elf32_nds32_local_gp_offset (abfd)[r_symndx] == 0) + elf32_nds32_local_gp_offset (abfd)[r_symndx] = offset_to_gp; + else if (abs (elf32_nds32_local_gp_offset (abfd)[r_symndx]) + < abs (offset_to_gp) - sda_offset) + { + if (*access_addr >= local_sda) + *access_addr += (record_count * 4); + else + *access_addr -= (record_count * 4); + } + return sec_pass; + } + } + + return TRUE; +} #define GET_LOADSTORE_RANGE(addend) (((addend) >> 8) & 0x3f) /* Relax LOADSTORE relocation for nds32_elf_relax_section. */ @@ -10525,21 +12091,24 @@ nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *irel, Elf_Internal_Rela *internal_relocs, int *insn_len, bfd_byte *contents, Elf_Internal_Sym *isymbuf, - Elf_Internal_Shdr *symtab_hdr, int load_store_relax) + Elf_Internal_Shdr *symtab_hdr, int load_store_relax, + struct elf_nds32_link_hash_table *table) { - int eliminate_sethi = 0, range_type; - unsigned int i; + int eliminate_sethi = 0, range_type, i; bfd_vma local_sda, laddr; int seq_len; /* Original length of instruction sequence. */ uint32_t insn; Elf_Internal_Rela *hi_irelfn = NULL, *irelend; bfd_vma access_addr = 0; bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */ + struct elf_link_hash_entry *h = NULL; + int indx; enum elf_nds32_reloc_type checked_types[] = { R_NDS32_HI20_RELA, R_NDS32_GOT_HI20, R_NDS32_GOTPC_HI20, R_NDS32_GOTOFF_HI20, R_NDS32_PLTREL_HI20, R_NDS32_PLT_GOTREL_HI20, - R_NDS32_TLS_LE_HI20 + R_NDS32_TLS_LE_HI20, R_NDS32_TLS_IE_HI20, + R_NDS32_TLS_IEGP_HI20, R_NDS32_TLS_DESC_HI20 }; irelend = internal_relocs + sec->reloc_count; @@ -10548,7 +12117,7 @@ nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd, *insn_len = seq_len; /* Get the high part relocation. */ - for (i = 0; i < ARRAY_SIZE (checked_types); i++) + for (i = 0; (unsigned) i < ARRAY_SIZE (checked_types); i++) { hi_irelfn = find_relocs_at_address_addr (irel, internal_relocs, irelend, checked_types[i], laddr); @@ -10558,9 +12127,12 @@ nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd, if (hi_irelfn == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_LOADSTORE", - irel->r_offset); - return FALSE; + /* Not R_NDS32_HI20_RELA. */ + if (i != 0) + _bfd_error_handler + ("%pB: warning: R_NDS32_LOADSTORE points to unrecognized " + "reloc at 0x%lx.", abfd, (long) irel->r_offset); + return FALSE; } range_type = GET_LOADSTORE_RANGE (irel->r_addend); @@ -10574,39 +12146,41 @@ nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd, access_addr = calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); - if (range_type == NDS32_LOADSTORE_IMM) + if (ELF32_R_SYM (hi_irelfn->r_info) >= symtab_hdr->sh_info) { - struct elf_link_hash_entry *h = NULL; - int indx; - - if (ELF32_R_SYM (hi_irelfn->r_info) >= symtab_hdr->sh_info) - { - indx = ELF32_R_SYM (hi_irelfn->r_info) - symtab_hdr->sh_info; - h = elf_sym_hashes (abfd)[indx]; - } + indx = ELF32_R_SYM (hi_irelfn->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + } + /* Try movi. */ + if (range_type == NDS32_LOADSTORE_IMM) + { if ((access_addr < CONSERVATIVE_20BIT) && (!h || (h && strcmp (h->root.root.string, FP_BASE_NAME) != 0))) { eliminate_sethi = 1; break; } + } - /* This is avoid to relax symbol address which is fixed - relocations. Ex: _stack. */ - if (h && bfd_is_abs_section (h->root.u.def.section)) - return FALSE; + if (h && strcmp (h->root.root.string, FP_BASE_NAME) == 0) + { + eliminate_sethi = 1; + break; } + else if (!nds32_elf_relax_guard (&access_addr, local_sda, sec, hi_irelfn, + NULL, FALSE, table, isymbuf, symtab_hdr)) + return FALSE; if (!load_store_relax) return FALSE; /* Case for set gp register. */ if (N32_RT5 (insn) == REG_GP) - break; + return FALSE; if (range_type == NDS32_LOADSTORE_FLOAT_S - || range_type == NDS32_LOADSTORE_FLOAT_D) + || range_type == NDS32_LOADSTORE_FLOAT_S) { range_l = sdata_range[0][0]; range_h = sdata_range[0][1]; @@ -10618,57 +12192,6 @@ nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd, } break; - case R_NDS32_GOT_HI20: - access_addr = - calculate_got_memory_address (abfd, link_info, hi_irelfn, symtab_hdr); - - /* If this symbol is not in .got, the return value will be -1. - Since the gp value is set to SDA_BASE but not GLOBAL_OFFSET_TABLE, - a negative offset is allowed. */ - if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT - && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) - eliminate_sethi = 1; - break; - - case R_NDS32_PLT_GOTREL_HI20: - access_addr = calculate_plt_memory_address (abfd, link_info, isymbuf, - hi_irelfn, symtab_hdr); - - if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT - && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) - eliminate_sethi = 1; - break; - - case R_NDS32_GOTOFF_HI20: - access_addr = - calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); - - if ((bfd_signed_vma) (access_addr - local_sda) < CONSERVATIVE_20BIT - && (bfd_signed_vma) (access_addr - local_sda) >= -CONSERVATIVE_20BIT) - eliminate_sethi = 1; - break; - - case R_NDS32_GOTPC_HI20: - /* The access_addr must consider r_addend of hi_irel. */ - access_addr = sec->output_section->vma + sec->output_offset - + irel->r_offset + hi_irelfn->r_addend; - - if ((bfd_signed_vma) (local_sda - access_addr) < CONSERVATIVE_20BIT - && (bfd_signed_vma) (local_sda - access_addr) >= -CONSERVATIVE_20BIT) - eliminate_sethi = 1; - break; - - case R_NDS32_TLS_LE_HI20: - access_addr = - calculate_memory_address (abfd, hi_irelfn, isymbuf, symtab_hdr); - BFD_ASSERT (elf_hash_table (link_info)->tls_sec != NULL); - access_addr -= (elf_hash_table (link_info)->tls_sec->vma + TP_OFFSET); - if ((range_type == NDS32_LOADSTORE_IMM) - && (bfd_signed_vma) (access_addr) < CONSERVATIVE_20BIT - && (bfd_signed_vma) (access_addr) >= -CONSERVATIVE_20BIT) - eliminate_sethi = 1; - break; - default: return FALSE; } @@ -10683,17 +12206,20 @@ nds32_elf_relax_loadstore (struct bfd_link_info *link_info, bfd *abfd, irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_NONE); *insn_len = 0; + return TRUE; } - return TRUE; + + return FALSE; } -/* Relax LO12 relocation for nds32_elf_relax_section. */ +/* Relax LO12 relocation for nds32_elf_relax_section.*/ static void nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *irel, Elf_Internal_Rela *internal_relocs, bfd_byte *contents, - Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr) + Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr, + struct elf_nds32_link_hash_table *table) { uint32_t insn; bfd_vma local_sda, laddr; @@ -10723,6 +12249,7 @@ nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd, h = elf_sym_hashes (abfd)[indx]; } + /* Try movi. */ if (N32_OP6 (insn) == N32_OP6_ORI && access_addr < CONSERVATIVE_20BIT && (!h || (h && strcmp (h->root.root.string, FP_BASE_NAME) != 0))) { @@ -10731,13 +12258,14 @@ nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd, insn = N32_TYPE1 (MOVI, N32_RT5 (insn), 0); bfd_putb32 (insn, contents + laddr); } - /* This is avoid to relax symbol address which is fixed - relocations. Ex: _stack. */ - else if (N32_OP6 (insn) == N32_OP6_ORI - && h && bfd_is_abs_section (h->root.u.def.section)) - return; else { + if (h && strcmp (h->root.root.string, FP_BASE_NAME) == 0) + { /* Fall through. */ } + else if (!nds32_elf_relax_guard (&access_addr, local_sda, sec, irel, NULL, + FALSE, table, isymbuf, symtab_hdr)) + return; + range_l = sdata_range[1][0]; range_h = sdata_range[1][1]; switch (ELF32_R_TYPE (irel->r_info)) @@ -10768,7 +12296,8 @@ nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd, /* There are range_h and range_l because linker has to promise all sections move cross one page together. */ if ((local_sda <= access_addr && (access_addr - local_sda) < range_h) - || (local_sda > access_addr && (local_sda - access_addr) <= range_l)) + || (local_sda > access_addr && (local_sda - access_addr) <= range_l) + || (h && strcmp (h->root.root.string, FP_BASE_NAME) == 0)) { if (N32_OP6 (insn) == N32_OP6_ORI && N32_RT5 (insn) == REG_GP) { @@ -10790,7 +12319,6 @@ nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd, if (irelfn != irelend && reloc != R_NDS32_SDA17S2_RELA) irelfn->r_info = ELF32_R_INFO (ELF32_R_SYM (irelfn->r_info), R_NDS32_NONE); - } } return; @@ -10798,7 +12326,7 @@ nds32_elf_relax_lo12 (struct bfd_link_info *link_info, bfd *abfd, /* Relax low part of PIC instruction pattern. */ -static void +ATTRIBUTE_UNUSED static void nds32_elf_relax_piclo12 (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *irel, bfd_byte *contents, Elf_Internal_Sym *isymbuf, @@ -10855,7 +12383,7 @@ nds32_elf_relax_piclo12 (struct bfd_link_info *link_info, bfd *abfd, /* Relax low part of LE TLS instruction pattern. */ -static void +ATTRIBUTE_UNUSED static void nds32_elf_relax_letlslo12 (struct bfd_link_info *link_info, bfd *abfd, Elf_Internal_Rela *irel, bfd_byte *contents, Elf_Internal_Sym *isymbuf, @@ -10885,7 +12413,7 @@ nds32_elf_relax_letlslo12 (struct bfd_link_info *link_info, bfd *abfd, /* Relax LE TLS calculate address instruction pattern. */ -static void +ATTRIBUTE_UNUSED static void nds32_elf_relax_letlsadd (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *irel, Elf_Internal_Rela *internal_relocs, @@ -10893,9 +12421,9 @@ nds32_elf_relax_letlsadd (struct bfd_link_info *link_info, bfd *abfd, Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) { /* Local TLS non-pic - sethi ta, hi20(symbol@tpoff) ; TLS_LE_HI20 + sethi ta, hi20(symbol@tpoff) ; TLS_LE_HI20 ori ta, ta, lo12(symbol@tpoff) ; TLS_LE_LO12 - add ra, ta, tp ; TLS_LE_ADD */ + add ra, ta, tp ; TLS_LE_ADD */ uint32_t insn; bfd_vma laddr; @@ -10931,14 +12459,13 @@ nds32_elf_relax_letlsadd (struct bfd_link_info *link_info, bfd *abfd, /* Relax LE TLS load store instruction pattern. */ -static void +ATTRIBUTE_UNUSED static void nds32_elf_relax_letlsls (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *irel, Elf_Internal_Rela *internal_relocs, bfd_byte *contents, Elf_Internal_Sym *isymbuf, Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) { - uint32_t insn; bfd_vma laddr; bfd_signed_vma foff; @@ -10970,7 +12497,6 @@ nds32_elf_relax_letlsls (struct bfd_link_info *link_info, bfd *abfd, success = 1; break; } - /* Fall through. */ case (N32_OP6_MEM << 8) | N32_MEM_LH: case (N32_OP6_MEM << 8) | N32_MEM_SH: case (N32_OP6_MEM << 8) | N32_MEM_LHS: @@ -10985,7 +12511,6 @@ nds32_elf_relax_letlsls (struct bfd_link_info *link_info, bfd *abfd, success = 1; break; } - /* Fall through. */ case (N32_OP6_MEM << 8) | N32_MEM_LW: case (N32_OP6_MEM << 8) | N32_MEM_SW: /* The range is +/-64k. */ @@ -10999,7 +12524,6 @@ nds32_elf_relax_letlsls (struct bfd_link_info *link_info, bfd *abfd, success = 1; break; } - /* Fall through. */ default: break; } @@ -11032,8 +12556,9 @@ nds32_elf_relax_ptr (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, if (re_irel == irelend) { - _bfd_error_handler (unrecognized_reloc_msg, abfd, "R_NDS32_PTR", - irel->r_offset); + _bfd_error_handler + ("%pB: warning: R_NDS32_PTR points to unrecognized reloc at 0x%lx.", + abfd, (long) irel->r_offset); return FALSE; } @@ -11068,7 +12593,7 @@ nds32_elf_relax_ptr (bfd *abfd, asection *sec, Elf_Internal_Rela *irel, /* Relax PLT_GOT_SUFF relocation for nds32_elf_relax_section. */ -static void +ATTRIBUTE_UNUSED static void nds32_elf_relax_pltgot_suff (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *irel, Elf_Internal_Rela *internal_relocs, @@ -11123,7 +12648,7 @@ nds32_elf_relax_pltgot_suff (struct bfd_link_info *link_info, bfd *abfd, return; irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), R_NDS32_PLT_GOTREL_LO19); - /* addi.gp */ + /* addi.gp */ insn = N32_TYPE1 (SBGP, N32_RT5 (insn), N32_BIT (19)); } else if (N32_OP6 (insn) == N32_OP6_JREG @@ -11153,7 +12678,7 @@ nds32_elf_relax_pltgot_suff (struct bfd_link_info *link_info, bfd *abfd, /* Relax GOT_SUFF relocation for nds32_elf_relax_section. */ -static void +ATTRIBUTE_UNUSED static void nds32_elf_relax_got_suff (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *irel, Elf_Internal_Rela *internal_relocs, @@ -11200,7 +12725,7 @@ nds32_elf_relax_got_suff (struct bfd_link_info *link_info, bfd *abfd, /* Relax PLT_GOT_SUFF relocation for nds32_elf_relax_section. */ -static void +ATTRIBUTE_UNUSED static void nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd, asection *sec, Elf_Internal_Rela *irel, Elf_Internal_Rela *internal_relocs, @@ -11303,6 +12828,85 @@ nds32_elf_relax_gotoff_suff (struct bfd_link_info *link_info, bfd *abfd, } +/* Relax LWC relocation for nds32_elf_relax_section. */ + +static void +nds32_elf_relax_flsi (struct bfd_link_info *link_info, bfd *abfd, + asection *sec, Elf_Internal_Rela *irel, + Elf_Internal_Rela *internal_relocs, + bfd_byte *contents, Elf_Internal_Sym *isymbuf, + Elf_Internal_Shdr *symtab_hdr, bfd_boolean *again) +{ + /* Pattern for bug-12566 + sethi ra, hi20(symbol) ; HI20/LOADSTORE + ori ra, ra, lo12(symbol) ; LO12S0/PTR/PTR/.../INSN16 + flsi fsa, [ra + offset1] ; LSI/PTR_RESOLVED/INSN16 + flsi fsb, [ra + offset2] ; LSI/PTR_RESOLVED/INSN16 + ... */ + + uint32_t insn; + bfd_vma local_sda, laddr; + unsigned long reloc; + bfd_vma access_addr, flsi_offset; + bfd_vma range_l = 0, range_h = 0; /* Upper/lower bound. */ + Elf_Internal_Rela *irelend, *re_irel; + unsigned int opcode; + + irelend = internal_relocs + sec->reloc_count; + laddr = irel->r_offset; + insn = bfd_getb32 (contents + laddr); + + if ((insn & 0x80000000) || !is_sda_access_insn (insn)) + return; + + /* Can not do relaxation for bi format. */ + if ((insn & 0x1000)) + return; + + /* Only deal with flsi, fssi, fldi, fsdi, so far. */ + opcode = N32_OP6 (insn); + if ((opcode == N32_OP6_LWC) || (opcode == N32_OP6_SWC)) + reloc = R_NDS32_SDA12S2_SP_RELA; + else if ((opcode == N32_OP6_LDC) || (opcode == N32_OP6_SDC)) + reloc = R_NDS32_SDA12S2_DP_RELA; + else + return; + + re_irel = find_relocs_at_address (irel, internal_relocs, irelend, + R_NDS32_PTR_RESOLVED); + if (re_irel == irelend) + { + _bfd_error_handler + ("%pB: warning: R_NDS32_LSI has no R_NDS32_PTR_RESOLVED at 0x%lx.", + abfd, (long) irel->r_offset); + return; + } + + /* For SDA base relative relaxation. */ + nds32_elf_final_sda_base (sec->output_section->owner, link_info, + &local_sda, FALSE); + access_addr = calculate_memory_address (abfd, irel, isymbuf, symtab_hdr); + flsi_offset = (insn & 0xfff) << 2; + access_addr += flsi_offset; + range_l = sdata_range[0][0]; + range_h = sdata_range[0][1]; + + if ((local_sda <= access_addr && (access_addr - local_sda) < range_h) + || (local_sda > access_addr && (local_sda - access_addr) <= range_l)) + { + /* Turn flsi instruction into sda access format. */ + insn = (insn & 0x7ff07000) | (REG_GP << 15); + + /* Add relocation type to flsi. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), reloc); + irel->r_addend += flsi_offset; + bfd_putb32 (insn, contents + re_irel->r_offset); + + re_irel->r_addend |= 1; + *again = TRUE; + } +} + static bfd_boolean nds32_relax_adjust_label (bfd *abfd, asection *sec, Elf_Internal_Rela *internal_relocs, @@ -11387,9 +12991,11 @@ nds32_relax_adjust_label (bfd *abfd, asection *sec, { /* Remove all LABEL relocation from label_rel to tmp_rel including relocations with same offset as tmp_rel. */ - for (tmp2_rel = label_rel; tmp2_rel < tmp_rel - || tmp2_rel->r_offset == tmp_rel->r_offset; tmp2_rel++) + for (tmp2_rel = label_rel; tmp2_rel < tmp_rel; tmp2_rel++) { + if (tmp2_rel->r_offset == tmp_rel->r_offset) + break; + if (ELF32_R_TYPE (tmp2_rel->r_info) == R_NDS32_LABEL && tmp2_rel->r_addend < 2) tmp2_rel->r_info = @@ -11416,7 +13022,8 @@ nds32_relax_adjust_label (bfd *abfd, asection *sec, We may convert a 16-bit instruction right before a label to 32-bit, in order to align the label if necessary all reloc entries has been sorted by r_offset. */ - for (irel = internal_relocs; irel < irelend; irel++) + for (irel = internal_relocs; + irel < irelend && irel->r_offset < sec->size; irel++) { if (ELF32_R_TYPE (irel->r_info) != R_NDS32_INSN16 && ELF32_R_TYPE (irel->r_info) != R_NDS32_LABEL) @@ -11568,118 +13175,6 @@ nds32_relax_adjust_label (bfd *abfd, asection *sec, return TRUE; } -/* Pick relaxation round. */ - -static int -nds32_elf_pick_relax (bfd_boolean init, asection *sec, bfd_boolean *again, - struct elf_nds32_link_hash_table *table, - struct bfd_link_info *link_info) -{ - static asection *final_sec, *first_sec = NULL; - static bfd_boolean normal_again = FALSE; - static bfd_boolean set = FALSE; - static bfd_boolean first = TRUE; - int round_table[] = { - NDS32_RELAX_NORMAL_ROUND, - NDS32_RELAX_JUMP_IFC_ROUND, - NDS32_RELAX_EX9_BUILD_ROUND, - NDS32_RELAX_EX9_REPLACE_ROUND, - }; - static int pass = 0; - static int relax_round; - - /* The new round. */ - if (init && first_sec == sec) - { - set = TRUE; - normal_again = FALSE; - } - - if (first) - { - /* Run an empty run to get the final section. */ - relax_round = NDS32_RELAX_EMPTY_ROUND; - - /* It has to enter relax again because we can - not make sure what the final turn is. */ - *again = TRUE; - - first = FALSE; - first_sec = sec; - } - - if (!set) - { - /* Not reenter yet. */ - final_sec = sec; - return relax_round; - } - - relax_round = round_table[pass]; - - if (!init && relax_round == NDS32_RELAX_NORMAL_ROUND && *again) - normal_again = TRUE; - - if (!init && final_sec == sec) - { - switch (relax_round) - { - case NDS32_RELAX_NORMAL_ROUND: - if (!normal_again) - { - /* Normal relaxation done. */ - if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON) - { - pass++; - *again = TRUE; - } - else if (table->target_optimize & NDS32_RELAX_EX9_ON) - { - pass += 2; /* NDS32_RELAX_EX9_BUILD_ROUND */ - *again = TRUE; - } - else if (table->ex9_import_file) - { - /* Import ex9 table. */ - if (table->update_ex9_table) - pass += 2; /* NDS32_RELAX_EX9_BUILD_ROUND */ - else - pass += 3; /* NDS32_RELAX_EX9_REPLACE_ROUND */ - nds32_elf_ex9_import_table (link_info); - *again = TRUE; - } - } - break; - case NDS32_RELAX_JUMP_IFC_ROUND: - if (!nds32_elf_ifc_finish (link_info)) - _bfd_error_handler (_("error: Jump IFC Fail.")); - if (table->target_optimize & NDS32_RELAX_EX9_ON) - { - pass++; - *again = TRUE; - } - break; - case NDS32_RELAX_EX9_BUILD_ROUND: - nds32_elf_ex9_finish (link_info); - pass++; - *again = TRUE; - break; - case NDS32_RELAX_EX9_REPLACE_ROUND: - if (table->target_optimize & NDS32_RELAX_JUMP_IFC_ON) - { - /* Do jump IFC optimization again. */ - if (!nds32_elf_ifc_finish (link_info)) - _bfd_error_handler (_("error: Jump IFC Fail.")); - } - break; - default: - break; - } - } - - return relax_round; -} - static bfd_boolean nds32_elf_relax_section (bfd *abfd, asection *sec, struct bfd_link_info *link_info, bfd_boolean *again) @@ -11697,26 +13192,25 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, uint32_t insn; uint16_t insn16; - /* Target dependnet option. */ + /* Target dependent option. */ struct elf_nds32_link_hash_table *table; int load_store_relax; - int relax_round; relax_blank_list = NULL; - *again = FALSE; /* Nothing to do for - * relocatable link or - * non-relocatable section or - * non-code section or - * empty content or - * no reloc entry. */ + relocatable link or + non-relocatable section or + non-code section or + empty content or + no reloc entry. */ if (bfd_link_relocatable (link_info) || (sec->flags & SEC_RELOC) == 0 - || (sec->flags & SEC_EXCLUDE) != 0 + || (sec->flags & SEC_EXCLUDE) == 1 || (sec->flags & SEC_CODE) == 0 - || sec->size == 0) + || sec->size == 0 + || sec->reloc_count == 0) return TRUE; /* 09.12.11 Workaround. */ @@ -11725,44 +13219,14 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, if (sec->alignment_power > 2) return TRUE; +#ifdef NDS32_LINUX_TOOLCHAIN + /* Do TLS model conversion once at first. */ + nds32_elf_unify_tls_model (abfd, sec, contents, link_info); +#endif + /* The optimization type to do. */ table = nds32_elf_hash_table (link_info); - relax_round = nds32_elf_pick_relax (TRUE, sec, again, table, link_info); - switch (relax_round) - { - case NDS32_RELAX_JUMP_IFC_ROUND: - /* Here is the entrance of ifc jump relaxation. */ - if (!nds32_elf_ifc_calc (link_info, abfd, sec)) - return FALSE; - nds32_elf_pick_relax (FALSE, sec, again, table, link_info); - return TRUE; - - case NDS32_RELAX_EX9_BUILD_ROUND: - /* Here is the entrance of ex9 relaxation. There are two pass of - ex9 relaxation. The one is to traverse all instructions and build - the hash table. The other one is to compare instructions and replace - it by ex9.it. */ - if (!nds32_elf_ex9_build_hash_table (abfd, sec, link_info)) - return FALSE; - nds32_elf_pick_relax (FALSE, sec, again, table, link_info); - return TRUE; - - case NDS32_RELAX_EX9_REPLACE_ROUND: - if (!nds32_elf_ex9_replace_instruction (link_info, abfd, sec)) - return FALSE; - return TRUE; - - case NDS32_RELAX_EMPTY_ROUND: - nds32_elf_pick_relax (FALSE, sec, again, table, link_info); - return TRUE; - - case NDS32_RELAX_NORMAL_ROUND: - default: - if (sec->reloc_count == 0) - return TRUE; - break; - } /* The begining of general relaxation. */ @@ -11775,20 +13239,10 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, relax_range_measurement (abfd); } - if (is_ITB_BASE_set == 0) - { - /* Set the _ITB_BASE_. */ - if (!nds32_elf_ex9_itb_base (link_info)) - { - _bfd_error_handler (_("%B: error: Cannot set _ITB_BASE_"), abfd); - bfd_set_error (bfd_error_bad_value); - } - } - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Relocations MUST be kept in memory, because relaxation adjust them. */ internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, - TRUE /* keep_memory */); + TRUE /* keep_memory */); if (internal_relocs == NULL) goto error_return; @@ -11802,10 +13256,7 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY) { if (irel->r_addend & R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG) - { - nds32_elf_pick_relax (FALSE, sec, again, table, link_info); - return TRUE; - } + return TRUE; if (irel->r_addend & R_NDS32_RELAX_ENTRY_OPTIMIZE_FLAG) optimize = 1; @@ -11888,7 +13339,8 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, || ELF32_R_TYPE (irel->r_info) == R_NDS32_17IFC_PCREL_RELA || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LO12 || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_ADD - || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LS) + || ELF32_R_TYPE (irel->r_info) == R_NDS32_TLS_LE_LS + || ELF32_R_TYPE (irel->r_info) == R_NDS32_LSI) seq_len = 0; else continue; @@ -11967,71 +13419,41 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, removed = nds32_elf_relax_loadstore (link_info, abfd, sec, irel, internal_relocs, &insn_len, contents, isymbuf, symtab_hdr, - load_store_relax); + load_store_relax, table); break; case R_NDS32_LO12S0_RELA: case R_NDS32_LO12S1_RELA: + case R_NDS32_LO12S2_RELA: case R_NDS32_LO12S2_DP_RELA: case R_NDS32_LO12S2_SP_RELA: - case R_NDS32_LO12S2_RELA: /* Relax for low part. */ nds32_elf_relax_lo12 (link_info, abfd, sec, irel, internal_relocs, - contents, isymbuf, symtab_hdr); + contents, isymbuf, symtab_hdr, table); /* It is impossible to delete blank, so just continue. */ continue; + case R_NDS32_PTR: + removed = nds32_elf_relax_ptr (abfd, sec, irel, internal_relocs, + &insn_len, &seq_len, contents); + break; + case R_NDS32_LSI: + nds32_elf_relax_flsi (link_info, abfd, sec, irel, internal_relocs, + contents, isymbuf, symtab_hdr, again); + continue; case R_NDS32_GOT_LO12: case R_NDS32_GOTOFF_LO12: case R_NDS32_PLTREL_LO12: case R_NDS32_PLT_GOTREL_LO12: case R_NDS32_GOTPC_LO12: - /* Relax for PIC gp-relative low part. */ - nds32_elf_relax_piclo12 (link_info, abfd, sec, irel, contents, - isymbuf, symtab_hdr); - - /* It is impossible to delete blank, so just continue. */ - continue; case R_NDS32_TLS_LE_LO12: - /* Relax for LE TLS low part. */ - nds32_elf_relax_letlslo12 (link_info, abfd, irel, contents, - isymbuf, symtab_hdr); - - /* It is impossible to delete blank, so just continue. */ - continue; case R_NDS32_TLS_LE_ADD: - nds32_elf_relax_letlsadd (link_info, abfd, sec, irel, internal_relocs, - contents, isymbuf, symtab_hdr, again); - /* It is impossible to delete blank, so just continue. */ - continue; case R_NDS32_TLS_LE_LS: - nds32_elf_relax_letlsls (link_info, abfd, sec, irel, internal_relocs, - contents, isymbuf, symtab_hdr, again); - continue; - case R_NDS32_PTR: - removed = nds32_elf_relax_ptr (abfd, sec, irel, internal_relocs, - &insn_len, &seq_len, contents); - break; case R_NDS32_PLT_GOT_SUFF: - nds32_elf_relax_pltgot_suff (link_info, abfd, sec, irel, - internal_relocs, contents, - isymbuf, symtab_hdr, again); - /* It is impossible to delete blank, so just continue. */ - continue; case R_NDS32_GOT_SUFF: - nds32_elf_relax_got_suff (link_info, abfd, sec, irel, - internal_relocs, contents, - symtab_hdr, again); - /* It is impossible to delete blank, so just continue. */ - continue; case R_NDS32_GOTOFF_SUFF: - nds32_elf_relax_gotoff_suff (link_info, abfd, sec, irel, - internal_relocs, contents, - isymbuf, symtab_hdr, again); - /* It is impossible to delete blank, so just continue. */ continue; default: continue; - } if (removed && seq_len - insn_len > 0) { @@ -12051,7 +13473,7 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, irelend, isymbuf)) goto error_return; - if (!*again) + if (*again == FALSE) { if (!nds32_fag_remove_unused_fpbase (abfd, sec, internal_relocs, irelend)) @@ -12059,9 +13481,7 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, } } - nds32_elf_pick_relax (FALSE, sec, again, table, link_info); - - if (!*again) + if (*again == FALSE) { if (!nds32_relax_adjust_label (abfd, sec, internal_relocs, contents, &relax_blank_list, optimize, opt_size)) @@ -12078,15 +13498,15 @@ nds32_elf_relax_section (bfd *abfd, asection *sec, relax_blank_list = NULL; } - if (!*again) + if (*again == FALSE) { /* Closing the section, so we don't relax it anymore. */ bfd_vma sec_size_align; Elf_Internal_Rela *tmp_rel; /* Pad to alignment boundary. Only handle current section alignment. */ - sec_size_align = (sec->size + (~((-1U) << sec->alignment_power))) - & ((-1U) << sec->alignment_power); + sec_size_align = (sec->size + (~((bfd_vma)(-1) << sec->alignment_power))) + & ((bfd_vma)(-1) << sec->alignment_power); if ((sec_size_align - sec->size) & 0x2) { insn16 = NDS32_NOP16; @@ -12128,8 +13548,7 @@ error_return: goto finish; } -static struct bfd_elf_special_section const nds32_elf_special_sections[] = -{ +static struct bfd_elf_special_section const nds32_elf_special_sections[] = { {".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE}, {".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE}, {NULL, 0, 0, 0, 0} @@ -12182,14 +13601,14 @@ bfd_elf32_nds32_set_target_option (struct bfd_link_info *link_info, int eliminate_gc_relocs, FILE * sym_ld_script, int load_store_relax, int target_optimize, int relax_status, - int relax_round, FILE * ex9_export_file, - FILE * ex9_import_file, - int update_ex9_table, int ex9_limit, - bfd_boolean ex9_loop_aware, - bfd_boolean ifc_loop_aware) + int relax_round, int hyper_relax, + int tls_desc_trampoline, char *abi) { struct elf_nds32_link_hash_table *table; + /* Initialize indirect call hash table. */ + nds32_elf_ict_hash_init (); + table = nds32_elf_hash_table (link_info); if (table == NULL) return; @@ -12201,12 +13620,81 @@ bfd_elf32_nds32_set_target_option (struct bfd_link_info *link_info, table->target_optimize = target_optimize; table->relax_status = relax_status; table->relax_round = relax_round; - table->ex9_export_file = ex9_export_file; - table->ex9_import_file = ex9_import_file; - table->update_ex9_table = update_ex9_table; - table->ex9_limit = ex9_limit; - table->ex9_loop_aware = ex9_loop_aware; - table->ifc_loop_aware = ifc_loop_aware; + table->hyper_relax = hyper_relax; + table->tls_desc_trampoline = tls_desc_trampoline; + output_abi = abi; +} + +void +bfd_elf32_nds32_append_section (struct bfd_link_info *link_info, bfd *abfd) +{ + asection *itable; + struct bfd_link_hash_entry *h; + unsigned int i, count = 0; + + /* Count number of indirect call function. */ + indirect_call_table.frozen = 1; + for (i = 0; i < indirect_call_table.size; i++) + { + struct bfd_hash_entry *p; + struct elf_nds32_ict_hash_entry *entry; + + for (p = indirect_call_table.table[i]; p != NULL; p = p->next) + { + entry = (struct elf_nds32_ict_hash_entry *) p; + entry->order = count; + count++; + } + } + indirect_call_table.frozen = 0; + + if (count) + { + h = bfd_link_hash_lookup (link_info->hash, "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + if (h && (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak + || h->type == bfd_link_hash_common)) + { + _bfd_error_handler (_("Warning: _INDIRECT_CALL_TABLE_BASE_ has already" + "be defined. All ICT suffix is ignored.")); + ignore_indirect_call = TRUE; + return; + } + + if (ict_model == R_NDS32_RELAX_ENTRY_ICT_LARGE) + itable = bfd_make_section_with_flags (abfd, NDS32_ICT_SECTION, + SEC_DATA | SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS | SEC_READONLY + | SEC_IN_MEMORY | SEC_KEEP + | SEC_RELOC); + else + itable = bfd_make_section_with_flags (abfd, NDS32_ICT_SECTION, + SEC_CODE | SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS | SEC_READONLY + | SEC_IN_MEMORY | SEC_KEEP + | SEC_RELOC); + if (itable) + { + itable->gc_mark = 1; + itable->alignment_power = 2; + itable->size = count * 4; + itable->contents = bfd_zalloc (abfd, itable->size); + + /* Add a symbol in the head of .nds32.ict to objdump clearly. */ + h = bfd_link_hash_lookup (link_info->hash, + "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + _bfd_generic_link_add_one_symbol + (link_info, link_info->output_bfd, "_INDIRECT_CALL_TABLE_BASE_", + BSF_GLOBAL | BSF_WEAK, itable, 0, (const char *) NULL, FALSE, + get_elf_backend_data (link_info->output_bfd)->collect, &h); + } + + ict_file = fopen ("nds32_ict.s", FOPEN_WT); + if(ict_file == NULL) + _bfd_error_handler (_("Warning: Fail to build nds32_ict.s.")); + } } /* These functions and data-structures are used for fp-as-gp @@ -12394,7 +13882,7 @@ nds32_fag_find_base (struct nds32_fag *head, struct nds32_fag **bestpp) static bfd_boolean nds32_fag_mark_relax (struct bfd_link_info *link_info, - bfd *abfd, struct nds32_fag *best_fag, + asection *sec, struct nds32_fag *best_fag, Elf_Internal_Rela *internal_relocs, Elf_Internal_Rela *irelend) { @@ -12402,7 +13890,7 @@ nds32_fag_mark_relax (struct bfd_link_info *link_info, bfd_vma best_fpbase, gp; bfd *output_bfd; - output_bfd = abfd->sections->output_section->owner; + output_bfd = sec->output_section->owner; nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); best_fpbase = best_fag->addr; @@ -12525,8 +14013,7 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info, { /* Begin of the region. */ if (begin_rel) - /* xgettext:c-format */ - _bfd_error_handler (_("%B: Nested OMIT_FP in %A."), abfd, sec); + _bfd_error_handler (_("%pB: Nested OMIT_FP in %pA."), abfd, sec); begin_rel = irel; nds32_fag_init (&fag_head); @@ -12544,8 +14031,7 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info, if (begin_rel == NULL) { - /* xgettext:c-format */ - _bfd_error_handler (_("%B: Unmatched OMIT_FP in %A."), abfd, sec); + _bfd_error_handler (_("%pB: Unmatched OMIT_FP in %pA."), abfd, sec); continue; } @@ -12557,7 +14043,7 @@ nds32_relax_fp_as_gp (struct bfd_link_info *link_info, /* Check if it is worth, and FP_BASE is near enough to SDA_BASE. */ if (accu < FAG_THRESHOLD - || !nds32_fag_mark_relax (link_info, abfd, best_fag, + || !nds32_fag_mark_relax (link_info, sec, best_fag, internal_relocs, irelend)) { /* Not worth to do fp-as-gp. */ @@ -12811,9 +14297,9 @@ nds32_elf_get_relocated_section_contents (bfd *abfd, case bfd_reloc_dangerous: BFD_ASSERT (error_message != NULL); (*link_info->callbacks->reloc_dangerous) - (link_info, error_message, - input_bfd, input_section, (*parent)->address); - break; + (link_info, error_message, input_bfd, input_section, + (*parent)->address); + break; case bfd_reloc_overflow: (*link_info->callbacks->reloc_overflow) (link_info, NULL, @@ -12827,9 +14313,8 @@ nds32_elf_get_relocated_section_contents (bfd *abfd, complete binaries. Do not abort, but issue an error message instead. */ link_info->callbacks->einfo - /* xgettext:c-format */ - (_("%X%P: %B(%A): relocation \"%R\" goes out of range\n"), - abfd, input_section, * parent); + (_("%X%P: %pB(%pA): relocation \"%R\" goes out of range\n"), + abfd, input_section, *parent); goto error_return; default: @@ -12847,745 +14332,807 @@ error_return: free (reloc_vector); return NULL; } - -/* Link-time IFC relaxation. - In this optimization, we chains jump instructions - of the same destination with ifcall. */ +/* Check target symbol. */ -/* List to save jal and j relocation. */ -struct elf_nds32_ifc_symbol_entry +static bfd_boolean +nds32_elf_is_target_special_symbol (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym) { - asection *sec; - struct elf_link_hash_entry *h; - struct elf_nds32_ifc_irel_list *irel_head; - unsigned long insn; - int times; - int enable; /* Apply ifc. */ - int ex9_enable; /* Apply ifc after ex9. */ - struct elf_nds32_ifc_symbol_entry *next; -}; + if (!sym || !sym->name || sym->name[0] != '$') + return FALSE; + return TRUE; +} -struct elf_nds32_ifc_irel_list +/* nds32 find maybe function sym. Ignore target special symbol + first, and then go the general function. */ + +static bfd_size_type +nds32_elf_maybe_function_sym (const asymbol *sym, asection *sec, + bfd_vma *code_off) { - Elf_Internal_Rela *irel; - asection *sec; - bfd_vma addr; - /* If this is set, then it is the last instruction for - ifc-chain, so it must be keep for the actual branching. */ - int keep; - struct elf_nds32_ifc_irel_list *next; -}; + if (nds32_elf_is_target_special_symbol (NULL, (asymbol *) sym)) + return 0; -static struct elf_nds32_ifc_symbol_entry *ifc_symbol_head = NULL; + return _bfd_elf_maybe_function_sym (sym, sec, code_off); +} -/* Insert symbol of jal and j for ifc. */ + +/* Do TLS model conversion. */ -static void -nds32_elf_ifc_insert_symbol (asection *sec, - struct elf_link_hash_entry *h, - Elf_Internal_Rela *irel, - unsigned long insn) +typedef struct relax_group_list_t { - struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; + Elf_Internal_Rela *relo; + struct relax_group_list_t *next; + struct relax_group_list_t *next_sibling; + int id; +} relax_group_list_t; - /* Check there is target of existing entry the same as the new one. */ - while (ptr != NULL) - { - if (((h == NULL && ptr->sec == sec - && ELF32_R_SYM (ptr->irel_head->irel->r_info) == ELF32_R_SYM (irel->r_info) - && ptr->irel_head->irel->r_addend == irel->r_addend) - || h != NULL) - && ptr->h == h - && ptr->insn == insn) - { - /* The same target exist, so insert into list. */ - struct elf_nds32_ifc_irel_list *irel_list = ptr->irel_head; +int +list_insert (relax_group_list_t *pHead, Elf_Internal_Rela *pElem); - while (irel_list->next != NULL) - irel_list = irel_list->next; - irel_list->next = bfd_malloc (sizeof (struct elf_nds32_ifc_irel_list)); - irel_list = irel_list->next; - irel_list->irel = irel; - irel_list->keep = 1; +int +list_insert_sibling (relax_group_list_t *pNode, Elf_Internal_Rela *pElem); - if (h == NULL) - irel_list->sec = NULL; - else - irel_list->sec = sec; - irel_list->next = NULL; - return; - } - if (ptr->next == NULL) - break; - ptr = ptr->next; - } +void +dump_chain (relax_group_list_t *pHead); - /* There is no same target entry, so build a new one. */ - if (ifc_symbol_head == NULL) - { - ifc_symbol_head = bfd_malloc (sizeof (struct elf_nds32_ifc_symbol_entry)); - ptr = ifc_symbol_head; - } - else +int +list_insert (relax_group_list_t *pHead, Elf_Internal_Rela *pElem) +{ + relax_group_list_t *pNext = pHead; + + /* find place */ + while (pNext->next) { - ptr->next = bfd_malloc (sizeof (struct elf_nds32_ifc_symbol_entry)); - ptr = ptr->next; + if (pNext->next->id > (int) pElem->r_addend) + break; + + pNext = pNext->next; } - ptr->h = h; - ptr->irel_head = bfd_malloc (sizeof (struct elf_nds32_ifc_irel_list)); - ptr->irel_head->irel = irel; - ptr->insn = insn; - ptr->irel_head->keep = 1; + /* insert node */ + relax_group_list_t *pNew = bfd_malloc (sizeof (relax_group_list_t)); + if (!pNew) + return FALSE; - if (h == NULL) - { - /* Local symbols. */ - ptr->sec = sec; - ptr->irel_head->sec = NULL; - } - else - { - /* Global symbol. */ - ptr->sec = NULL; - ptr->irel_head->sec = sec; - } + relax_group_list_t *tmp = pNext->next; + pNext->next = pNew; - ptr->irel_head->next = NULL; - ptr->times = 0; - ptr->enable = 0; - ptr->ex9_enable = 0; - ptr->next = NULL; -} + pNew->id = pElem->r_addend; + pNew->relo = pElem; + pNew->next = tmp; + pNew->next_sibling = NULL; -/* Gather all jal and j instructions. */ + return TRUE; +} -static bfd_boolean -nds32_elf_ifc_calc (struct bfd_link_info *info, - bfd *abfd, asection *sec) +int +list_insert_sibling (relax_group_list_t *pNode, Elf_Internal_Rela *pElem) { - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *irelend; - Elf_Internal_Rela *irel; - Elf_Internal_Shdr *symtab_hdr; - bfd_byte *contents = NULL; - uint32_t insn, insn_with_reg; - unsigned long r_symndx; - struct elf_link_hash_entry *h; - struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); - struct elf_nds32_link_hash_table *table; - bfd_boolean ifc_loop_aware; + relax_group_list_t *pNext = pNode; - internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, - TRUE /* keep_memory */); - irelend = internal_relocs + sec->reloc_count; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + /* find place */ + while (pNext->next_sibling) + { + pNext = pNext->next_sibling; + } - /* Check if the object enable ifc. */ - irel = find_relocs_at_address (internal_relocs, internal_relocs, irelend, - R_NDS32_RELAX_ENTRY); + /* insert node */ + relax_group_list_t *pNew = bfd_malloc (sizeof (relax_group_list_t)); + if (!pNew) + return FALSE; - if (irel == NULL - || irel >= irelend - || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY - || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY - && !(irel->r_addend & R_NDS32_RELAX_ENTRY_IFC_FLAG))) - return TRUE; + relax_group_list_t *tmp = pNext->next_sibling; + pNext->next_sibling = pNew; - if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)) - return FALSE; + pNew->id = -1; + pNew->relo = pElem; + pNew->next = NULL; + pNew->next_sibling = tmp; - table = nds32_elf_hash_table (info); - ifc_loop_aware = table->ifc_loop_aware; - while (irel != NULL && irel < irelend) - { - /* Traverse all relocation and gather all of them to build the list. */ + return TRUE; +} - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN) +void +dump_chain (relax_group_list_t *pHead) +{ + relax_group_list_t *pNext = pHead->next; + while (pNext) + { + printf("group %d @ 0x%08x", pNext->id, (unsigned)pNext->relo->r_offset); + relax_group_list_t *pNextSib = pNext->next_sibling; + while (pNextSib) { - if (ifc_loop_aware == 1 - && (irel->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG) != 0) - { - /* Check the region if loop or not. If it is true and - ifc-loop-aware is true, ignore the region till region end. */ - while (irel != NULL - && irel < irelend - && (ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_REGION_END - || (irel->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG) != 0)) - irel++; - } + printf(", %d", (unsigned) ELF32_R_TYPE (pNextSib->relo->r_info)); + pNextSib = pNextSib->next_sibling; } + pNext = pNext->next; + printf("\n"); + } +} - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA) +/* check R_NDS32_RELAX_GROUP of each section. + there might be multiple sections in one object file. */ +int +elf32_nds32_check_relax_group (bfd *abfd, asection *asec) +{ + elf32_nds32_relax_group_t *relax_group_ptr = + elf32_nds32_relax_group_ptr (abfd); + + int min_id = relax_group_ptr->min_id; + int max_id = relax_group_ptr->max_id; + + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + Elf_Internal_Rela *relocs; + enum elf_nds32_reloc_type rtype; + + do + { + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + relocs = _bfd_elf_link_read_relocs (abfd, asec, NULL, NULL, + TRUE /* keep_memory */); + if (relocs == NULL) + break; + + /* check R_NDS32_RELAX_GROUP */ + relend = relocs + asec->reloc_count; + for (rel = relocs; rel < relend; rel++) { - insn = bfd_getb32 (contents + irel->r_offset); - nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg); - r_symndx = ELF32_R_SYM (irel->r_info); - if (r_symndx < symtab_hdr->sh_info) - { - /* Local symbol. */ - nds32_elf_ifc_insert_symbol (sec, NULL, irel, insn_with_reg); - } - else - { - /* External symbol. */ - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - nds32_elf_ifc_insert_symbol (sec, h, irel, insn_with_reg); - } + int id; + rtype = ELF32_R_TYPE (rel->r_info); + if (rtype != R_NDS32_RELAX_GROUP) + continue; + + id = rel->r_addend; + if (id < min_id) + min_id = id; + else if (id > max_id) + max_id = id; } - irel++; } - return TRUE; + while (FALSE); + + if ((relocs != NULL) && (elf_section_data (asec)->relocs != relocs)) + free (relocs); + + if ((min_id != relax_group_ptr->min_id) + || (max_id != relax_group_ptr->max_id)) + { + relax_group_ptr->count = max_id - min_id + 1; + BFD_ASSERT(min_id <= relax_group_ptr->min_id); + relax_group_ptr->min_id = min_id; + BFD_ASSERT(max_id >= relax_group_ptr->max_id); + relax_group_ptr->max_id = max_id; + } + + return relax_group_ptr->count; } -/* Determine whether j and jal should be substituted. */ +/* Reorder RELAX_GROUP ID when command line option '-r' is applied. */ +/* TODO: find a way to free me. */ +struct section_id_list_t *relax_group_section_id_list = NULL; -static void -nds32_elf_ifc_filter (struct bfd_link_info *info) +struct section_id_list_t * +elf32_nds32_lookup_section_id (int id, struct section_id_list_t **lst_ptr) { - struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; - struct elf_nds32_ifc_irel_list *irel_ptr = NULL; - struct elf_nds32_ifc_irel_list *irel_keeper = NULL; - struct elf_nds32_link_hash_table *table; - int target_optimize; - bfd_vma address; + struct section_id_list_t *result = NULL; + struct section_id_list_t *lst = *lst_ptr; - table = nds32_elf_hash_table (info); - target_optimize = table->target_optimize; - while (ptr) + if (NULL == lst) { - irel_ptr = ptr->irel_head; - if (ptr->h == NULL) + result = (struct section_id_list_t *) calloc ( + 1, sizeof (struct section_id_list_t)); + BFD_ASSERT (result); /* feed me */ + result->id = id; + *lst_ptr = result; + } + else + { + struct section_id_list_t *cur = lst; + struct section_id_list_t *prv = NULL; + struct section_id_list_t *sec = NULL; + while (cur) { - /* Local symbol. */ - irel_keeper = irel_ptr; - while (irel_ptr && irel_ptr->next) + if (cur->id < id) { - /* Check there is jump target can be used. */ - if ((irel_ptr->next->irel->r_offset - - irel_keeper->irel->r_offset) > 1022) - irel_keeper = irel_ptr->next; - else - { - ptr->enable = 1; - irel_ptr->keep = 0; - } - irel_ptr = irel_ptr->next; + prv = cur; + cur = cur->next; + continue; } - } - else - { - /* Global symbol. */ - /* We have to get the absolute address and decide - whether to keep it or not. */ - while (irel_ptr) + + if (cur->id > id) { - address = (irel_ptr->irel->r_offset - + irel_ptr->sec->output_section->vma - + irel_ptr->sec->output_offset); - irel_ptr->addr = address; - irel_ptr = irel_ptr->next; + cur = NULL; /* to insert after prv */ + sec = cur; /* in case prv == NULL */ } - irel_ptr = ptr->irel_head; - while (irel_ptr) - { - /* Sort by address. */ - struct elf_nds32_ifc_irel_list *irel_dest = irel_ptr; - struct elf_nds32_ifc_irel_list *irel_temp = irel_ptr; - struct elf_nds32_ifc_irel_list *irel_ptr_prev = NULL; - struct elf_nds32_ifc_irel_list *irel_dest_prev = NULL; - - /* Get the smallest one. */ - while (irel_temp->next) - { - if (irel_temp->next->addr < irel_dest->addr) - { - irel_dest_prev = irel_temp; - irel_dest = irel_temp->next; - } - irel_temp = irel_temp->next; - } + break; + } - if (irel_dest != irel_ptr) - { - if (irel_ptr_prev) - irel_ptr_prev->next = irel_dest; - if (irel_dest_prev) - irel_dest_prev->next = irel_ptr; - irel_temp = irel_ptr->next; - irel_ptr->next = irel_dest->next; - irel_dest->next = irel_temp; - } - irel_ptr_prev = irel_ptr; - irel_ptr = irel_ptr->next; + if (NULL == cur) + { + /* insert after prv */ + result = (struct section_id_list_t *) calloc ( + 1, sizeof (struct section_id_list_t)); + BFD_ASSERT (result); /* feed me */ + result->id = id; + if (NULL != prv) + { + result->next = prv->next; + prv->next = result; } - - irel_ptr = ptr->irel_head; - irel_keeper = irel_ptr; - while (irel_ptr && irel_ptr->next) + else { - if ((irel_ptr->next->addr - irel_keeper->addr) > 1022) - irel_keeper = irel_ptr->next; - else - { - ptr->enable = 1; - irel_ptr->keep = 0; - } - irel_ptr = irel_ptr->next; + *lst_ptr = result; + result->next = sec; } } - - /* Ex9 enable. Reserve it for ex9. */ - if ((target_optimize & NDS32_RELAX_EX9_ON) - && ptr->irel_head != irel_keeper) - ptr->enable = 0; - ptr = ptr->next; } -} -/* Determine whether j and jal should be substituted after ex9 done. */ + return result; +} -static void -nds32_elf_ifc_filter_after_ex9 (void) +int +elf32_nds32_unify_relax_group (bfd *abfd, asection *asec) { - struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; - struct elf_nds32_ifc_irel_list *irel_ptr = NULL; + static int next_relax_group_bias = 0; + + elf32_nds32_relax_group_t *relax_group_ptr = + elf32_nds32_relax_group_ptr (abfd); + + bfd_boolean result = TRUE; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + Elf_Internal_Rela *relocs = NULL; + enum elf_nds32_reloc_type rtype; + struct section_id_list_t *node = NULL; + int count = 0; - while (ptr) + do { - if (ptr->enable == 0) + if (0 == relax_group_ptr->count) + break; + + /* check if this section has handled */ + node = elf32_nds32_lookup_section_id (asec->id, &relax_group_section_id_list); + if (NULL == node) + break; /* hit, the section id has handled. */ + + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + relocs = _bfd_elf_link_read_relocs (abfd, asec, NULL, NULL, + TRUE /* keep_memory */); + if (relocs == NULL) { - /* Check whether ifc is applied or not. */ - irel_ptr = ptr->irel_head; - ptr->ex9_enable = 1; - while (irel_ptr) - { - if (ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_TRAN) - { - /* Ex9 already. */ - ptr->ex9_enable = 0; - break; - } - irel_ptr = irel_ptr->next; - } + BFD_ASSERT (0); /* feed me */ + break; } - ptr = ptr->next; - } -} - -/* Wrapper to do ifc relaxation. */ -bfd_boolean -nds32_elf_ifc_finish (struct bfd_link_info *info) -{ - int relax_status; - struct elf_nds32_link_hash_table *table; + /* allocate group id bias for this bfd! */ + if (0 == relax_group_ptr->init) + { + relax_group_ptr->bias = next_relax_group_bias; + next_relax_group_bias += relax_group_ptr->count; + relax_group_ptr->init = 1; + } - table = nds32_elf_hash_table (info); - relax_status = table->relax_status; + /* reorder relax group groups */ + relend = relocs + asec->reloc_count; + for (rel = relocs; rel < relend; rel++) + { + rtype = ELF32_R_TYPE(rel->r_info); + if (rtype != R_NDS32_RELAX_GROUP) + continue; - if (!(relax_status & NDS32_RELAX_JUMP_IFC_DONE)) - nds32_elf_ifc_filter (info); - else - nds32_elf_ifc_filter_after_ex9 (); + /* change it */ + rel->r_addend += relax_group_ptr->bias; + /* debugging count */ + count++; + } + } + while (FALSE); - if (!nds32_elf_ifc_replace (info)) - return FALSE; + if (relocs != NULL && elf_section_data (asec)->relocs != relocs) + free (relocs); - if (table) - table->relax_status |= NDS32_RELAX_JUMP_IFC_DONE; - return TRUE; + return result; } -/* Traverse the result of ifc filter and replace it with ifcall9. */ - -static bfd_boolean -nds32_elf_ifc_replace (struct bfd_link_info *info) +int +nds32_elf_unify_tls_model (bfd *inbfd, asection *insec, bfd_byte *incontents, + struct bfd_link_info *lnkinfo) { - struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; - struct elf_nds32_ifc_irel_list *irel_ptr = NULL; - nds32_elf_blank_t *relax_blank_list = NULL; - bfd_byte *contents = NULL; - Elf_Internal_Rela *internal_relocs; + bfd_boolean result = TRUE; Elf_Internal_Rela *irel; Elf_Internal_Rela *irelend; - unsigned short insn16 = INSN_IFCALL9; - struct elf_nds32_link_hash_table *table; - int relax_status; + Elf_Internal_Rela *internal_relocs; + unsigned long r_symndx; + enum elf_nds32_reloc_type r_type; - table = nds32_elf_hash_table (info); - relax_status = table->relax_status; + Elf_Internal_Sym *local_syms = NULL; + bfd_byte *contents = NULL; - while (ptr) + relax_group_list_t chain = { .id = -1, .next = NULL, .next_sibling = NULL }; + + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (inbfd)->symtab_hdr; + struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + sym_hashes = elf_sym_hashes (inbfd); + sym_hashes_end = + sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (inbfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + /* reorder RELAX_GROUP when command line option '-r' is applied */ + if (bfd_link_relocatable (lnkinfo)) { - /* Traverse the ifc gather list, and replace the - filter entries by ifcall9. */ - if ((!(relax_status & NDS32_RELAX_JUMP_IFC_DONE) && ptr->enable == 1) - || ((relax_status & NDS32_RELAX_JUMP_IFC_DONE) - && ptr->ex9_enable == 1)) - { - irel_ptr = ptr->irel_head; - if (ptr->h == NULL) - { - /* Local symbol. */ - internal_relocs = _bfd_elf_link_read_relocs - (ptr->sec->owner, ptr->sec, NULL, NULL, TRUE /* keep_memory */); - irelend = internal_relocs + ptr->sec->reloc_count; + elf32_nds32_unify_relax_group (inbfd, insec); + /* goto finish; */ + return result; + } - if (!nds32_get_section_contents (ptr->sec->owner, ptr->sec, - &contents, TRUE)) - return FALSE; + /* Relocations MUST be kept in memory, because relaxation adjust them. */ + internal_relocs = _bfd_elf_link_read_relocs (inbfd, insec, NULL, NULL, + TRUE /* keep_memory */); + if (internal_relocs == NULL) + goto error_return; - while (irel_ptr) - { - if (irel_ptr->keep == 0 && irel_ptr->next) - { - /* The one can be replaced. We have to check whether - there is any alignment point in the region. */ - irel = irel_ptr->irel; - while (((irel_ptr->next->keep == 0 - && irel < irel_ptr->next->irel) - || (irel_ptr->next->keep == 1 && irel < irelend)) - && !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL - && (irel->r_addend & 0x1f) == 2)) - irel++; - if (irel >= irelend - || !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL - && (irel->r_addend & 0x1f) == 2 - && ((irel->r_offset - get_nds32_elf_blank_total - (&relax_blank_list, irel->r_offset, 1)) - & 0x02) == 0)) - { - /* Replace by ifcall9. */ - bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, irel_ptr->irel->r_offset + 2, 2)) - return FALSE; - irel_ptr->irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), - R_NDS32_10IFCU_PCREL_RELA); - } - } - irel_ptr = irel_ptr->next; - } + irelend = internal_relocs + insec->reloc_count; + irel = find_relocs_at_address (internal_relocs, internal_relocs, + irelend, R_NDS32_RELAX_ENTRY); + if (irel == irelend) + goto finish; - /* Delete the redundant code. */ - if (relax_blank_list) - { - nds32_elf_relax_delete_blanks (ptr->sec->owner, ptr->sec, - relax_blank_list); - relax_blank_list = NULL; - } - } - else + /* chain/remove groups */ + for (irel = internal_relocs; irel < irelend; irel++) + { + r_symndx = ELF32_R_SYM (irel->r_info); + r_type = ELF32_R_TYPE (irel->r_info); + if (r_type != R_NDS32_RELAX_GROUP) + continue; + + /* remove it */ + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_NONE); + /* chain it now */ + if (!list_insert (&chain, irel)) + goto error_return; + } + + /* collect group relocations */ + /* presume relocations are sorted */ + relax_group_list_t *pNext = chain.next; + while (pNext) + { + for (irel = internal_relocs; irel < irelend; irel++) + { + if (irel->r_offset == pNext->relo->r_offset) { - /* Global symbol. */ - while (irel_ptr) - { - if (irel_ptr->keep == 0 && irel_ptr->next) - { - /* The one can be replaced, and we have to check - whether there is any alignment point in the region. */ - internal_relocs = _bfd_elf_link_read_relocs - (irel_ptr->sec->owner, irel_ptr->sec, NULL, NULL, - TRUE /* keep_memory */); - irelend = internal_relocs + irel_ptr->sec->reloc_count; - if (!nds32_get_section_contents (irel_ptr->sec->owner, - irel_ptr->sec, &contents, - TRUE)) - return FALSE; + /* ignore Non-TLS relocation types */ + r_type = ELF32_R_TYPE (irel->r_info); + if ((R_NDS32_TLS_LE_HI20 > r_type) + || (R_NDS32_RELAX_ENTRY == r_type)) + continue; - irel = irel_ptr->irel; - while (((irel_ptr->sec == irel_ptr->next->sec - && irel_ptr->next->keep == 0 - && irel < irel_ptr->next->irel) - || ((irel_ptr->sec != irel_ptr->next->sec - || irel_ptr->next->keep == 1) - && irel < irelend)) - && !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL - && (irel->r_addend & 0x1f) == 2)) - irel++; - if (irel >= irelend - || !(ELF32_R_TYPE (irel->r_info) == R_NDS32_LABEL - && (irel->r_addend & 0x1f) == 2 - && ((irel->r_offset - - get_nds32_elf_blank_total (&relax_blank_list, - irel->r_offset, 1)) & 0x02) == 0)) - { - /* Replace by ifcall9. */ - bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); - if (!insert_nds32_elf_blank_recalc_total - (&relax_blank_list, irel_ptr->irel->r_offset + 2, 2)) - return FALSE; - - /* Delete the redundant code, and clear the relocation. */ - nds32_elf_relax_delete_blanks (irel_ptr->sec->owner, - irel_ptr->sec, - relax_blank_list); - irel_ptr->irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), - R_NDS32_10IFCU_PCREL_RELA); - relax_blank_list = NULL; - } - } + if (!list_insert_sibling (pNext, irel)) + goto error_return; + } + else if (irel->r_offset > pNext->relo->r_offset) + { + pNext = pNext->next; + if (!pNext) + break; - irel_ptr = irel_ptr->next; - } + bfd_vma current_offset = pNext->relo->r_offset; + if (irel->r_offset > current_offset) + irel = internal_relocs; /* restart from head */ + else + --irel; /* check current irel again */ + continue; + } + else + { + //printf("irel->off = 0x%08x, pNext->relo->off = 0x%08x (0x%08x)\n", (unsigned)irel->r_offset, (unsigned)pNext->relo->r_offset, (unsigned)first_offset); } } - ptr = ptr->next; + if (pNext) + pNext = pNext->next; } - return TRUE; -} - -/* Relocate ifcall. */ - -static bfd_boolean -nds32_elf_ifc_reloc (void) -{ - struct elf_nds32_ifc_symbol_entry *ptr = ifc_symbol_head; - struct elf_nds32_ifc_irel_list *irel_ptr = NULL; - struct elf_nds32_ifc_irel_list *irel_keeper = NULL; - bfd_vma relocation, address; - unsigned short insn16; - bfd_byte *contents = NULL; - static bfd_boolean done = FALSE; +#ifdef DUBUG_VERBOSE + dump_chain(&chain); +#endif - if (done) - return TRUE; + /* Get symbol table and section content. */ + if (incontents) + contents = incontents; + else if (!nds32_get_section_contents (inbfd, insec, &contents, TRUE) + || !nds32_get_local_syms (inbfd, insec, &local_syms)) + goto error_return; - done = TRUE; + char *local_got_tls_type = elf32_nds32_local_got_tls_type (inbfd); - while (ptr) + /* convert TLS model each group if necessary */ + pNext = chain.next; + int cur_grp_id = -1; + int sethi_rt = -1; + int add_rt = -1; + enum elf_nds32_tls_type tls_type, org_tls_type, eff_tls_type; + tls_type = org_tls_type = eff_tls_type = 0; + while (pNext) { - /* Check the entry is enable ifcall. */ - if (ptr->enable == 1 || ptr->ex9_enable == 1) + relax_group_list_t *pNextSig = pNext->next_sibling; + while (pNextSig) { - /* Get the reserve jump. */ - irel_ptr = ptr->irel_head; - while (irel_ptr) + struct elf_link_hash_entry *h = NULL; + irel = pNextSig->relo; + r_symndx = ELF32_R_SYM(irel->r_info); + r_type = ELF32_R_TYPE(irel->r_info); + + if (pNext->id != cur_grp_id) { - if (irel_ptr->keep == 1) + cur_grp_id = pNext->id; + org_tls_type = get_tls_type (r_type, NULL); + if (r_symndx >= symtab_hdr->sh_info) { - irel_keeper = irel_ptr; - break; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + tls_type = ((struct elf_nds32_link_hash_entry *) h)->tls_type; + } + else + { + /* TODO: find local symbol hash if necessary? */ + tls_type = local_got_tls_type ? local_got_tls_type[r_symndx] : GOT_NORMAL; } - irel_ptr = irel_ptr->next; + + eff_tls_type = 1 << (fls (tls_type) - 1); + sethi_rt = N32_RT5(bfd_getb32 (contents + irel->r_offset)); } - irel_ptr = ptr->irel_head; - if (ptr->h == NULL) + if (eff_tls_type != org_tls_type) { - /* Local symbol. */ - if (!nds32_get_section_contents (ptr->sec->owner, ptr->sec, - &contents, TRUE)) - return FALSE; - - while (irel_ptr) + switch (org_tls_type) { - if (irel_ptr->keep == 0 - && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_10IFCU_PCREL_RELA) + /* DESC to IEGP/IE/LE. */ + case GOT_TLS_DESC: + switch (eff_tls_type) { - relocation = irel_keeper->irel->r_offset; - relocation = relocation - irel_ptr->irel->r_offset; - while (irel_keeper && relocation > 1022) + case GOT_TLS_IE: + switch (r_type) { - irel_keeper = irel_keeper->next; - if (irel_keeper && irel_keeper->keep == 1) - { - relocation = irel_keeper->irel->r_offset; - relocation = relocation - irel_ptr->irel->r_offset; - } + case R_NDS32_TLS_DESC_HI20: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IE_HI20); + break; + case R_NDS32_TLS_DESC_LO12: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IE_LO12); + break; + case R_NDS32_TLS_DESC_ADD: + { + uint32_t insn = bfd_getb32 ( + contents + irel->r_offset); + add_rt = N32_RT5 (insn); + insn = N32_TYPE2 (LWI, add_rt, sethi_rt, 0); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_NONE); +/* irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_IE_LW); +*/ + } + break; + case R_NDS32_TLS_DESC_FUNC: + bfd_putb32 (INSN_NOP, contents + irel->r_offset); + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_RELAX_REMOVE); + break; + case R_NDS32_TLS_DESC_CALL: + { + uint32_t insn = N32_ALU1(ADD, REG_R0, add_rt, + REG_TP); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_NONE); + } + break; + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_PTR_RESOLVED: + case R_NDS32_NONE: + case R_NDS32_LABEL: + break; + default: + BFD_ASSERT(0); + break; } - if (relocation > 1022) + break; + case GOT_TLS_IEGP: + switch (r_type) { - /* Double check. */ - irel_keeper = ptr->irel_head; - while (irel_keeper) - { - if (irel_keeper->keep == 1) - { - relocation = irel_keeper->irel->r_offset; - relocation = relocation - irel_ptr->irel->r_offset; - } - if (relocation <= 1022) - break; - irel_keeper = irel_keeper->next; - } - if (!irel_keeper) - return FALSE; + case R_NDS32_TLS_DESC_HI20: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IEGP_HI20); + break; + case R_NDS32_TLS_DESC_LO12: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IEGP_LO12); + break; + case R_NDS32_TLS_DESC_ADD: + { + uint32_t insn = bfd_getb32 ( + contents + irel->r_offset); + add_rt = N32_RT5 (insn); + insn = N32_MEM(LW, add_rt, sethi_rt, REG_GP, 0); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_NONE); +/* irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_IEGP_LW); +*/ + } + break; + case R_NDS32_TLS_DESC_FUNC: + bfd_putb32 (INSN_NOP, contents + irel->r_offset); + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_RELAX_REMOVE); + break; + case R_NDS32_TLS_DESC_CALL: + { + uint32_t insn = N32_ALU1(ADD, REG_R0, add_rt, + REG_TP); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_NONE); + } + break; + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_PTR_RESOLVED: + case R_NDS32_NONE: + case R_NDS32_LABEL: + break; + default: + BFD_ASSERT(0); + break; } - irel_ptr->irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), - R_NDS32_NONE); - insn16 = INSN_IFCALL9 | (relocation >> 1); - bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); + break; + case GOT_TLS_LE: + switch (r_type) + { + case R_NDS32_TLS_DESC_HI20: + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_LE_HI20); + break; + case R_NDS32_TLS_DESC_LO12: + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_LE_LO12); + break; + case R_NDS32_TLS_DESC_ADD: + { + uint32_t insn = bfd_getb32 (contents + irel->r_offset); + add_rt = N32_RT5 (insn); + insn = N32_ALU1 (ADD, REG_R0, sethi_rt, REG_TP); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_LE_ADD); + } + break; + case R_NDS32_TLS_DESC_FUNC: + bfd_putb32 (INSN_NOP, contents + irel->r_offset); + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_RELAX_REMOVE); + break; + case R_NDS32_TLS_DESC_CALL: + bfd_putb32 (INSN_NOP, contents + irel->r_offset); + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_RELAX_REMOVE); + break; + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_PTR_RESOLVED: + case R_NDS32_NONE: + case R_NDS32_LABEL: + break; + default: + BFD_ASSERT(0); + break; + } + break; + default: +#ifdef DEBUG_VERBOSE + printf ( + "SKIP: %s: %s @ 0x%08x tls_type = 0x%08x, eff_tls_type = 0x%08x, org_tls_type = 0x%08x\n", + inbfd->filename, h ? h->root.root.string : "local", + (unsigned) irel->r_offset, tls_type, eff_tls_type, + org_tls_type); +#endif + break; } - irel_ptr = irel_ptr->next; - } - } - else - { - /* Global symbol. */ - while (irel_ptr) - { - if (irel_ptr->keep == 0 - && ELF32_R_TYPE (irel_ptr->irel->r_info) == R_NDS32_10IFCU_PCREL_RELA) + break; + /* IEGP to IE/LE. */ + case GOT_TLS_IEGP: + switch (eff_tls_type) { - /* Get the distance between ifcall and jump. */ - relocation = (irel_keeper->irel->r_offset - + irel_keeper->sec->output_section->vma - + irel_keeper->sec->output_offset); - address = (irel_ptr->irel->r_offset - + irel_ptr->sec->output_section->vma - + irel_ptr->sec->output_offset); - relocation = relocation - address; - - /* The distance is over ragne, find callee again. */ - while (irel_keeper && relocation > 1022) + case GOT_TLS_IE: + switch (r_type) { - irel_keeper = irel_keeper->next; - if (irel_keeper && irel_keeper->keep ==1) - { - relocation = (irel_keeper->irel->r_offset - + irel_keeper->sec->output_section->vma - + irel_keeper->sec->output_offset); - relocation = relocation - address; - } + case R_NDS32_TLS_IEGP_HI20: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IE_HI20); + break; + case R_NDS32_TLS_IEGP_LO12: + irel->r_info = ELF32_R_INFO(r_symndx, + R_NDS32_TLS_IE_LO12); + break; + case R_NDS32_PTR_RESOLVED: + { + uint32_t insn = bfd_getb32 ( + contents + irel->r_offset); + add_rt = N32_RT5 (insn); + insn = N32_TYPE2 (LWI, add_rt, sethi_rt, 0); + bfd_putb32 (insn, contents + irel->r_offset); + } + break; + case R_NDS32_TLS_IEGP_LW: + break; + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_NONE: + case R_NDS32_LABEL: + break; + default: + BFD_ASSERT(0); + break; } - - if (relocation > 1022) + break; + case GOT_TLS_LE: + switch (r_type) { - /* Double check. */ - irel_keeper = ptr->irel_head; - while (irel_keeper) - { - if (irel_keeper->keep == 1) - { - - relocation = (irel_keeper->irel->r_offset - + irel_keeper->sec->output_section->vma - + irel_keeper->sec->output_offset); - relocation = relocation - address; - } - if (relocation <= 1022) - break; - irel_keeper = irel_keeper->next; - } - if (!irel_keeper) - return FALSE; + case R_NDS32_TLS_IEGP_HI20: + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_LE_HI20); + break; + case R_NDS32_TLS_IEGP_LO12: + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_LE_LO12); + break; + case R_NDS32_TLS_IEGP_LW: + /* irel->r_info = ELF32_R_INFO(r_symndx, R_NDS32_TLS_LE_ADD); */ + bfd_putb32 (INSN_NOP, contents + irel->r_offset); + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_RELAX_REMOVE); + break; + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_NONE: + case R_NDS32_LABEL: + case R_NDS32_PTR_RESOLVED: + break; + default: + BFD_ASSERT(0); + break; } - if (!nds32_get_section_contents - (irel_ptr->sec->owner, irel_ptr->sec, &contents, TRUE)) - return FALSE; - insn16 = INSN_IFCALL9 | (relocation >> 1); - bfd_putb16 (insn16, contents + irel_ptr->irel->r_offset); - irel_ptr->irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), - R_NDS32_NONE); + break; + default: +#ifdef DEBUG_VERBOSE + printf ( + "SKIP: %s: %s @ 0x%08x tls_type = 0x%08x, eff_tls_type = 0x%08x, org_tls_type = 0x%08x\n", + inbfd->filename, h ? h->root.root.string : "local", + (unsigned) irel->r_offset, tls_type, eff_tls_type, + org_tls_type); +#endif + break; + } + break; + /* IE to LE. */ + case GOT_TLS_IE: + switch (eff_tls_type) + { + case GOT_TLS_LE: + switch (r_type) + { + case R_NDS32_TLS_IE_HI20: + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_LE_HI20); + break; + case R_NDS32_TLS_IE_LO12S2: + { + uint32_t insn = bfd_getb32 (contents + irel->r_offset); + add_rt = N32_RT5 (insn); + insn = N32_TYPE2 (ORI, add_rt, sethi_rt, 0); + bfd_putb32 (insn, contents + irel->r_offset); + + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_LE_LO12); + } + break; + /* + case R_NDS32_TLS_IE_ADD: + irel->r_info = ELF32_R_INFO (r_symndx, R_NDS32_TLS_LE_ADD); + break; + */ + case R_NDS32_LOADSTORE: + case R_NDS32_PTR: + case R_NDS32_NONE: + case R_NDS32_LABEL: + break; + default: + BFD_ASSERT(0); + break; + } + break; + default: +#ifdef DEBUG_VERBOSE + printf ( + "SKIP: %s: %s @ 0x%08x tls_type = 0x%08x, eff_tls_type = 0x%08x, org_tls_type = 0x%08x\n", + inbfd->filename, h ? h->root.root.string : "local", + (unsigned) irel->r_offset, tls_type, eff_tls_type, + org_tls_type); +#endif + break; } - irel_ptr =irel_ptr->next; + break; + default: +#ifdef DEBUG_VERBOSE + printf ( + "SKIP: %s: %s @ 0x%08x tls_type = 0x%08x, eff_tls_type = 0x%08x, org_tls_type = 0x%08x\n", + inbfd->filename, h ? h->root.root.string : "local", + (unsigned) irel->r_offset, tls_type, eff_tls_type, + org_tls_type); +#endif + break; } } + pNextSig = pNextSig->next_sibling; } - ptr = ptr->next; - } - - return TRUE; -} -/* End of IFC relaxation. */ - -/* EX9 Instruction Table Relaxation. */ +#if 1 + pNext = pNext->next; +#else + while (pNext) + { + if (pNext->id != cur_grp_id) + break; + pNext = pNext->next; + } +#endif + } -/* Global hash list. */ -struct elf_link_hash_entry_list -{ - struct elf_link_hash_entry *h; - struct elf_link_hash_entry_list *next; -}; +finish: + if (incontents) + contents = NULL; -/* Save different destination but same insn. */ -struct elf_link_hash_entry_mul_list -{ - /* Global symbol times. */ - int times; - /* Save relocation for each global symbol but useful?? */ - Elf_Internal_Rela *irel; - /* For sethi, two sethi may have the same high-part but different low-parts. */ - Elf_Internal_Rela rel_backup; - struct elf_link_hash_entry_list *h_list; - struct elf_link_hash_entry_mul_list *next; -}; + if (internal_relocs != NULL + && elf_section_data (insec)->relocs != internal_relocs) + free (internal_relocs); -/* Instruction hash table. */ -struct elf_nds32_code_hash_entry -{ - struct bfd_hash_entry root; - int times; - /* For insn that can use relocation or constant ex: sethi. */ - int const_insn; - asection *sec; - struct elf_link_hash_entry_mul_list *m_list; - /* Using r_addend. */ - Elf_Internal_Rela *irel; - /* Using r_info. */ - Elf_Internal_Rela rel_backup; -}; + if (contents != NULL + && elf_section_data (insec)->this_hdr.contents != contents) + free (contents); -/* Instruction count list. */ -struct elf_nds32_insn_times_entry -{ - const char *string; - int times; - int order; - asection *sec; - struct elf_link_hash_entry_mul_list *m_list; - Elf_Internal_Rela *irel; - Elf_Internal_Rela rel_backup; - struct elf_nds32_insn_times_entry *next; -}; + if (local_syms != NULL && symtab_hdr->contents != (bfd_byte *) local_syms) + free (local_syms); -/* J and JAL symbol list. */ -struct elf_nds32_symbol_entry -{ - char *string; - unsigned long insn; - struct elf_nds32_symbol_entry *next; -}; + if (chain.next) + { + pNext = chain.next; + relax_group_list_t *pDel; + while (pNext) + { + pDel = pNext; + pNext = pNext->next; + free (pDel); + } + } -/* Relocation list. */ -struct elf_nds32_irel_entry -{ - Elf_Internal_Rela *irel; - struct elf_nds32_irel_entry *next; -}; + return result; -/* ex9.it insn need to be fixed. */ -struct elf_nds32_ex9_refix -{ - Elf_Internal_Rela *irel; - asection *sec; - struct elf_link_hash_entry *h; - int order; - struct elf_nds32_ex9_refix *next; -}; +error_return: + result = FALSE; + goto finish; +} -static struct bfd_hash_table ex9_code_table; -static struct elf_nds32_insn_times_entry *ex9_insn_head = NULL; -static struct elf_nds32_ex9_refix *ex9_refix_head = NULL; +/* End TLS model conversion. */ + -/* EX9 hash function. */ +/* Rom-patch table hash function. */ static struct bfd_hash_entry * -nds32_elf_code_hash_newfunc (struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string) +nds32_elf_ict_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { - struct elf_nds32_code_hash_entry *ret; + struct elf_nds32_ict_hash_entry *ret; /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -13602,1837 +15149,118 @@ nds32_elf_code_hash_newfunc (struct bfd_hash_entry *entry, if (entry == NULL) return entry; - ret = (struct elf_nds32_code_hash_entry*) entry; - ret->times = 0; - ret->const_insn = 0; - ret->m_list = NULL; - ret->sec = NULL; - ret->irel = NULL; + ret = (struct elf_nds32_ict_hash_entry*) entry; + ret->order = 0; return &ret->root; } -/* Insert ex9 entry - this insert must be stable sorted by times. */ - static void -nds32_elf_ex9_insert_entry (struct elf_nds32_insn_times_entry *ptr) +nds32_elf_ict_hash_init (void) { - struct elf_nds32_insn_times_entry *temp; - struct elf_nds32_insn_times_entry *temp2; - - if (ex9_insn_head == NULL) - { - ex9_insn_head = ptr; - ptr->next = NULL; - } - else - { - temp = ex9_insn_head; - temp2 = ex9_insn_head; - while (temp->next && - (temp->next->times >= ptr->times - || temp->times == -1)) - { - if (temp->times == -1) - temp2 = temp; - temp = temp->next; - } - if (ptr->times > temp->times && temp->times != -1) - { - ptr->next = temp; - if (temp2->times == -1) - temp2->next = ptr; - else - ex9_insn_head = ptr; - } - else if (temp->next == NULL) - { - temp->next = ptr; - ptr->next = NULL; - } - else - { - ptr->next = temp->next; - temp->next = ptr; - } - } + if (!bfd_hash_table_init_n (&indirect_call_table, nds32_elf_ict_hash_newfunc, + sizeof (struct elf_nds32_ict_hash_entry), + 1023)) + _bfd_error_handler (_("ld error: cannot init rom patch hash table\n")); + return; } -/* Examine each insn times in hash table. - Handle multi-link hash entry. - - TODO: This function doesn't assign so much info since it is fake. */ - -static int -nds32_elf_examine_insn_times (struct elf_nds32_code_hash_entry *h) +/* Relocate for NDS32_ICT_SECTION. */ +static void +nds32_elf_ict_relocate (bfd *output_bfd, struct bfd_link_info *info) { - struct elf_nds32_insn_times_entry *ptr; - int times; - - if (h->m_list == NULL) - { - /* Local symbol insn or insn without relocation. */ - if (h->times < 3) - return TRUE; - - ptr = (struct elf_nds32_insn_times_entry *) - bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - ptr->times = h->times; - ptr->string = h->root.string; - ptr->m_list = NULL; - ptr->sec = h->sec; - ptr->irel = h->irel; - ptr->rel_backup = h->rel_backup; - nds32_elf_ex9_insert_entry (ptr); - } - else - { - /* Global symbol insn. */ - /* Only sethi insn has multiple m_list. */ - struct elf_link_hash_entry_mul_list *m_list = h->m_list; + static bfd_boolean done = FALSE; + asection *sec; + bfd_byte *contents = NULL; + uint32_t insn; + unsigned int i; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *h2; + bfd_vma relocation, base; - times = 0; - while (m_list) - { - times += m_list->times; - m_list = m_list->next; - } - if (times >= 3) - { - m_list = h->m_list; - ptr = (struct elf_nds32_insn_times_entry *) - bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - ptr->times = times; /* Use the total times. */ - ptr->string = h->root.string; - ptr->m_list = m_list; - ptr->sec = h->sec; - ptr->irel = m_list->irel; - ptr->rel_backup = m_list->rel_backup; - nds32_elf_ex9_insert_entry (ptr); - } - if (h->const_insn == 1) - { - /* sethi with constant value. */ - if (h->times < 3) - return TRUE; + if (done) + return; - ptr = (struct elf_nds32_insn_times_entry *) - bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - ptr->times = h->times; - ptr->string = h->root.string; - ptr->m_list = NULL; - ptr->sec = NULL; - ptr->irel = NULL; - ptr->rel_backup = h->rel_backup; - nds32_elf_ex9_insert_entry (ptr); - } - } - return TRUE; -} + done = TRUE; -/* Count each insn times in hash table. - Handle multi-link hash entry. */ + sec = nds32_elf_get_target_section (info, NDS32_ICT_SECTION); + h2 = bfd_link_hash_lookup (info->hash, "_INDIRECT_CALL_TABLE_BASE_", + FALSE, FALSE, FALSE); + base = ((h2->u.def.value + + h2->u.def.section->output_section->vma + + h2->u.def.section->output_offset)); -static int -nds32_elf_count_insn_times (struct elf_nds32_code_hash_entry *h) -{ - int reservation, times; - unsigned long relocation, min_relocation; - struct elf_nds32_insn_times_entry *ptr; + if (!nds32_get_section_contents (sec->owner, sec, &contents, TRUE)) + return; - if (h->m_list == NULL) - { - /* Local symbol insn or insn without relocation. */ - if (h->times < 3) - return TRUE; - ptr = (struct elf_nds32_insn_times_entry *) - bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - ptr->times = h->times; - ptr->string = h->root.string; - ptr->m_list = NULL; - ptr->sec = h->sec; - ptr->irel = h->irel; - ptr->rel_backup = h->rel_backup; - nds32_elf_ex9_insert_entry (ptr); - } - else + indirect_call_table.frozen = 1; + for (i = 0; i < indirect_call_table.size; i++) { - /* Global symbol insn. */ - /* Only sethi insn has multiple m_list. */ - struct elf_link_hash_entry_mul_list *m_list = h->m_list; + struct bfd_hash_entry *p; + struct elf_nds32_ict_hash_entry *entry; - if (ELF32_R_TYPE (m_list->rel_backup.r_info) == R_NDS32_HI20_RELA - && m_list->next != NULL) + for (p = indirect_call_table.table[i]; p != NULL; p = p->next) { - /* Sethi insn has different symbol or addend but has same hi20. */ - times = 0; - reservation = 1; - relocation = 0; - min_relocation = 0xffffffff; - while (m_list) + entry = (struct elf_nds32_ict_hash_entry *) p; + insn = INSN_J; + h = entry->h; + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section != NULL + && h->root.u.def.section->output_section != NULL) { - /* Get the minimum sethi address - and calculate how many entry the sethi-list have to use. */ - if ((m_list->h_list->h->root.type == bfd_link_hash_defined - || m_list->h_list->h->root.type == bfd_link_hash_defweak) - && (m_list->h_list->h->root.u.def.section != NULL - && m_list->h_list->h->root.u.def.section->output_section != NULL)) + if (ict_model == R_NDS32_RELAX_ENTRY_ICT_LARGE) { - relocation = (m_list->h_list->h->root.u.def.value + - m_list->h_list->h->root.u.def.section->output_section->vma + - m_list->h_list->h->root.u.def.section->output_offset); - relocation += m_list->irel->r_addend; + insn = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; + bfd_put_32 (output_bfd, insn, contents + (entry->order) * 4); } else - relocation = 0; - if (relocation < min_relocation) - min_relocation = relocation; - times += m_list->times; - m_list = m_list->next; + { + relocation = h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset; + insn |= ((relocation - base - entry->order * 4) >> 1) + & 0xffffff; + bfd_putb32 (insn, contents + (entry->order) * 4); + } } - if (min_relocation < ex9_relax_size) - reservation = (min_relocation >> 12) + 1; else - reservation = (min_relocation >> 12) - - ((min_relocation - ex9_relax_size) >> 12) + 1; - if (reservation < (times / 3)) { - /* Efficient enough to use ex9. */ - int i; - - for (i = reservation ; i > 0; i--) + if (ict_model == R_NDS32_RELAX_ENTRY_ICT_LARGE) { - /* Allocate number of reservation ex9 entry. */ - ptr = (struct elf_nds32_insn_times_entry *) - bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - ptr->times = h->m_list->times / reservation; - ptr->string = h->root.string; - ptr->m_list = h->m_list; - ptr->sec = h->sec; - ptr->irel = h->m_list->irel; - ptr->rel_backup = h->m_list->rel_backup; - nds32_elf_ex9_insert_entry (ptr); + insn = 0; + bfd_put_32 (output_bfd, insn, contents + (entry->order) * 4); } + else + bfd_putb32 (insn, contents + (entry->order) * 4); } } - else - { - /* Normal global symbol that means no different address symbol - using same ex9 entry. */ - if (m_list->times >= 3) - { - ptr = (struct elf_nds32_insn_times_entry *) - bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - ptr->times = m_list->times; - ptr->string = h->root.string; - ptr->m_list = h->m_list; - ptr->sec = h->sec; - ptr->irel = h->m_list->irel; - ptr->rel_backup = h->m_list->rel_backup; - nds32_elf_ex9_insert_entry (ptr); - } - } - - if (h->const_insn == 1) - { - /* sethi with constant value. */ - if (h->times < 3) - return TRUE; - - ptr = (struct elf_nds32_insn_times_entry *) - bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - ptr->times = h->times; - ptr->string = h->root.string; - ptr->m_list = NULL; - ptr->sec = NULL; - ptr->irel = NULL; - ptr->rel_backup = h->rel_backup; - nds32_elf_ex9_insert_entry (ptr); - } } - - return TRUE; + indirect_call_table.frozen = 0; } -/* Hash table traverse function. */ - -static void -nds32_elf_code_hash_traverse (int (*func) (struct elf_nds32_code_hash_entry*)) +static asection* +nds32_elf_get_target_section (struct bfd_link_info *info, char *name) { - unsigned int i; + asection *sec = NULL; + bfd *abfd; - ex9_code_table.frozen = 1; - for (i = 0; i < ex9_code_table.size; i++) + for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next) { - struct bfd_hash_entry *p; - - for (p = ex9_code_table.table[i]; p != NULL; p = p->next) - if (!func ((struct elf_nds32_code_hash_entry *) p)) - goto out; - } -out: - ex9_code_table.frozen = 0; -} - - -/* Give order number to insn list. */ - -static void -nds32_elf_order_insn_times (struct bfd_link_info *info) -{ - struct elf_nds32_insn_times_entry *ex9_insn; - struct elf_nds32_insn_times_entry *temp = NULL; - struct elf_nds32_link_hash_table *table; - int ex9_limit; - int number = 0; - - if (ex9_insn_head == NULL) - return; - -/* The max number of entries is 512. */ - ex9_insn = ex9_insn_head; - table = nds32_elf_hash_table (info); - ex9_limit = table->ex9_limit; - - ex9_insn = ex9_insn_head; - - while (ex9_insn != NULL && number < ex9_limit) - { - ex9_insn->order = number; - number++; - temp = ex9_insn; - ex9_insn = ex9_insn->next; - } - - if (ex9_insn && temp) - temp->next = NULL; - - while (ex9_insn != NULL) - { - /* Free useless entry. */ - temp = ex9_insn; - ex9_insn = ex9_insn->next; - free (temp); - } -} - -/* Build .ex9.itable section. */ - -static void -nds32_elf_ex9_build_itable (struct bfd_link_info *link_info) -{ - asection *table_sec; - struct elf_nds32_insn_times_entry *ptr; - bfd *it_abfd; - int number = 0; - bfd_byte *contents = NULL; - - for (it_abfd = link_info->input_bfds; it_abfd != NULL; - it_abfd = it_abfd->link.next) - { - /* Find the section .ex9.itable, and put all entries into it. */ - table_sec = bfd_get_section_by_name (it_abfd, ".ex9.itable"); - if (table_sec != NULL) - { - if (!nds32_get_section_contents (it_abfd, table_sec, &contents, TRUE)) - return; - - for (ptr = ex9_insn_head; ptr !=NULL ; ptr = ptr->next) - number++; - - table_sec->size = number * 4; - - if (number == 0) - return; - - elf_elfheader (link_info->output_bfd)->e_flags |= E_NDS32_HAS_EX9_INST; - number = 0; - for (ptr = ex9_insn_head; ptr !=NULL ; ptr = ptr->next) - { - long val; - - val = strtol (ptr->string, NULL, 16); - bfd_putb32 ((bfd_vma) val, (char *) contents + (number * 4)); - number++; - } - break; - } - } -} - -/* Get insn with regs according to relocation type. */ - -static void -nds32_elf_get_insn_with_reg (Elf_Internal_Rela *irel, - uint32_t insn, uint32_t *insn_with_reg) -{ - reloc_howto_type *howto = NULL; - - if (irel == NULL - || (ELF32_R_TYPE (irel->r_info) >= (int) ARRAY_SIZE (nds32_elf_howto_table) - && (ELF32_R_TYPE (irel->r_info) - R_NDS32_RELAX_ENTRY) - >= (int) ARRAY_SIZE (nds32_elf_relax_howto_table))) - { - *insn_with_reg = insn; - return; - } - - howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info)); - *insn_with_reg = insn & (0xffffffff ^ howto->dst_mask); -} - -/* Mask number of address bits according to relocation. */ - -static unsigned long -nds32_elf_irel_mask (Elf_Internal_Rela *irel) -{ - reloc_howto_type *howto = NULL; - - if (irel == NULL - || (ELF32_R_TYPE (irel->r_info) >= (int) ARRAY_SIZE (nds32_elf_howto_table) - && (ELF32_R_TYPE (irel->r_info) - R_NDS32_RELAX_ENTRY) - >= (int) ARRAY_SIZE (nds32_elf_relax_howto_table))) - return 0; - - howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info)); - return howto->dst_mask; -} - -static void -nds32_elf_insert_irel_entry (struct elf_nds32_irel_entry **irel_list, - struct elf_nds32_irel_entry *irel_ptr) -{ - if (*irel_list == NULL) - { - *irel_list = irel_ptr; - irel_ptr->next = NULL; - } - else - { - irel_ptr->next = *irel_list; - *irel_list = irel_ptr; - } -} - -static void -nds32_elf_ex9_insert_fix (asection * sec, Elf_Internal_Rela * irel, - struct elf_link_hash_entry *h, int order) -{ - struct elf_nds32_ex9_refix *ptr; - - ptr = bfd_malloc (sizeof (struct elf_nds32_ex9_refix)); - ptr->sec = sec; - ptr->irel = irel; - ptr->h = h; - ptr->order = order; - ptr->next = NULL; - - if (ex9_refix_head == NULL) - ex9_refix_head = ptr; - else - { - struct elf_nds32_ex9_refix *temp = ex9_refix_head; - - while (temp->next != NULL) - temp = temp->next; - temp->next = ptr; - } -} - -enum -{ - DATA_EXIST = 1, - CLEAN_PRE = 1 << 1, - PUSH_PRE = 1 << 2 -}; - -/* Check relocation type if supporting for ex9. */ - -static int -nds32_elf_ex9_relocation_check (struct bfd_link_info *info, - Elf_Internal_Rela **irel, - Elf_Internal_Rela *irelend, - nds32_elf_blank_t *relax_blank_list, - asection *sec,bfd_vma *off, - bfd_byte *contents) -{ - /* Suppress ex9 if `.no_relax ex9' or inner loop. */ - bfd_boolean nested_ex9, nested_loop; - bfd_boolean ex9_loop_aware; - /* We use the highest 1 byte of result to record - how many bytes location counter has to move. */ - int result = 0; - Elf_Internal_Rela *irel_save = NULL; - struct elf_nds32_link_hash_table *table; - - table = nds32_elf_hash_table (info); - ex9_loop_aware = table->ex9_loop_aware; - - while ((*irel) != NULL && (*irel) < irelend && *off == (*irel)->r_offset) - { - switch (ELF32_R_TYPE ((*irel)->r_info)) - { - case R_NDS32_RELAX_REGION_BEGIN: - /* Ignore code block. */ - nested_ex9 = FALSE; - nested_loop = FALSE; - if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG) - || (ex9_loop_aware - && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG))) - { - /* Check the region if loop or not. If it is true and - ex9-loop-aware is true, ignore the region till region end. */ - /* To save the status for in .no_relax ex9 region and - loop region to conform the block can do ex9 relaxation. */ - nested_ex9 = ((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG); - nested_loop = (ex9_loop_aware - && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)); - while ((*irel) && (*irel) < irelend && (nested_ex9 || nested_loop)) - { - (*irel)++; - if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_BEGIN) - { - /* There may be nested region. */ - if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG) != 0) - nested_ex9 = TRUE; - else if (ex9_loop_aware - && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)) - nested_loop = TRUE; - } - else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_RELAX_REGION_END) - { - /* The end of region. */ - if (((*irel)->r_addend & R_NDS32_RELAX_REGION_NO_EX9_FLAG) != 0) - nested_ex9 = FALSE; - else if (ex9_loop_aware - && ((*irel)->r_addend & R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG)) - nested_loop = FALSE; - } - else if (ELF32_R_TYPE ((*irel)->r_info) == R_NDS32_LABEL - && ((*irel)->r_addend & 0x1f) == 2) - { - /* Alignment exist in the region. */ - result |= CLEAN_PRE; - if (((*irel)->r_offset - - get_nds32_elf_blank_total (&relax_blank_list, - (*irel)->r_offset, 0)) & 0x02) - result |= PUSH_PRE; - } - } - if ((*irel) >= irelend) - *off = sec->size; - else - *off = (*irel)->r_offset; - - /* The final instruction in the region, regard this one as data to ignore it. */ - result |= DATA_EXIST; - return result; - } - break; - - case R_NDS32_LABEL: - if (((*irel)->r_addend & 0x1f) == 2) - { - /* Check this point is align and decide to do ex9 or not. */ - result |= CLEAN_PRE; - if (((*irel)->r_offset - - get_nds32_elf_blank_total (&relax_blank_list, - (*irel)->r_offset, 0)) & 0x02) - result |= PUSH_PRE; - } - break; - case R_NDS32_32_RELA: - /* Data. */ - result |= (4 << 24); - result |= DATA_EXIST; - break; - case R_NDS32_16_RELA: - /* Data. */ - result |= (2 << 24); - result |= DATA_EXIST; - break; - case R_NDS32_DATA: - /* Data. */ - /* The least code alignment is 2. If the data is only one byte, - we have to shift one more byte. */ - if ((*irel)->r_addend == 1) - result |= ((*irel)->r_addend << 25) ; - else - result |= ((*irel)->r_addend << 24) ; - - result |= DATA_EXIST; - break; - - case R_NDS32_25_PCREL_RELA: - case R_NDS32_SDA16S3_RELA: - case R_NDS32_SDA15S3_RELA: - case R_NDS32_SDA15S3: - case R_NDS32_SDA17S2_RELA: - case R_NDS32_SDA15S2_RELA: - case R_NDS32_SDA12S2_SP_RELA: - case R_NDS32_SDA12S2_DP_RELA: - case R_NDS32_SDA15S2: - case R_NDS32_SDA18S1_RELA: - case R_NDS32_SDA15S1_RELA: - case R_NDS32_SDA15S1: - case R_NDS32_SDA19S0_RELA: - case R_NDS32_SDA15S0_RELA: - case R_NDS32_SDA15S0: - case R_NDS32_HI20_RELA: - case R_NDS32_LO12S0_ORI_RELA: - case R_NDS32_LO12S0_RELA: - case R_NDS32_LO12S1_RELA: - case R_NDS32_LO12S2_RELA: - /* These relocation is supported ex9 relaxation currently. */ - /* We have to save the relocation for using later, since we have - to check there is any alignment in the same address. */ - irel_save = *irel; - break; - default: - /* Not support relocations. */ - if (ELF32_R_TYPE ((*irel)->r_info) < ARRAY_SIZE (nds32_elf_howto_table) - && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_NONE - && ELF32_R_TYPE ((*irel)->r_info) != R_NDS32_INSN16) - { - /* Note: To optimize aggressively, it maybe can ignore R_NDS32_INSN16 here. - But we have to consider if there is any side-effect. */ - if (!(result & DATA_EXIST)) - { - /* We have to confirm there is no data relocation in the - same address. In general case, this won't happen. */ - /* We have to do ex9 conservative, for those relocation not - considerd we ignore instruction. */ - result |= DATA_EXIST; - if (*(contents + *off) & 0x80) - result |= (2 << 24); - else - result |= (4 << 24); - break; - } - } - } - if ((*irel) < irelend - && ((*irel) + 1) < irelend - && (*irel)->r_offset == ((*irel) + 1)->r_offset) - /* There are relocations pointing to the same address, we have to - check all of them. */ - (*irel)++; - else - { - if (irel_save) - *irel = irel_save; - return result; - } - } - return result; -} - -/* Replace with ex9 instruction. */ - -static bfd_boolean -nds32_elf_ex9_push_insn (uint16_t insn16, bfd_byte *contents, bfd_vma pre_off, - nds32_elf_blank_t **relax_blank_list, - struct elf_nds32_irel_entry *pre_irel_ptr, - struct elf_nds32_irel_entry **irel_list) -{ - if (insn16 != 0) - { - /* Implement the ex9 relaxation. */ - bfd_putb16 (insn16, contents + pre_off); - if (!insert_nds32_elf_blank_recalc_total (relax_blank_list, - pre_off + 2, 2)) - return FALSE; - if (pre_irel_ptr != NULL) - nds32_elf_insert_irel_entry (irel_list, pre_irel_ptr); - } - return TRUE; -} - -/* Replace input file instruction which is in ex9 itable. */ - -static bfd_boolean -nds32_elf_ex9_replace_instruction (struct bfd_link_info *info, bfd *abfd, asection *sec) -{ - struct elf_nds32_insn_times_entry *ex9_insn = ex9_insn_head; - bfd_byte *contents = NULL; - bfd_vma off; - uint16_t insn16, insn_ex9; - /* `pre_*' are used to track previous instruction that can use ex9.it. */ - bfd_vma pre_off = -1; - uint16_t pre_insn16 = 0; - struct elf_nds32_irel_entry *pre_irel_ptr = NULL; - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *irel; - Elf_Internal_Rela *irelend; - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Sym *isym = NULL; - nds32_elf_blank_t *relax_blank_list = NULL; - uint32_t insn = 0; - uint32_t insn_with_reg = 0; - uint32_t it_insn; - uint32_t it_insn_with_reg; - unsigned long r_symndx; - asection *isec; - struct elf_nds32_irel_entry *irel_list = NULL; - struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (abfd); - int data_flag, do_replace, save_irel; - struct elf_link_hash_entry_list *h_list; - - - /* Load section instructions, relocations, and symbol table. */ - if (!nds32_get_section_contents (abfd, sec, &contents, TRUE) - || !nds32_get_local_syms (abfd, sec, &isym)) - return FALSE; - internal_relocs = - _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, TRUE /* keep_memory */); - irelend = internal_relocs + sec->reloc_count; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - - off = 0; - - /* Check if the object enable ex9. */ - irel = find_relocs_at_address (internal_relocs, internal_relocs, - irelend, R_NDS32_RELAX_ENTRY); - - /* Check this section trigger ex9 relaxation. */ - if (irel == NULL - || irel >= irelend - || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY - || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY - && !(irel->r_addend & R_NDS32_RELAX_ENTRY_EX9_FLAG))) - return TRUE; - - irel = internal_relocs; - - /* Check alignment and fetch proper relocation. */ - while (off < sec->size) - { - struct elf_link_hash_entry *h = NULL; - struct elf_nds32_irel_entry *irel_ptr = NULL; - - /* Syn the instruction and the relocation. */ - while (irel != NULL && irel < irelend && irel->r_offset < off) - irel++; - - data_flag = nds32_elf_ex9_relocation_check (info, &irel, irelend, - relax_blank_list, sec, - &off, contents); - if (data_flag & PUSH_PRE) - if (!nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, - &relax_blank_list, pre_irel_ptr, - &irel_list)) - return FALSE; - - if (data_flag & CLEAN_PRE) - { - pre_off = 0; - pre_insn16 = 0; - pre_irel_ptr = NULL; - } - if (data_flag & DATA_EXIST) - { - /* We save the move offset in the highest byte. */ - off += (data_flag >> 24); - continue; - } - - if (*(contents + off) & 0x80) - { - /* 2-byte instruction. */ - off += 2; - continue; - } - - /* Load the instruction and its opcode with register for comparing. */ - ex9_insn = ex9_insn_head; - insn = bfd_getb32 (contents + off); - insn_with_reg = 0; - while (ex9_insn) - { - it_insn = strtol (ex9_insn->string, NULL, 16); - it_insn_with_reg = 0; - do_replace = 0; - save_irel = 0; - - if (irel != NULL && irel < irelend && irel->r_offset == off) - { - /* Insn with relocation. */ - nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg); - - if (ex9_insn->irel != NULL) - nds32_elf_get_insn_with_reg (ex9_insn->irel, it_insn, - &it_insn_with_reg); - - if (ex9_insn->irel != NULL - && (ELF32_R_TYPE (irel->r_info) == - ELF32_R_TYPE (ex9_insn->irel->r_info)) - && (insn_with_reg == it_insn_with_reg)) - { - /* Insn relocation and format is the same as table entry. */ - - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_ORI_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S1_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_RELA - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3 - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA - && ELF32_R_TYPE (irel->r_info) <= - R_NDS32_SDA12S2_SP_RELA) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA)) - { - r_symndx = ELF32_R_SYM (irel->r_info); - if (r_symndx < symtab_hdr->sh_info) - { - /* Local symbol. */ - int shndx = isym[r_symndx].st_shndx; - - isec = elf_elfsections (abfd)[shndx]->bfd_section; - if (ex9_insn->sec == isec - && ex9_insn->irel->r_addend == irel->r_addend - && ex9_insn->irel->r_info == irel->r_info) - { - do_replace = 1; - save_irel = 1; - } - } - else - { - /* External symbol. */ - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (ex9_insn->m_list) - { - h_list = ex9_insn->m_list->h_list; - while (h_list) - { - if (h == h_list->h - && (ex9_insn->m_list->irel->r_addend == - irel->r_addend)) - { - do_replace = 1; - save_irel = 1; - break; - } - h_list = h_list->next; - } - } - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_HI20_RELA) - { - r_symndx = ELF32_R_SYM (irel->r_info); - if (r_symndx < symtab_hdr->sh_info) - { - /* Local symbols. Compare its base symbol and offset. */ - int shndx = isym[r_symndx].st_shndx; - - isec = elf_elfsections (abfd)[shndx]->bfd_section; - if (ex9_insn->sec == isec - && ex9_insn->irel->r_addend == irel->r_addend - && ex9_insn->irel->r_info == irel->r_info) - { - do_replace = 1; - save_irel = 1; - } - } - else - { - /* External symbol. */ - struct elf_link_hash_entry_mul_list *m_list; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - m_list = ex9_insn->m_list; - - while (m_list) - { - h_list = m_list->h_list; - - while (h_list) - { - if (h == h_list->h - && (m_list->irel->r_addend - == irel->r_addend)) - { - do_replace = 1; - save_irel = 1; - if (ex9_insn->next - && ex9_insn->m_list - && ex9_insn->m_list == ex9_insn->next->m_list) - { - /* sethi multiple entry must be fixed */ - nds32_elf_ex9_insert_fix (sec, irel, - h, ex9_insn->order); - } - break; - } - h_list = h_list->next; - } - m_list = m_list->next; - } - } - } - } - - /* Import table: Check the symbol hash table and the - jump target. Only R_NDS32_25_PCREL_RELA now. */ - else if (ex9_insn->times == -1 - && ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA) - { - nds32_elf_get_insn_with_reg (irel, it_insn, &it_insn_with_reg); - if (insn_with_reg == it_insn_with_reg) - { - char code[10]; - bfd_vma relocation; - - r_symndx = ELF32_R_SYM (irel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && h->root.u.def.section != NULL - && h->root.u.def.section->output_section != NULL - && h->root.u.def.section->gc_mark == 1 - && bfd_is_abs_section (h->root.u.def.section) - && h->root.u.def.value > sec->size) - { - relocation = h->root.u.def.value + - h->root.u.def.section->output_section->vma + - h->root.u.def.section->output_offset; - relocation += irel->r_addend; - insn = insn_with_reg - | ((relocation >> 1) & 0xffffff); - snprintf (code, sizeof (code), "%08x", insn); - if (strcmp (code, ex9_insn->string) == 0) - { - do_replace = 1; - save_irel = 1; - } - } - } - } - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN - || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END - || ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE) - { - /* These relocations do not have to relocate contens, so it can - be regard as instruction without relocation. */ - if (insn == it_insn && ex9_insn->irel == NULL) - do_replace = 1; - } - } - else - { - /* Instruction without relocation, we only - have to compare their byte code. */ - if (insn == it_insn && ex9_insn->irel == NULL) - do_replace = 1; - } - - /* Insntruction match so replacing the code here. */ - if (do_replace == 1) - { - /* There are two formats of ex9 instruction. */ - if (ex9_insn->order < 32) - insn_ex9 = INSN_EX9_IT_2; - else - insn_ex9 = INSN_EX9_IT_1; - insn16 = insn_ex9 | ex9_insn->order; - - /* Insert ex9 instruction. */ - nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, - &relax_blank_list, pre_irel_ptr, - &irel_list); - pre_off = off; - pre_insn16 = insn16; - - if (save_irel) - { - /* For instuction with relocation do relax. */ - irel_ptr = (struct elf_nds32_irel_entry *) - bfd_malloc (sizeof (struct elf_nds32_irel_entry)); - irel_ptr->irel = irel; - irel_ptr->next = NULL; - pre_irel_ptr = irel_ptr; - } - else - pre_irel_ptr = NULL; - break; - } - ex9_insn = ex9_insn->next; - } - off += 4; - } - - /* Insert ex9 instruction. */ - nds32_elf_ex9_push_insn (pre_insn16, contents, pre_off, - &relax_blank_list, pre_irel_ptr, - &irel_list); - - /* Delete the redundant code. */ - if (relax_blank_list) - { - nds32_elf_relax_delete_blanks (abfd, sec, relax_blank_list); - relax_blank_list = NULL; - } - - /* Clear the relocation that is replaced by ex9. */ - while (irel_list) - { - struct elf_nds32_irel_entry *irel_ptr; - - irel_ptr = irel_list; - irel_list = irel_ptr->next; - irel_ptr->irel->r_info = - ELF32_R_INFO (ELF32_R_SYM (irel_ptr->irel->r_info), R_NDS32_TRAN); - free (irel_ptr); - } - return TRUE; -} - -/* Initialize ex9 hash table. */ - -int -nds32_elf_ex9_init (void) -{ - if (!bfd_hash_table_init_n (&ex9_code_table, nds32_elf_code_hash_newfunc, - sizeof (struct elf_nds32_code_hash_entry), - 1023)) - { - _bfd_error_handler (_("Linker: cannot init ex9 hash table error \n")); - return FALSE; - } - return TRUE; -} - -/* Predict how many bytes will be relaxed with ex9 and ifc. */ - -static void -nds32_elf_ex9_total_relax (struct bfd_link_info *info) -{ - struct elf_nds32_insn_times_entry *ex9_insn; - struct elf_nds32_insn_times_entry *temp; - int target_optimize; - struct elf_nds32_link_hash_table *table; - - if (ex9_insn_head == NULL) - return; - - table = nds32_elf_hash_table (info); - target_optimize = table->target_optimize; - ex9_insn = ex9_insn_head; - while (ex9_insn) - { - ex9_relax_size = ex9_insn->times * 2 + ex9_relax_size; - temp = ex9_insn; - ex9_insn = ex9_insn->next; - free (temp); - } - ex9_insn_head = NULL; - - if ((target_optimize & NDS32_RELAX_JUMP_IFC_ON)) - { - /* Examine ifc reduce size. */ - struct elf_nds32_ifc_symbol_entry *ifc_ent = ifc_symbol_head; - struct elf_nds32_ifc_irel_list *irel_ptr = NULL; - int size = 0; - - while (ifc_ent) - { - if (ifc_ent->enable == 0) - { - /* Not ifc yet. */ - irel_ptr = ifc_ent->irel_head; - while (irel_ptr) - { - size += 2; - irel_ptr = irel_ptr->next; - } - } - size -= 2; - ifc_ent = ifc_ent->next; - } - ex9_relax_size += size; - } -} - -/* Finish ex9 table. */ - -void -nds32_elf_ex9_finish (struct bfd_link_info *link_info) -{ - nds32_elf_code_hash_traverse (nds32_elf_examine_insn_times); - nds32_elf_order_insn_times (link_info); - nds32_elf_ex9_total_relax (link_info); - /* Traverse the hash table and count its times. */ - nds32_elf_code_hash_traverse (nds32_elf_count_insn_times); - nds32_elf_order_insn_times (link_info); - nds32_elf_ex9_build_itable (link_info); -} - -/* Relocate the entries in ex9 table. */ - -static bfd_vma -nds32_elf_ex9_reloc_insn (struct elf_nds32_insn_times_entry *ptr, - struct bfd_link_info *link_info) -{ - Elf_Internal_Sym *isym = NULL; - bfd_vma relocation = -1; - struct elf_link_hash_entry *h; - - if (ptr->m_list != NULL) - { - /* Global symbol. */ - h = ptr->m_list->h_list->h; - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && h->root.u.def.section != NULL - && h->root.u.def.section->output_section != NULL) - { - - relocation = h->root.u.def.value + - h->root.u.def.section->output_section->vma + - h->root.u.def.section->output_offset; - relocation += ptr->m_list->irel->r_addend; - } - else - relocation = 0; - } - else if (ptr->sec !=NULL) - { - /* Local symbol. */ - Elf_Internal_Sym sym; - asection *sec = NULL; - asection isec; - asection *isec_ptr = &isec; - Elf_Internal_Rela irel_backup = *(ptr->irel); - asection *sec_backup = ptr->sec; - bfd *abfd = ptr->sec->owner; - - if (!nds32_get_local_syms (abfd, sec, &isym)) - return FALSE; - isym = isym + ELF32_R_SYM (ptr->irel->r_info); - - sec = bfd_section_from_elf_index (abfd, isym->st_shndx); - if (sec != NULL) - *isec_ptr = *sec; - sym = *isym; - - /* The purpose is same as elf_link_input_bfd. */ - if (isec_ptr != NULL - && isec_ptr->sec_info_type == SEC_INFO_TYPE_MERGE - && ELF_ST_TYPE (isym->st_info) != STT_SECTION) - { - sym.st_value = - _bfd_merged_section_offset (ptr->sec->output_section->owner, &isec_ptr, - elf_section_data (isec_ptr)->sec_info, - isym->st_value); - } - relocation = _bfd_elf_rela_local_sym (link_info->output_bfd, &sym, - &ptr->sec, ptr->irel); - if (ptr->irel != NULL) - relocation += ptr->irel->r_addend; - - /* Restore origin value since there may be some insntructions that - could not be replaced with ex9.it. */ - *(ptr->irel) = irel_backup; - ptr->sec = sec_backup; - } - - return relocation; -} - -/* Import ex9 table and build list. */ - -void -nds32_elf_ex9_import_table (struct bfd_link_info *info) -{ - int num = 0; - bfd_byte *contents; - FILE *ex9_import_file; - int update_ex9_table; - struct elf_nds32_link_hash_table *table; - - table = nds32_elf_hash_table (info); - ex9_import_file = table->ex9_import_file; - rewind (table->ex9_import_file); - - contents = bfd_malloc (sizeof (bfd_byte) * 4); - - /* Read instructions from the input file and build the list. */ - while (!feof (ex9_import_file)) - { - unsigned long insn; - char *code; - struct elf_nds32_insn_times_entry *ptr; - size_t nread; - - nread = fread (contents, sizeof (bfd_byte) * 4, 1, ex9_import_file); - /* Ignore the final byte 0x0a. */ - if (nread < 1) - break; - insn = bfd_getb32 (contents); - code = bfd_malloc (sizeof (char) * 9); - snprintf (code, 9, "%08lx", (insn & 0xffffffff)); - ptr = bfd_malloc (sizeof (struct elf_nds32_insn_times_entry)); - ptr->string = code; - ptr->order = num; - ptr->times = -1; - ptr->sec = NULL; - ptr->m_list = NULL; - ptr->rel_backup.r_offset = 0; - ptr->rel_backup.r_info = 0; - ptr->rel_backup.r_addend = 0; - ptr->irel = NULL; - ptr->next = NULL; - nds32_elf_ex9_insert_entry (ptr); - num++; - } - - update_ex9_table = table->update_ex9_table; - if (update_ex9_table == 1) - { - /* It has to consider of sethi need to use multiple page - but it not be done yet. */ - nds32_elf_code_hash_traverse (nds32_elf_examine_insn_times); - nds32_elf_order_insn_times (info); - } -} - -/* Export ex9 table. */ - -static void -nds32_elf_ex9_export (struct bfd_link_info *info, - bfd_byte *contents, int size) -{ - FILE *ex9_export_file; - struct elf_nds32_link_hash_table *table; - - table = nds32_elf_hash_table (info); - ex9_export_file = table->ex9_export_file; - fwrite (contents, sizeof (bfd_byte), size, ex9_export_file); - fclose (ex9_export_file); -} - -/* Adjust relocations of J and JAL in ex9.itable. - Export ex9 table. */ - -static void -nds32_elf_ex9_reloc_jmp (struct bfd_link_info *link_info) -{ - asection *table_sec = NULL; - struct elf_nds32_insn_times_entry *ex9_insn = ex9_insn_head; - struct elf_nds32_insn_times_entry *temp_ptr, *temp_ptr2; - bfd *it_abfd; - uint32_t insn, insn_with_reg, source_insn; - bfd_byte *contents = NULL, *source_contents = NULL; - int size = 0; - bfd_vma gp; - int shift, update_ex9_table, offset = 0; - reloc_howto_type *howto = NULL; - Elf_Internal_Rela rel_backup; - unsigned short insn_ex9; - struct elf_nds32_link_hash_table *table; - FILE *ex9_export_file; - static bfd_boolean done = FALSE; - - if (done) - return; - - done = TRUE; - - table = nds32_elf_hash_table (link_info); - if (table) - table->relax_status |= NDS32_RELAX_EX9_DONE; - - - update_ex9_table = table->update_ex9_table; - /* Generated ex9.itable exactly. */ - if (update_ex9_table == 0) - { - for (it_abfd = link_info->input_bfds; it_abfd != NULL; - it_abfd = it_abfd->link.next) - { - table_sec = bfd_get_section_by_name (it_abfd, ".ex9.itable"); - if (table_sec != NULL) - break; - } - - if (table_sec != NULL) - { - bfd *output_bfd; - - output_bfd = table_sec->output_section->owner; - nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); - if (table_sec->size == 0) - return; - - if (!nds32_get_section_contents (it_abfd, table_sec, &contents, TRUE)) - return; - } - } - else - { - /* Set gp. */ - bfd *output_bfd; - - output_bfd = link_info->input_bfds->sections->output_section->owner; - nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); - contents = bfd_malloc (sizeof (bfd_byte) * 2048); - } - - /* Relocate instruction. */ - while (ex9_insn) - { - bfd_vma relocation, min_relocation = 0xffffffff; - - insn = strtol (ex9_insn->string, NULL, 16); - insn_with_reg = 0; - if (ex9_insn->m_list != NULL || ex9_insn->sec != NULL) - { - if (ex9_insn->m_list) - rel_backup = ex9_insn->m_list->rel_backup; - else - rel_backup = ex9_insn->rel_backup; - - nds32_elf_get_insn_with_reg (&rel_backup, insn, &insn_with_reg); - howto = - bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE - (rel_backup.r_info)); - shift = howto->rightshift; - if (ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_25_PCREL_RELA - || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S0_ORI_RELA - || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S0_RELA - || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S1_RELA - || ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_LO12S2_RELA) - { - relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info); - insn = - insn_with_reg | ((relocation >> shift) & - nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4); - } - else if ((ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA15S3 - && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA15S0) - || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA15S3_RELA - && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA15S0_RELA) - || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA12S2_DP_RELA - && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA12S2_SP_RELA) - || (ELF32_R_TYPE (rel_backup.r_info) >= R_NDS32_SDA16S3_RELA - && ELF32_R_TYPE (rel_backup.r_info) <= R_NDS32_SDA19S0_RELA)) - { - relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info); - insn = - insn_with_reg | (((relocation - gp) >> shift) & - nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4); - } - else if (ELF32_R_TYPE (rel_backup.r_info) == R_NDS32_HI20_RELA) - { - /* Sethi may be multiple entry for one insn. */ - if (ex9_insn->next && ex9_insn->m_list - && ex9_insn->m_list == ex9_insn->next->m_list) - { - struct elf_link_hash_entry_mul_list *m_list; - struct elf_nds32_ex9_refix *fix_ptr; - struct elf_link_hash_entry *h; - - temp_ptr = ex9_insn; - temp_ptr2 = ex9_insn; - m_list = ex9_insn->m_list; - while (m_list) - { - h = m_list->h_list->h; - relocation = h->root.u.def.value + - h->root.u.def.section->output_section->vma + - h->root.u.def.section->output_offset; - relocation += m_list->irel->r_addend; - - if (relocation < min_relocation) - min_relocation = relocation; - m_list = m_list->next; - } - relocation = min_relocation; - - /* Put insntruction into ex9 table. */ - insn = insn_with_reg - | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4); - relocation = relocation + 0x1000; /* hi20 */ - - while (ex9_insn->next && ex9_insn->m_list - && ex9_insn->m_list == ex9_insn->next->m_list) - { - /* Multiple sethi. */ - ex9_insn = ex9_insn->next; - size += 4; - insn = - insn_with_reg | ((relocation >> shift) & - nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4); - relocation = relocation + 0x1000; /* hi20 */ - } - - fix_ptr = ex9_refix_head; - while (fix_ptr) - { - /* Fix ex9 insn. */ - /* temp_ptr2 points to the head of multiple sethi. */ - temp_ptr = temp_ptr2; - while (fix_ptr->order != temp_ptr->order && fix_ptr->next) - { - fix_ptr = fix_ptr->next; - } - if (fix_ptr->order != temp_ptr->order) - break; - - /* Set source insn. */ - relocation = - fix_ptr->h->root.u.def.value + - fix_ptr->h->root.u.def.section->output_section->vma + - fix_ptr->h->root.u.def.section->output_offset; - relocation += fix_ptr->irel->r_addend; - /* sethi imm is imm20s. */ - source_insn = insn_with_reg | ((relocation >> shift) & 0xfffff); - - while (temp_ptr) - { - /* Match entry and source code. */ - insn = bfd_getb32 (contents + (temp_ptr->order) * 4 + offset); - if (insn == source_insn) - { - /* Fix the ex9 insn. */ - if (temp_ptr->order != fix_ptr->order) - { - if (!nds32_get_section_contents - (fix_ptr->sec->owner, fix_ptr->sec, - &source_contents, TRUE)) - _bfd_error_handler - (_("Linker: error cannot fixed ex9 relocation \n")); - if (temp_ptr->order < 32) - insn_ex9 = INSN_EX9_IT_2; - else - insn_ex9 = INSN_EX9_IT_1; - insn_ex9 = insn_ex9 | temp_ptr->order; - bfd_putb16 (insn_ex9, source_contents + fix_ptr->irel->r_offset); - } - break; - } - else - { - if (!temp_ptr->next || temp_ptr->m_list != temp_ptr->next->m_list) - _bfd_error_handler - (_("Linker: error cannot fixed ex9 relocation \n")); - else - temp_ptr = temp_ptr->next; - } - } - fix_ptr = fix_ptr->next; - } - } - else - { - relocation = nds32_elf_ex9_reloc_insn (ex9_insn, link_info); - insn = insn_with_reg - | ((relocation >> shift) & nds32_elf_irel_mask (&rel_backup)); - bfd_putb32 (insn, contents + (ex9_insn->order) * 4); - } - } - } - else - { - /* Insn without relocation does not have to be fixed - if need to update export table. */ - if (update_ex9_table == 1) - bfd_putb32 (insn, contents + (ex9_insn->order) * 4); - } - ex9_insn = ex9_insn->next; - size += 4; + sec = bfd_get_section_by_name (abfd, name); + if (sec != NULL) + break; } - ex9_export_file = table->ex9_export_file; - if (ex9_export_file != NULL) - nds32_elf_ex9_export (link_info, contents, table_sec->size); - else if (update_ex9_table == 1) - { - table->ex9_export_file = table->ex9_import_file; - rewind (table->ex9_export_file); - nds32_elf_ex9_export (link_info, contents, size); - } -} - -/* Generate ex9 hash table. */ - -static bfd_boolean -nds32_elf_ex9_build_hash_table (bfd *abfd, asection *sec, - struct bfd_link_info *link_info) -{ - Elf_Internal_Rela *internal_relocs; - Elf_Internal_Rela *irelend; - Elf_Internal_Rela *irel; - Elf_Internal_Rela *jrel; - Elf_Internal_Rela rel_backup; - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Sym *isym = NULL; - asection *isec; - struct elf_link_hash_entry **sym_hashes; - bfd_byte *contents = NULL; - bfd_vma off = 0; - unsigned long r_symndx; - uint32_t insn, insn_with_reg; - struct elf_link_hash_entry *h; - int data_flag, shift, align; - bfd_vma relocation; - /* Suppress ex9 if `.no_relax ex9' or inner loop. */ - reloc_howto_type *howto = NULL; - - sym_hashes = elf_sym_hashes (abfd); - /* Load section instructions, relocations, and symbol table. */ - if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)) - return FALSE; - - internal_relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, - TRUE /* keep_memory */); - irelend = internal_relocs + sec->reloc_count; - symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - if (!nds32_get_local_syms (abfd, sec, &isym)) - return FALSE; - - /* Check the object if enable ex9. */ - irel = find_relocs_at_address (internal_relocs, internal_relocs, irelend, - R_NDS32_RELAX_ENTRY); - - /* Check this section trigger ex9 relaxation. */ - if (irel == NULL - || irel >= irelend - || ELF32_R_TYPE (irel->r_info) != R_NDS32_RELAX_ENTRY - || (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_ENTRY - && !(irel->r_addend & R_NDS32_RELAX_ENTRY_EX9_FLAG))) - return TRUE; - - irel = internal_relocs; - - /* Push each insn into hash table. */ - while (off < sec->size) - { - char code[10]; - struct elf_nds32_code_hash_entry *entry; - - while (irel != NULL && irel < irelend && irel->r_offset < off) - irel++; - - data_flag = nds32_elf_ex9_relocation_check (link_info, &irel, irelend, - NULL, sec, &off, contents); - if (data_flag & DATA_EXIST) - { - /* We save the move offset in the highest byte. */ - off += (data_flag >> 24); - continue; - } - - if (*(contents + off) & 0x80) - { - off += 2; - } - else - { - h = NULL; - isec = NULL; - jrel = NULL; - rel_backup.r_info = 0; - rel_backup.r_offset = 0; - rel_backup.r_addend = 0; - /* Load the instruction and its opcode with register for comparing. */ - insn = bfd_getb32 (contents + off); - insn_with_reg = 0; - if (irel != NULL && irel < irelend && irel->r_offset == off) - { - nds32_elf_get_insn_with_reg (irel, insn, &insn_with_reg); - howto = bfd_elf32_bfd_reloc_type_table_lookup (ELF32_R_TYPE (irel->r_info)); - shift = howto->rightshift; - align = (1 << shift) - 1; - if (ELF32_R_TYPE (irel->r_info) == R_NDS32_25_PCREL_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_HI20_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_ORI_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S0_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S1_RELA - || ELF32_R_TYPE (irel->r_info) == R_NDS32_LO12S2_RELA - ||(ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3 - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA12S2_SP_RELA) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA)) - { - r_symndx = ELF32_R_SYM (irel->r_info); - jrel = irel; - rel_backup = *irel; - if (r_symndx < symtab_hdr->sh_info) - { - /* Local symbol. */ - int shndx = isym[r_symndx].st_shndx; - - bfd_vma st_value = (isym + r_symndx)->st_value; - isec = elf_elfsections (abfd)[shndx]->bfd_section; - relocation = (isec->output_section->vma + isec->output_offset - + st_value + irel->r_addend); - } - else - { - /* External symbol. */ - bfd_boolean warned ATTRIBUTE_UNUSED; - bfd_boolean ignored ATTRIBUTE_UNUSED; - bfd_boolean unresolved_reloc ATTRIBUTE_UNUSED; - asection *sym_sec; - - /* Maybe there is a better way to get h and relocation */ - RELOC_FOR_GLOBAL_SYMBOL (link_info, abfd, sec, irel, - r_symndx, symtab_hdr, sym_hashes, - h, sym_sec, relocation, - unresolved_reloc, warned, ignored); - relocation += irel->r_addend; - if ((h->root.type != bfd_link_hash_defined - && h->root.type != bfd_link_hash_defweak) - || strcmp (h->root.root.string, "_FP_BASE_") == 0) - { - off += 4; - continue; - } - } - - /* Check for gp relative instruction alignment. */ - if ((ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3 - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA15S3_RELA - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA15S0_RELA) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA12S2_DP_RELA - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA12S2_SP_RELA) - || (ELF32_R_TYPE (irel->r_info) >= R_NDS32_SDA16S3_RELA - && ELF32_R_TYPE (irel->r_info) <= R_NDS32_SDA19S0_RELA)) - { - bfd_vma gp; - bfd *output_bfd = sec->output_section->owner; - bfd_reloc_status_type r; - - /* If the symbol is in the abs section, the out_bfd will be null. - This happens when the relocation has a symbol@GOTOFF. */ - r = nds32_elf_final_sda_base (output_bfd, link_info, &gp, FALSE); - if (r != bfd_reloc_ok) - { - off += 4; - continue; - } - - relocation -= gp; - - /* Make sure alignment is correct. */ - if (relocation & align) - { - /* Incorrect alignment. */ - _bfd_error_handler - /* xgettext:c-format */ - (_("%B: warning: unaligned small data access " - "for entry: {%Ld, %Ld, %Ld}, addr = %#Lx, align = %#x"), - abfd, irel->r_offset, - irel->r_info, irel->r_addend, relocation, align); - off += 4; - continue; - } - } - - insn = insn_with_reg - | ((relocation >> shift) & nds32_elf_irel_mask (irel)); - } - else if (ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_BEGIN - || ELF32_R_TYPE (irel->r_info) == R_NDS32_RELAX_REGION_END - || ELF32_R_TYPE (irel->r_info) == R_NDS32_NONE) - { - /* These relocations do not have to relocate contens, so it can - be regard as instruction without relocation. */ - } - else - { - off += 4; - continue; - } - } - - snprintf (code, sizeof (code), "%08x", insn); - /* Copy "code". */ - entry = (struct elf_nds32_code_hash_entry*) - bfd_hash_lookup (&ex9_code_table, code, TRUE, TRUE); - if (entry == NULL) - { - _bfd_error_handler - (_("failed creating ex9.it %s hash table entry"), code); - return FALSE; - } - if (h) - { - if (h->root.type == bfd_link_hash_undefined) - return TRUE; - /* Global symbol. */ - /* In order to do sethi with different symbol but same value. */ - if (entry->m_list == NULL) - { - struct elf_link_hash_entry_mul_list *m_list_new; - struct elf_link_hash_entry_list *h_list_new; - - m_list_new = (struct elf_link_hash_entry_mul_list *) - bfd_malloc (sizeof (struct elf_link_hash_entry_mul_list)); - h_list_new = (struct elf_link_hash_entry_list *) - bfd_malloc (sizeof (struct elf_link_hash_entry_list)); - entry->m_list = m_list_new; - m_list_new->h_list = h_list_new; - m_list_new->rel_backup = rel_backup; - m_list_new->times = 1; - m_list_new->irel = jrel; - m_list_new->next = NULL; - h_list_new->h = h; - h_list_new->next = NULL; - } - else - { - struct elf_link_hash_entry_mul_list *m_list = entry->m_list; - struct elf_link_hash_entry_list *h_list; - - while (m_list) - { - /* Build the different symbols that point to the same address. */ - h_list = m_list->h_list; - if (h_list->h->root.u.def.value == h->root.u.def.value - && h_list->h->root.u.def.section->output_section->vma - == h->root.u.def.section->output_section->vma - && h_list->h->root.u.def.section->output_offset - == h->root.u.def.section->output_offset - && m_list->rel_backup.r_addend == rel_backup.r_addend) - { - m_list->times++; - m_list->irel = jrel; - while (h_list->h != h && h_list->next) - h_list = h_list->next; - if (h_list->h != h) - { - struct elf_link_hash_entry_list *h_list_new; - - h_list_new = (struct elf_link_hash_entry_list *) - bfd_malloc (sizeof (struct elf_link_hash_entry_list)); - h_list->next = h_list_new; - h_list_new->h = h; - h_list_new->next = NULL; - } - break; - } - /* The sethi case may have different address but the - hi20 is the same. */ - else if (ELF32_R_TYPE (jrel->r_info) == R_NDS32_HI20_RELA - && m_list->next == NULL) - { - struct elf_link_hash_entry_mul_list *m_list_new; - struct elf_link_hash_entry_list *h_list_new; - - m_list_new = (struct elf_link_hash_entry_mul_list *) - bfd_malloc (sizeof (struct elf_link_hash_entry_mul_list)); - h_list_new = (struct elf_link_hash_entry_list *) - bfd_malloc (sizeof (struct elf_link_hash_entry_list)); - m_list->next = m_list_new; - m_list_new->h_list = h_list_new; - m_list_new->rel_backup = rel_backup; - m_list_new->times = 1; - m_list_new->irel = jrel; - m_list_new->next = NULL; - h_list_new->h = h; - h_list_new->next = NULL; - break; - } - m_list = m_list->next; - } - if (!m_list) - { - off += 4; - continue; - } - } - } - else - { - /* Local symbol and insn without relocation*/ - entry->times++; - entry->rel_backup = rel_backup; - } - - /* Use in sethi insn with constant and global symbol in same format. */ - if (!jrel) - entry->const_insn = 1; - else - entry->irel = jrel; - entry->sec = isec; - off += 4; - } - } - return TRUE; + return sec; } - -/* Set the _ITB_BASE, and point it to ex9 table. */ - -bfd_boolean -nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) -{ - bfd *abfd; - asection *sec; - bfd *output_bfd = NULL; - struct bfd_link_hash_entry *bh = NULL; - - if (is_ITB_BASE_set == 1) - return TRUE; - - is_ITB_BASE_set = 1; - - bh = bfd_link_hash_lookup (link_info->hash, "_ITB_BASE_", FALSE, FALSE, TRUE); - - if (bh && (bh->type == bfd_link_hash_defined - || bh->type == bfd_link_hash_defweak)) - return TRUE; - - for (abfd = link_info->input_bfds; abfd != NULL; - abfd = abfd->link.next) - { - sec = bfd_get_section_by_name (abfd, ".ex9.itable"); - if (sec != NULL) - { - output_bfd = sec->output_section->owner; - break; - } - } - if (output_bfd == NULL) - { - output_bfd = link_info->output_bfd; - if (output_bfd->sections == NULL) - return TRUE; - else - sec = bfd_abs_section_ptr; - } - bh = bfd_link_hash_lookup (link_info->hash, "_ITB_BASE_", - FALSE, FALSE, TRUE); - return (_bfd_generic_link_add_one_symbol - (link_info, output_bfd, "_ITB_BASE_", - BSF_GLOBAL | BSF_WEAK, sec, 0, - (const char *) NULL, FALSE, get_elf_backend_data - (output_bfd)->collect, &bh)); -} /* End EX9.IT */ #define ELF_ARCH bfd_arch_nds32 #define ELF_MACHINE_CODE EM_NDS32 #define ELF_MAXPAGESIZE 0x1000 -#define ELF_TARGET_ID NDS32_ELF_DATA +#define ELF_TARGET_ID NDS32_ELF_DATA #define TARGET_BIG_SYM nds32_elf32_be_vec #define TARGET_BIG_NAME "elf32-nds32be" @@ -15448,7 +15276,7 @@ nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) #define bfd_elf32_bfd_relax_section nds32_elf_relax_section #define bfd_elf32_bfd_set_private_flags nds32_elf_set_private_flags -#define bfd_elf32_mkobject nds32_elf_mkobject +#define bfd_elf32_mkobject nds32_elf_mkobject #define elf_backend_action_discarded nds32_elf_action_discarded #define elf_backend_add_symbol_hook nds32_elf_add_symbol_hook #define elf_backend_check_relocs nds32_elf_check_relocs @@ -15469,7 +15297,9 @@ nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) #define elf_backend_final_write_processing nds32_elf_final_write_processing #define elf_backend_special_sections nds32_elf_special_sections #define bfd_elf32_bfd_get_relocated_section_contents \ - nds32_elf_get_relocated_section_contents + nds32_elf_get_relocated_section_contents +#define bfd_elf32_bfd_is_target_special_symbol nds32_elf_is_target_special_symbol +#define elf_backend_maybe_function_sym nds32_elf_maybe_function_sym #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 @@ -15480,7 +15310,6 @@ nds32_elf_ex9_itb_base (struct bfd_link_info *link_info) #define elf_backend_may_use_rel_p 1 #define elf_backend_default_use_rela_p 1 #define elf_backend_may_use_rela_p 1 -#define elf_backend_dtrel_excludes_plt 1 #include "elf32-target.h" diff --git a/bfd/elf32-nds32.h b/bfd/elf32-nds32.h index 7e09e01..8016c89 100644 --- a/bfd/elf32-nds32.h +++ b/bfd/elf32-nds32.h @@ -22,6 +22,8 @@ #ifndef ELF32_NDS32_H #define ELF32_NDS32_H +#include "bfd_stdint.h" + #ifdef __cplusplus extern "C" { #endif @@ -40,12 +42,13 @@ extern "C" { /* To distinguish the assembly code generated by compiler or written manually. */ #define R_NDS32_RELAX_ENTRY_VERBATIM_FLAG (1 << 28) -/* EX9 and link-time IFC must be explicitly enabled, so we - won't mess up handcraft assembly code. */ -/* Enable EX9 optimization for this section. */ -#define R_NDS32_RELAX_ENTRY_EX9_FLAG (1 << 2) -/* Enable IFC optimization for this section. */ -#define R_NDS32_RELAX_ENTRY_IFC_FLAG (1 << 3) +/* Two bits for ICT to comply with files without directive. */ +/* ICT small model. */ +#define R_NDS32_RELAX_ENTRY_ICT_SMALL (0x2 << 4) +/* ICT large model. */ +#define R_NDS32_RELAX_ENTRY_ICT_LARGE (0x3 << 4) +/* Mask for get ict bits. */ +#define R_NDS32_RELAX_ENTRY_ICT_MASK (0x3 << 4) /* Relocation flags for R_NDS32_INSN16. */ @@ -66,8 +69,6 @@ extern "C" { /* NOT_OMIT_FP_FLAG is set if this region is not worth for fp-as-gp. */ #define R_NDS32_RELAX_REGION_NOT_OMIT_FP_FLAG (1 << 1) -/* Suppress EX9 optimization in the region. */ -#define R_NDS32_RELAX_REGION_NO_EX9_FLAG (1 << 2) /* A Innermost loop region. Some optimizations is suppressed in this region due to performance drop. */ #define R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG (1 << 4) @@ -91,35 +92,57 @@ enum NDS32_RELAX_NONE_ROUND = 0, NDS32_RELAX_NORMAL_ROUND, NDS32_RELAX_JUMP_IFC_ROUND, + NDS32_RELAX_IFC_ROUND, NDS32_RELAX_EX9_BUILD_ROUND, NDS32_RELAX_EX9_REPLACE_ROUND, NDS32_RELAX_EMPTY_ROUND }; -/* Optimization status mask. */ -#define NDS32_RELAX_JUMP_IFC_DONE (1 << 0) -#define NDS32_RELAX_EX9_DONE (1 << 1) +/* Security tag. */ +enum +{ + NDS32_SECURITY_NONE = 0, + NDS32_SECURITY_START, + NDS32_SECURITY_RESTART, + NDS32_SECURITY_END +}; /* Optimization turn on mask. */ -#define NDS32_RELAX_JUMP_IFC_ON (1 << 0) +#define NDS32_RELAX_IFC_ON (1 << 0) #define NDS32_RELAX_EX9_ON (1 << 1) extern void nds32_insertion_sort (void *, size_t, size_t, int (*) (const void *, const void *)); -extern int nds32_elf_ex9_init (void); -extern int nds32_convert_32_to_16 (bfd *, uint32_t, uint16_t *, int *); -extern int nds32_convert_16_to_32 (bfd *, uint16_t, uint32_t *); -extern void bfd_elf32_nds32_set_target_option (struct bfd_link_info *, - int, int, FILE *, int, - int, int, int, FILE *, - FILE *, int, int, - bfd_boolean, bfd_boolean); +struct section_id_list_t +{ + int id; + struct section_id_list_t *next; +}; + +extern struct section_id_list_t * +elf32_nds32_lookup_section_id (int, struct section_id_list_t **); +extern int elf32_nds32_check_relax_group (bfd *, asection *); +extern int elf32_nds32_unify_relax_group (bfd *, asection *); +extern int nds32_elf_unify_tls_model (bfd *, asection *, bfd_byte *, + struct bfd_link_info *); + +extern void bfd_elf32_nds32_set_target_option (struct bfd_link_info *, int, int, + FILE *, int, int, int, int, int, + int, char *); +extern void bfd_elf32_nds32_append_section (struct bfd_link_info*, bfd *); +extern int nds32_convert_32_to_16 (bfd *, uint32_t, uint16_t *, int *); +extern int nds32_convert_16_to_32 (bfd *, uint16_t, uint32_t *); #define nds32_elf_hash_table(info) \ (elf_hash_table_id ((struct elf_link_hash_table *) ((info)->hash)) \ - == NDS32_ELF_DATA ? \ - ((struct elf_nds32_link_hash_table *) ((info)->hash)) : NULL) + == NDS32_ELF_DATA ? ((struct elf_nds32_link_hash_table *) ((info)->hash)) : NULL) + +#define elf32_nds32_compute_jump_table_size(htab) \ + ((htab)->next_tls_desc_index * 4) + +#define elf32_nds32_local_tlsdesc_gotent(bfd) \ + (elf_nds32_tdata (bfd)->local_tlsdesc_gotent) /* Hash table structure for target nds32. There are some members to save target options passed from nds32elf.em to bfd. */ @@ -144,12 +167,34 @@ struct elf_nds32_link_hash_table int target_optimize; /* Switch optimization. */ int relax_status; /* Finished optimization. */ int relax_round; /* Going optimization. */ - FILE *ex9_export_file; /* --mexport-ex9= */ - FILE *ex9_import_file; /* --mimport-ex9= */ - int update_ex9_table; /* --mupdate-ex9. */ - int ex9_limit; - bfd_boolean ex9_loop_aware; /* Ignore ex9 if inside a loop. */ - bfd_boolean ifc_loop_aware; /* Ignore ifc if inside a loop. */ + bfd_boolean hyper_relax; /* Relax for symbol not in RW sections. */ + int tls_desc_trampoline; /* --m[no-]tlsdesc-trampoline. */ + + /* The offset into splt of the PLT entry for the TLS descriptor + resolver. Special values are 0, if not necessary (or not found + to be necessary yet), and -1 if needed but not determined + yet. */ + bfd_vma dt_tlsdesc_plt; + + /* The offset into sgot of the GOT entry used by the PLT entry + above. */ + bfd_vma dt_tlsdesc_got; + + /* Offset in .plt section of tls_nds32_trampoline. */ + bfd_vma tls_trampoline; + + /* The index of the next unused R_NDS32_TLS_DESC slot in .rel.plt. */ + bfd_vma next_tls_desc_index; + + /* How many R_NDS32_TLS_DESC relocations were generated so far. */ + bfd_vma num_tls_desc; + + /* The amount of space used by the reserved portion of the sgotplt + section, plus whatever space is used by the jump slots. */ + bfd_vma sgotplt_jump_table_size; + + /* True if the target uses REL relocations. */ + int use_rel; }; #ifdef __cplusplus diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c index aad4bd0..e160054 100644 --- a/bfd/elf32-nios2.c +++ b/bfd/elf32-nios2.c @@ -31,6 +31,7 @@ #include "elf/nios2.h" #include "opcode/nios2.h" #include "elf32-nios2.h" +#include "libiberty.h" /* Use RELA relocations. */ #ifndef USE_RELA @@ -1578,10 +1579,8 @@ lookup_howto (unsigned int rtype, bfd *abfd) int i; /* R2 relocations are a superset of R1, so use that for the lookup table. */ - int r1_howto_tbl_size = (int) (sizeof (elf_nios2_r1_howto_table_rel) - / sizeof (elf_nios2_r1_howto_table_rel[0])); - int r2_howto_tbl_size = (int) (sizeof (elf_nios2_r2_howto_table_rel) - / sizeof (elf_nios2_r2_howto_table_rel[0])); + int r1_howto_tbl_size = (int) ARRAY_SIZE (elf_nios2_r1_howto_table_rel); + int r2_howto_tbl_size = (int) ARRAY_SIZE (elf_nios2_r2_howto_table_rel); if (!initialized) { @@ -1597,18 +1596,19 @@ lookup_howto (unsigned int rtype, bfd *abfd) } } - BFD_ASSERT (rtype <= R_NIOS2_ILLEGAL); + if (rtype > R_NIOS2_ILLEGAL) + return NULL; i = elf_code_to_howto_index[rtype]; if (BFD_IS_R2 (abfd)) { if (i >= r2_howto_tbl_size) - return 0; + return NULL; return elf_nios2_r2_howto_table_rel + i; } else { if (i >= r1_howto_tbl_size) - return 0; + return NULL; return elf_nios2_r1_howto_table_rel + i; } } @@ -1620,7 +1620,8 @@ struct elf_reloc_map enum elf_nios2_reloc_type elf_val; }; -static const struct elf_reloc_map nios2_reloc_map[] = { +static const struct elf_reloc_map nios2_reloc_map[] = +{ {BFD_RELOC_NONE, R_NIOS2_NONE}, {BFD_RELOC_NIOS2_S16, R_NIOS2_S16}, {BFD_RELOC_NIOS2_U16, R_NIOS2_U16}, @@ -2204,7 +2205,7 @@ nios2_add_stub (const char *stub_name, if (hsh == NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: cannot create stub entry %s"), + _bfd_error_handler (_("%pB: cannot create stub entry %s"), section->owner, stub_name); return NULL; @@ -2926,7 +2927,7 @@ nios2_elf32_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (bfd_big_endian (ibfd)) { _bfd_error_handler - (_("error: %B: Big-endian R2 is not supported."), ibfd); + (_("error: %pB: big-endian R2 is not supported"), ibfd); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2942,7 +2943,7 @@ nios2_elf32_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) architectures. */ _bfd_error_handler /* xgettext:c-format */ - (_("error: %B: Conflicting CPU architectures %d/%d"), + (_("error: %pB: conflicting CPU architectures %d/%d"), ibfd, new_flags, old_flags); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -2954,18 +2955,16 @@ nios2_elf32_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) return TRUE; } - /* Implement bfd_elf32_bfd_reloc_type_lookup: Given a BFD reloc type, return a howto structure. */ + static reloc_howto_type * nios2_elf32_bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { int i; - for (i = 0; - i < (int) (sizeof (nios2_reloc_map) / sizeof (struct elf_reloc_map)); - ++i) + for (i = 0; i < (int) ARRAY_SIZE (nios2_reloc_map); ++i) if (nios2_reloc_map[i].bfd_val == code) return lookup_howto (nios2_reloc_map[i].elf_val, abfd); return NULL; @@ -2973,6 +2972,7 @@ nios2_elf32_bfd_reloc_type_lookup (bfd *abfd, /* Implement bfd_elf32_bfd_reloc_name_lookup: Given a reloc name, return a howto structure. */ + static reloc_howto_type * nios2_elf32_bfd_reloc_name_lookup (bfd *abfd, const char *r_name) @@ -2984,32 +2984,40 @@ nios2_elf32_bfd_reloc_name_lookup (bfd *abfd, if (BFD_IS_R2 (abfd)) { howto_tbl = elf_nios2_r2_howto_table_rel; - howto_tbl_size = (int) (sizeof (elf_nios2_r2_howto_table_rel) - / sizeof (elf_nios2_r2_howto_table_rel[0])); + howto_tbl_size = (int) ARRAY_SIZE (elf_nios2_r2_howto_table_rel); } else { howto_tbl = elf_nios2_r1_howto_table_rel; - howto_tbl_size = (int) (sizeof (elf_nios2_r1_howto_table_rel) - / sizeof (elf_nios2_r1_howto_table_rel[0])); + howto_tbl_size = (int) ARRAY_SIZE (elf_nios2_r1_howto_table_rel); } for (i = 0; i < howto_tbl_size; i++) if (howto_tbl[i].name && strcasecmp (howto_tbl[i].name, r_name) == 0) return howto_tbl + i; + return NULL; } /* Implement elf_info_to_howto: Given a ELF32 relocation, fill in a arelent structure. */ -static void + +static bfd_boolean nios2_elf32_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - cache_ptr->howto = lookup_howto (r_type, abfd); + if ((cache_ptr->howto = lookup_howto (r_type, abfd)) == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } /* Return the base VMA address which should be subtracted from real addresses @@ -3831,10 +3839,10 @@ nios2_elf32_relocate_section (bfd *output_bfd, if (h) name = h->root.root.string; /* xgettext:c-format */ - format = _("Unable to reach %s (at 0x%08x) from the " + format = _("unable to reach %s (at 0x%08x) from the " "global pointer (at 0x%08x) because the " "offset (%d) is out of the allowed range, " - "-32678 to 32767.\n" ); + "-32678 to 32767\n" ); sprintf (msgbuf, format, name, symbol_address, gp, (signed)relocation); msg = msgbuf; @@ -4355,10 +4363,10 @@ nios2_elf32_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s relocation not " + (_("%pB(%pA+%#" PRIx64 "): %s relocation not " "permitted in shared object"), input_bfd, input_section, - rel->r_offset, howto->name); + (uint64_t) rel->r_offset, howto->name); return FALSE; } else diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c index c3a2a8f..91b780f 100644 --- a/bfd/elf32-or1k.c +++ b/bfd/elf32-or1k.c @@ -701,8 +701,8 @@ or1k_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an Or1k ELF reloc. */ -static void -or1k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +or1k_info_to_howto_rela (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -712,10 +712,13 @@ or1k_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_OR1K_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid OR1K reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = & or1k_elf_howto_table[r_type]; + return TRUE; } @@ -962,7 +965,8 @@ or1k_elf_relocate_section (bfd *output_bfd, /* Addend should be zero. */ if (rel->r_addend != 0) _bfd_error_handler - (_("internal error: addend should be zero for R_OR1K_GOT16")); + (_("internal error: addend should be zero for %s"), + "R_OR1K_GOT16"); break; @@ -1049,7 +1053,7 @@ or1k_elf_relocate_section (bfd *output_bfd, { BFD_FAIL (); _bfd_error_handler - (_("%B: probably compiled without -fPIC?"), + (_("%pB: probably compiled without -fPIC?"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1071,7 +1075,7 @@ or1k_elf_relocate_section (bfd *output_bfd, /* TODO: implement support for local dynamic. */ BFD_FAIL (); _bfd_error_handler - (_("%B: support for local dynamic not implemented"), + (_("%pB: support for local dynamic not implemented"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1206,7 +1210,7 @@ or1k_elf_relocate_section (bfd *output_bfd, be used as linker input. */ BFD_FAIL (); _bfd_error_handler - (_("%B: will not resolve runtime TLS relocation"), + (_("%pB: will not resolve runtime TLS relocation"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1526,7 +1530,7 @@ or1k_elf_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: bad relocation section name `%s\'"), + (_("%pB: bad relocation section name `%s\'"), abfd, name); } @@ -2278,7 +2282,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2638,7 +2642,8 @@ elf32_or1k_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_OR1K_NODELAY) != (out_flags & EF_OR1K_NODELAY)) { _bfd_error_handler - (_("%B: EF_OR1K_NODELAY flag mismatch with previous modules"), ibfd); + (_("%pB: %s flag mismatch with previous modules"), + ibfd, "EF_OR1K_NODELAY"); bfd_set_error (bfd_error_bad_value); return FALSE; diff --git a/bfd/elf32-pj.c b/bfd/elf32-pj.c index 3487524..470d20a 100644 --- a/bfd/elf32-pj.c +++ b/bfd/elf32-pj.c @@ -310,8 +310,8 @@ pj_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Given an ELF reloc, fill in the howto field of a relent. */ -static void -pj_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +pj_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -322,13 +322,14 @@ pj_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, if (r >= R_PJ_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised PicoJava reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r); bfd_set_error (bfd_error_bad_value); - r = R_PJ_NONE; + return FALSE; } cache_ptr->howto = &pj_elf_howto_table[r]; + return TRUE; } /* Take this moment to fill in the special picoJava bits in the diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 32104a1..66bbf0d 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -69,7 +69,7 @@ static bfd_reloc_status_type ppc_elf_unhandled_reloc /* For new-style .glink and .plt. */ #define GLINK_PLTRESOLVE 16*4 #define GLINK_ENTRY_SIZE(htab, h) \ - (((!htab->params->speculate_indirect_jumps ? 6*4 : 4*4) \ + ((4*4 \ + (h != NULL \ && h == htab->tls_get_addr \ && !htab->params->no_tls_get_addr_opt ? 8*4 : 0) \ @@ -155,8 +155,6 @@ static const bfd_vma ppc_elf_vxworks_pic_plt0_entry #define BA 0x48000002 #define BCL_20_31 0x429f0005 #define BCTR 0x4e800420 -#define CRSETEQ 0x4c421242 -#define BEQCTRM 0x4dc20420 #define BEQLR 0x4d820020 #define CMPWI_11_0 0x2c0b0000 #define LIS_11 0x3d600000 @@ -2016,7 +2014,7 @@ ppc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for a PowerPC ELF reloc. */ -static void +static bfd_boolean ppc_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) @@ -2031,24 +2029,27 @@ ppc_elf_info_to_howto (bfd *abfd, if (r_type >= R_PPC_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised PPC reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_PPC_NONE; + return FALSE; } + cache_ptr->howto = ppc_elf_howto_table[r_type]; /* Just because the above assert didn't trigger doesn't mean that ELF32_R_TYPE (dst->r_info) is necessarily a valid relocation. */ - if (!cache_ptr->howto) + if (cache_ptr->howto == NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - cache_ptr->howto = ppc_elf_howto_table[R_PPC_NONE]; + return FALSE; } + + return TRUE; } /* Handle the R_PPC_ADDR16_HA and R_PPC_REL16_HA relocs. */ @@ -2736,7 +2737,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info) continue; /* xgettext:c-format */ - error_message = _("corrupt %s section in %B"); + error_message = _("corrupt %s section in %pB"); length = asec->size; if (length < 20) goto fail; @@ -2756,7 +2757,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info) || (bfd_bread (buffer, length, ibfd) != length)) { /* xgettext:c-format */ - error_message = _("unable to read in %s section from %B"); + error_message = _("unable to read in %s section from %pB"); goto fail; } @@ -2798,7 +2799,7 @@ ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info) { ibfd = abfd; /* xgettext:c-format */ - error_message = _("warning: unable to set size of %s section in %B"); + error_message = _("warning: unable to set size of %s section in %pB"); } } @@ -2848,7 +2849,7 @@ ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED) if (buffer == NULL) { _bfd_error_handler - (_("failed to allocate space for new APUinfo section.")); + (_("failed to allocate space for new APUinfo section")); return; } @@ -2867,10 +2868,10 @@ ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED) } if (length != asec->size) - _bfd_error_handler (_("failed to compute new APUinfo section.")); + _bfd_error_handler (_("failed to compute new APUinfo section")); if (! bfd_set_section_contents (abfd, asec, buffer, (file_ptr) 0, length)) - _bfd_error_handler (_("failed to install new APUinfo section.")); + _bfd_error_handler (_("failed to install new APUinfo section")); free (buffer); @@ -2880,14 +2881,15 @@ ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED) static bfd_boolean is_nonpic_glink_stub (bfd *abfd, asection *glink, bfd_vma off) { - bfd_byte buf[3 * 4]; + bfd_byte buf[4 * 4]; if (!bfd_get_section_contents (abfd, glink, buf, off, sizeof buf)) return FALSE; return ((bfd_get_32 (abfd, buf + 0) & 0xffff0000) == LIS_11 && (bfd_get_32 (abfd, buf + 4) & 0xffff0000) == LWZ_11_11 - && bfd_get_32 (abfd, buf + 8) == MTCTR_11); + && bfd_get_32 (abfd, buf + 8) == MTCTR_11 + && bfd_get_32 (abfd, buf + 12) == BCTR); } static bfd_boolean @@ -3366,7 +3368,7 @@ ppc_elf_link_hash_table_create (bfd *abfd) { struct ppc_elf_link_hash_table *ret; static struct ppc_elf_params default_params - = { PLT_OLD, 0, 1, 0, 1, 0, 0, 12, 0, 0, 0 }; + = { PLT_OLD, 0, 0, 1, 0, 0, 12, 0, 0, 0 }; ret = bfd_zmalloc (sizeof (struct ppc_elf_link_hash_table)); if (ret == NULL) @@ -3926,7 +3928,7 @@ bad_shared_reloc (bfd *abfd, enum elf_ppc_reloc_type r_type) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s cannot be used when making a shared object"), + (_("%pB: relocation %s cannot be used when making a shared object"), abfd, ppc_elf_howto_table[r_type]->name); bfd_set_error (bfd_error_bad_value); @@ -3963,7 +3965,7 @@ ppc_elf_check_relocs (bfd *abfd, return TRUE; #ifdef DEBUG - _bfd_error_handler ("ppc_elf_check_relocs called for section %A in %B", + _bfd_error_handler ("ppc_elf_check_relocs called for section %pA in %pB", sec, abfd); #endif @@ -4639,21 +4641,21 @@ _bfd_elf_ppc_merge_fp_attributes (bfd *ibfd, struct bfd_link_info *info) else if (out_fp != 2 && in_fp == 2) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses hard float, %B uses soft float"), obfd, ibfd); + (_("warning: %pB uses hard float, %pB uses soft float"), obfd, ibfd); else if (out_fp == 2 && in_fp != 2) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses hard float, %B uses soft float"), ibfd, obfd); + (_("warning: %pB uses hard float, %pB uses soft float"), ibfd, obfd); else if (out_fp == 1 && in_fp == 3) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses double-precision hard float, " - "%B uses single-precision hard float"), obfd, ibfd); + (_("warning: %pB uses double-precision hard float, " + "%pB uses single-precision hard float"), obfd, ibfd); else if (out_fp == 3 && in_fp == 1) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses double-precision hard float, " - "%B uses single-precision hard float"), ibfd, obfd); + (_("warning: %pB uses double-precision hard float, " + "%pB uses single-precision hard float"), ibfd, obfd); in_fp = in_attr->i & 0xc; out_fp = out_attr->i & 0xc; @@ -4667,23 +4669,23 @@ _bfd_elf_ppc_merge_fp_attributes (bfd *ibfd, struct bfd_link_info *info) else if (out_fp != 2 * 4 && in_fp == 2 * 4) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses 64-bit long double, " - "%B uses 128-bit long double"), ibfd, obfd); + (_("warning: %pB uses 64-bit long double, " + "%pB uses 128-bit long double"), ibfd, obfd); else if (in_fp != 2 * 4 && out_fp == 2 * 4) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses 64-bit long double, " - "%B uses 128-bit long double"), obfd, ibfd); + (_("warning: %pB uses 64-bit long double, " + "%pB uses 128-bit long double"), obfd, ibfd); else if (out_fp == 1 * 4 && in_fp == 3 * 4) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses IBM long double, " - "%B uses IEEE long double"), ibfd, obfd); + (_("warning: %pB uses IBM long double, " + "%pB uses IEEE long double"), ibfd, obfd); else if (out_fp == 3 * 4 && in_fp == 1 * 4) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses IBM long double, " - "%B uses IEEE long double"), obfd, ibfd); + (_("warning: %pB uses IBM long double, " + "%pB uses IEEE long double"), obfd, ibfd); } } @@ -4733,12 +4735,12 @@ ppc_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) else if (out_vec < in_vec) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses AltiVec vector ABI, %B uses SPE vector ABI"), + (_("warning: %pB uses AltiVec vector ABI, %pB uses SPE vector ABI"), obfd, ibfd); else if (out_vec > in_vec) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses AltiVec vector ABI, %B uses SPE vector ABI"), + (_("warning: %pB uses AltiVec vector ABI, %pB uses SPE vector ABI"), ibfd, obfd); } @@ -4761,13 +4763,13 @@ ppc_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) else if (out_struct < in_struct) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses r3/r4 for small structure returns, " - "%B uses memory"), obfd, ibfd); + (_("warning: %pB uses r3/r4 for small structure returns, " + "%pB uses memory"), obfd, ibfd); else if (out_struct > in_struct) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses r3/r4 for small structure returns, " - "%B uses memory"), ibfd, obfd); + (_("warning: %pB uses r3/r4 for small structure returns, " + "%pB uses memory"), ibfd, obfd); } /* Merge Tag_compatibility attributes and any common GNU ones. */ @@ -4821,7 +4823,7 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { error = TRUE; _bfd_error_handler - (_("%B: compiled with -mrelocatable and linked with " + (_("%pB: compiled with -mrelocatable and linked with " "modules compiled normally"), ibfd); } else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0 @@ -4829,7 +4831,7 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { error = TRUE; _bfd_error_handler - (_("%B: compiled normally and linked with " + (_("%pB: compiled normally and linked with " "modules compiled with -mrelocatable"), ibfd); } @@ -4857,7 +4859,7 @@ ppc_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses different e_flags (%#x) fields " + (_("%pB: uses different e_flags (%#x) fields " "than previous modules (%#x)"), ibfd, new_flags, old_flags); } @@ -4898,7 +4900,7 @@ ppc_elf_vle_split16 (bfd *input_bfd, else _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+0x%lx): expected 16A style relocation on 0x%08x insn"), + (_("%pB(%pA+0x%lx): expected 16A style relocation on 0x%08x insn"), input_bfd, input_section, offset, opcode); } } @@ -4917,7 +4919,7 @@ ppc_elf_vle_split16 (bfd *input_bfd, else _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+0x%lx): expected 16D style relocation on 0x%08x insn"), + (_("%pB(%pA+0x%lx): expected 16D style relocation on 0x%08x insn"), input_bfd, input_section, offset, opcode); } } @@ -5008,10 +5010,9 @@ ppc_elf_select_plt_layout (bfd *output_bfd ATTRIBUTE_UNUSED, if (htab->plt_type == PLT_OLD && htab->params->plt_style == PLT_NEW) { if (htab->old_bfd != NULL) - info->callbacks->einfo (_("%P: bss-plt forced due to %B\n"), - htab->old_bfd); + _bfd_error_handler (_("bss-plt forced due to %pB"), htab->old_bfd); else - info->callbacks->einfo (_("%P: bss-plt forced by profiling\n")); + _bfd_error_handler (_("bss-plt forced by profiling")); } BFD_ASSERT (htab->plt_type != PLT_VXWORKS); @@ -6164,7 +6165,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -6272,7 +6273,7 @@ ppc_elf_size_dynamic_sections (bfd *output_bfd, == (SEC_READONLY | SEC_ALLOC)) { info->flags |= DF_TEXTREL; - info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"), + info->callbacks->minfo (_("%pB: dynamic relocation in read-only section `%pA'\n"), p->sec->owner, p->sec); } } @@ -7171,8 +7172,6 @@ ppc_elf_relax_section (bfd *abfd, size = 4 * ARRAY_SIZE (stub_entry); insn_offset = 0; } - if (!htab->params->speculate_indirect_jumps) - size += 8; stub_rtype = R_PPC_RELAX; if (tsec == htab->elf.splt || tsec == htab->glink) @@ -7454,26 +7453,6 @@ elf_finish_pointer_linker_section (bfd *input_bfd, #define PPC_HI(v) (((v) >> 16) & 0xffff) #define PPC_HA(v) PPC_HI ((v) + 0x8000) -static inline bfd_byte * -output_bctr (struct ppc_elf_link_hash_table *htab, bfd *obfd, bfd_byte *p) -{ - if (!htab->params->speculate_indirect_jumps) - { - bfd_put_32 (obfd, CRSETEQ, p); - p += 4; - bfd_put_32 (obfd, BEQCTRM, p); - p += 4; - bfd_put_32 (obfd, B, p); - p += 4; - } - else - { - bfd_put_32 (obfd, BCTR, p); - p += 4; - } - return p; -} - static void write_glink_stub (struct elf_link_hash_entry *h, struct plt_entry *ent, asection *plt_sec, unsigned char *p, @@ -7541,7 +7520,8 @@ write_glink_stub (struct elf_link_hash_entry *h, struct plt_entry *ent, p += 4; bfd_put_32 (output_bfd, MTCTR_11, p); p += 4; - p = output_bctr (htab, output_bfd, p); + bfd_put_32 (output_bfd, BCTR, p); + p += 4; while (p < end) { bfd_put_32 (output_bfd, htab->params->ppc476_workaround ? BA : NOP, p); @@ -7717,7 +7697,7 @@ ppc_elf_relocate_section (bfd *output_bfd, struct ppc_elf_relax_info *relax_info = NULL; #ifdef DEBUG - _bfd_error_handler ("ppc_elf_relocate_section called for %B section %A, " + _bfd_error_handler ("ppc_elf_relocate_section called for %pB section %pA, " "%ld relocations%s", input_bfd, input_section, (long) input_section->reloc_count, @@ -8183,8 +8163,9 @@ ppc_elf_relocate_section (bfd *output_bfd, else _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): error: %s with unexpected instruction %#x"), - input_bfd, input_section, rel->r_offset, + (_("%pB(%pA+%#" PRIx64 "): error: " + "%s with unexpected instruction %#x"), + input_bfd, input_section, (uint64_t) rel->r_offset, "R_PPC_ADDR16_HA", insn); } else if (r_type == R_PPC_ADDR16_LO) @@ -8218,8 +8199,9 @@ ppc_elf_relocate_section (bfd *output_bfd, else _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): error: %s with unexpected instruction %#x"), - input_bfd, input_section, rel->r_offset, + (_("%pB(%pA+%#" PRIx64 "): error: " + "%s with unexpected instruction %#x"), + input_bfd, input_section, (uint64_t) rel->r_offset, "R_PPC_ADDR16_LO", insn); } } @@ -8361,10 +8343,9 @@ ppc_elf_relocate_section (bfd *output_bfd, switch (r_type) { default: - info->callbacks->einfo - /* xgettext:c-format */ - (_("%P: %B: unknown relocation type %d for symbol %s\n"), - input_bfd, (int) r_type, sym_name); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: %s unsupported"), + input_bfd, howto->name); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -8979,7 +8960,6 @@ ppc_elf_relocate_section (bfd *output_bfd, stub = stub_entry; size = ARRAY_SIZE (stub_entry); } - --size; relocation += addend; if (bfd_link_relocatable (info)) @@ -9004,7 +8984,6 @@ ppc_elf_relocate_section (bfd *output_bfd, bfd_put_32 (input_bfd, insn, contents + insn_offset); insn_offset += 4; } - output_bctr (htab, input_bfd, contents + insn_offset); /* Rewrite the reloc and convert one of the trailing nop relocs to describe this relocation. */ @@ -9121,10 +9100,10 @@ ppc_elf_relocate_section (bfd *output_bfd, if (!(strcmp (name, ".sdata") == 0 || strcmp (name, ".sbss") == 0)) { - info->callbacks->einfo + _bfd_error_handler /* xgettext:c-format */ - (_("%P: %B: the target (%s) of a %s relocation is " - "in the wrong output section (%s)\n"), + (_("%pB: the target (%s) of a %s relocation is " + "in the wrong output section (%s)"), input_bfd, sym_name, howto->name, @@ -9152,10 +9131,10 @@ ppc_elf_relocate_section (bfd *output_bfd, if (!(strcmp (name, ".sdata2") == 0 || strcmp (name, ".sbss2") == 0)) { - info->callbacks->einfo + _bfd_error_handler /* xgettext:c-format */ - (_("%P: %B: the target (%s) of a %s relocation is " - "in the wrong output section (%s)\n"), + (_("%pB: the target (%s) of a %s relocation is " + "in the wrong output section (%s)"), input_bfd, sym_name, howto->name, @@ -9243,10 +9222,10 @@ ppc_elf_relocate_section (bfd *output_bfd, } else { - info->callbacks->einfo + _bfd_error_handler /* xgettext:c-format */ - (_("%P: %B: the target (%s) of a %s relocation is " - "in the wrong output section (%s)\n"), + (_("%pB: the target (%s) of a %s relocation is " + "in the wrong output section (%s)"), input_bfd, sym_name, howto->name, @@ -9333,7 +9312,7 @@ ppc_elf_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: the target (%s) of a %s relocation is " + (_("%pB: the target (%s) of a %s relocation is " "in the wrong output section (%s)"), input_bfd, sym_name, @@ -9439,12 +9418,9 @@ ppc_elf_relocate_section (bfd *output_bfd, case R_PPC_EMB_RELST_HI: case R_PPC_EMB_RELST_HA: case R_PPC_EMB_BIT_FLD: - info->callbacks->einfo - /* xgettext:c-format */ - (_("%P: %B: relocation %s is not yet supported for symbol %s\n"), - input_bfd, - howto->name, - sym_name); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: %s unsupported"), + input_bfd, howto->name); bfd_set_error (bfd_error_invalid_operation); ret = FALSE; @@ -10429,11 +10405,10 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, else { /* xgettext:c-format */ - info->callbacks->einfo (_("%P: %s not defined in linker created %s\n"), - htab->elf.hgot->root.root.string, - (htab->elf.sgotplt != NULL - ? htab->elf.sgotplt->name - : htab->elf.sgot->name)); + _bfd_error_handler (_("%s not defined in linker created %pA"), + htab->elf.hgot->root.root.string, + (htab->elf.sgotplt != NULL + ? htab->elf.sgotplt : htab->elf.sgot)); bfd_set_error (bfd_error_bad_value); ret = FALSE; } @@ -10713,7 +10688,8 @@ ppc_elf_finish_dynamic_sections (bfd *output_bfd, p += 4; bfd_put_32 (output_bfd, ADD_11_0_11, p); p += 4; - p = output_bctr (htab, output_bfd, p); + bfd_put_32 (output_bfd, BCTR, p); + p += 4; while (p < endp) { bfd_put_32 (output_bfd, diff --git a/bfd/elf32-ppc.h b/bfd/elf32-ppc.h index 8977efa..f56d027 100644 --- a/bfd/elf32-ppc.h +++ b/bfd/elf32-ppc.h @@ -35,9 +35,6 @@ struct ppc_elf_params /* Set if individual PLT call stubs should be aligned. */ int plt_stub_align; - /* Clear if PLT call stubs should use a speculative execution barrier. */ - int speculate_indirect_jumps; - /* Whether to emit symbols for stubs. */ int emit_stub_syms; diff --git a/bfd/elf32-pru.c b/bfd/elf32-pru.c index 71bb0a0..a3c431b 100644 --- a/bfd/elf32-pru.c +++ b/bfd/elf32-pru.c @@ -30,6 +30,7 @@ #include "elf-bfd.h" #include "elf/pru.h" #include "opcode/pru.h" +#include "libiberty.h" #define SWAP_VALS(A,B) \ do { \ @@ -291,38 +292,42 @@ static reloc_howto_type elf_pru_howto_table_rel[] = { static unsigned char elf_code_to_howto_index[R_PRU_ILLEGAL + 1]; /* Return the howto for relocation RTYPE. */ + static reloc_howto_type * lookup_howto (unsigned int rtype) { - static int initialized = 0; + static bfd_boolean initialized = FALSE; int i; int howto_tbl_size = (int) (sizeof (elf_pru_howto_table_rel) / sizeof (elf_pru_howto_table_rel[0])); - if (!initialized) + if (! initialized) { - initialized = 1; + initialized = TRUE; memset (elf_code_to_howto_index, 0xff, sizeof (elf_code_to_howto_index)); for (i = 0; i < howto_tbl_size; i++) elf_code_to_howto_index[elf_pru_howto_table_rel[i].type] = i; } - BFD_ASSERT (rtype <= R_PRU_ILLEGAL); + if (rtype > R_PRU_ILLEGAL) + return NULL; i = elf_code_to_howto_index[rtype]; if (i >= howto_tbl_size) - return 0; + return NULL; return elf_pru_howto_table_rel + i; } /* Map for converting BFD reloc types to PRU reloc types. */ + struct elf_reloc_map { bfd_reloc_code_real_type bfd_val; enum elf_pru_reloc_type elf_val; }; -static const struct elf_reloc_map pru_reloc_map[] = { +static const struct elf_reloc_map pru_reloc_map[] = +{ {BFD_RELOC_NONE, R_PRU_NONE}, {BFD_RELOC_PRU_16_PMEM, R_PRU_16_PMEM}, {BFD_RELOC_PRU_U16_PMEMIMM, R_PRU_U16_PMEMIMM}, @@ -346,6 +351,7 @@ static const struct elf_reloc_map pru_reloc_map[] = { /* Assorted hash table functions. */ /* Create an entry in a PRU ELF linker hash table. */ + static struct bfd_hash_entry * link_hash_newfunc (struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string) @@ -368,14 +374,14 @@ link_hash_newfunc (struct bfd_hash_entry *entry, /* Implement bfd_elf32_bfd_reloc_type_lookup: Given a BFD reloc type, return a howto structure. */ + static reloc_howto_type * pru_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, bfd_reloc_code_real_type code) { - int i; - for (i = 0; - i < (int) (sizeof (pru_reloc_map) / sizeof (struct elf_reloc_map)); - ++i) + unsigned int i; + + for (i = 0; i < ARRAY_SIZE (pru_reloc_map); ++i) if (pru_reloc_map[i].bfd_val == code) return lookup_howto ((unsigned int) pru_reloc_map[i].elf_val); return NULL; @@ -383,15 +389,14 @@ pru_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Implement bfd_elf32_bfd_reloc_name_lookup: Given a reloc name, return a howto structure. */ + static reloc_howto_type * pru_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) { unsigned int i; - for (i = 0; - i < (sizeof (elf_pru_howto_table_rel) - / sizeof (elf_pru_howto_table_rel[0])); - i++) + + for (i = 0; i < ARRAY_SIZE (elf_pru_howto_table_rel); i++) if (elf_pru_howto_table_rel[i].name && strcasecmp (elf_pru_howto_table_rel[i].name, r_name) == 0) return &elf_pru_howto_table_rel[i]; @@ -401,15 +406,24 @@ pru_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Implement elf_info_to_howto: Given a ELF32 relocation, fill in a arelent structure. */ -static void -pru_elf32_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + +static bfd_boolean +pru_elf32_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (r_type < R_PRU_ILLEGAL); + if (r_type >= R_PRU_ILLEGAL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + cache_ptr->howto = lookup_howto (r_type); + return cache_ptr->howto != NULL; } /* Do the relocations that require special handling. */ diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c index 48714c2..e072b1a 100644 --- a/bfd/elf32-rl78.c +++ b/bfd/elf32-rl78.c @@ -278,8 +278,8 @@ rl78_reloc_name_lookup (bfd * abfd ATTRIBUTE_UNUSED, const char * r_name) /* Set the howto pointer for an RL78 ELF reloc. */ -static void -rl78_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +rl78_info_to_howto_rela (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -289,10 +289,13 @@ rl78_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_RL78_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid RL78 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = rl78_elf_howto_table + r_type; + return TRUE; } static bfd_vma @@ -367,7 +370,7 @@ static unsigned int rl78_stack_top; if (rl78_stack_top < NUM_STACK_ENTRIES) \ rl78_stack [rl78_stack_top ++] = (val); \ else \ - _bfd_error_handler (_("Internal Error: RL78 reloc stack overflow")); \ + _bfd_error_handler (_("internal error: RL78 reloc stack overflow")); \ } \ while (0) @@ -378,7 +381,7 @@ static unsigned int rl78_stack_top; (dest) = rl78_stack [-- rl78_stack_top];\ else \ { \ - _bfd_error_handler (_("Internal Error: RL78 reloc stack underflow")); \ + _bfd_error_handler (_("internal error: RL78 reloc stack underflow")); \ (dest) = 0; \ } \ } \ @@ -1047,7 +1050,8 @@ rl78_elf_relocate_section { relocation = 0; if (h->root.type != bfd_link_hash_undefweak) - _bfd_error_handler (_("Warning: RL78_SYM reloc with an unknown symbol")); + _bfd_error_handler + (_("warning: RL78_SYM reloc with an unknown symbol")); } (void) rl78_compute_complex_reloc (r_type, relocation, input_section); break; @@ -1078,7 +1082,7 @@ rl78_elf_relocate_section and emit a more helpful error message. */ if (r_type == R_RL78_DIR24S_PCREL) /* xgettext:c-format */ - msg = _("%B(%A): error: call to undefined function '%s'"); + msg = _("%pB(%pA): error: call to undefined function '%s'"); else (*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, @@ -1092,27 +1096,27 @@ rl78_elf_relocate_section case bfd_reloc_other: /* xgettext:c-format */ - msg = _("%B(%A): warning: unaligned access to symbol '%s' in the small data area"); + msg = _("%pB(%pA): warning: unaligned access to symbol '%s' in the small data area"); break; case bfd_reloc_outofrange: /* xgettext:c-format */ - msg = _("%B(%A): internal error: out of range error"); + msg = _("%pB(%pA): internal error: out of range error"); break; case bfd_reloc_notsupported: /* xgettext:c-format */ - msg = _("%B(%A): internal error: unsupported relocation error"); + msg = _("%pB(%pA): internal error: unsupported relocation error"); break; case bfd_reloc_dangerous: /* xgettext:c-format */ - msg = _("%B(%A): internal error: dangerous relocation"); + msg = _("%pB(%pA): internal error: dangerous relocation"); break; default: /* xgettext:c-format */ - msg = _("%B(%A): internal error: unknown error"); + msg = _("%pB(%pA): internal error: unknown error"); break; } @@ -1199,8 +1203,8 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) _bfd_error_handler /* xgettext:c-format */ - (_("RL78 ABI conflict: G10 file %B cannot be linked" - " with %s file %B"), + (_("RL78 ABI conflict: G10 file %pB cannot be linked" + " with %s file %pB"), ibfd, rl78_cpu_name (out_cpu), obfd); } else @@ -1216,7 +1220,7 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) _bfd_error_handler /* xgettext:c-format */ - (_("RL78 ABI conflict: cannot link %s file %B with %s file %B"), + (_("RL78 ABI conflict: cannot link %s file %pB with %s file %pB"), rl78_cpu_name (in_cpu), ibfd, rl78_cpu_name (out_cpu), obfd); } @@ -1229,11 +1233,11 @@ rl78_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (old_flags & E_FLAG_RL78_64BIT_DOUBLES) /* xgettext:c-format */ - _bfd_error_handler (_("- %B is 64-bit, %B is not"), + _bfd_error_handler (_("- %pB is 64-bit, %pB is not"), obfd, ibfd); else /* xgettext:c-format */ - _bfd_error_handler (_("- %B is 64-bit, %B is not"), + _bfd_error_handler (_("- %pB is 64-bit, %pB is not"), ibfd, obfd); error = TRUE; } diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c index a0e1f78..1f70b97 100644 --- a/bfd/elf32-rx.c +++ b/bfd/elf32-rx.c @@ -300,8 +300,8 @@ rx_reloc_name_lookup (bfd * abfd ATTRIBUTE_UNUSED, const char * r_name) /* Set the howto pointer for an RX ELF reloc. */ -static void -rx_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +rx_info_to_howto_rela (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -311,10 +311,21 @@ rx_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_RX_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid RX reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = rx_elf_howto_table + r_type; + if (cache_ptr->howto->name == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } static bfd_vma @@ -592,14 +603,14 @@ rx_elf_relocate_section if (table_end_cache <= entry_vma || entry_vma < table_start_cache) { /* xgettext:c-format */ - _bfd_error_handler (_("%B:%A: table entry %s outside table"), + _bfd_error_handler (_("%pB:%pA: table entry %s outside table"), input_bfd, input_section, name); } else if ((int) (entry_vma - table_start_cache) % 4) { /* xgettext:c-format */ - _bfd_error_handler (_("%B:%A: table entry %s not word-aligned within table"), + _bfd_error_handler (_("%pB:%pA: table entry %s not word-aligned within table"), input_bfd, input_section, name); } @@ -660,13 +671,20 @@ rx_elf_relocate_section r = bfd_reloc_ok; -#define RANGE(a,b) if (a > (long) relocation || (long) relocation > b) r = bfd_reloc_overflow -#define ALIGN(m) if (relocation & m) r = bfd_reloc_other; -#define OP(i) (contents[rel->r_offset + (i)]) +#define RANGE(a,b) \ + if (a > (long) relocation || (long) relocation > b) \ + r = bfd_reloc_overflow +#define ALIGN(m) \ + if (relocation & m) \ + r = bfd_reloc_other +#define OP(i) \ + (contents[rel->r_offset + (i)]) #define WARN_REDHAT(type) \ - /* xgettext:c-format */ \ - _bfd_error_handler (_("%B:%A: Warning: deprecated Red Hat reloc " type " detected against: %s."), \ - input_bfd, input_section, name) + /* xgettext:c-format */ \ + _bfd_error_handler \ + (_("%pB:%pA: warning: deprecated Red Hat reloc " \ + "%s detected against: %s"), \ + input_bfd, input_section, #type, name) /* Check for unsafe relocs in PID mode. These are any relocs where an absolute address is being computed. There are special cases @@ -684,9 +702,12 @@ rx_elf_relocate_section && strcmp (name, "__romdatastart") != 0 \ && !saw_subtract) \ /* xgettext:c-format */ \ - _bfd_error_handler (_("%B(%A): unsafe PID relocation %s at %#Lx (against %s in %s)"), \ + _bfd_error_handler (_("%pB(%pA): unsafe PID relocation %s " \ + "at %#" PRIx64 " (against %s in %s)"), \ input_bfd, input_section, howto->name, \ - input_section->output_section->vma + input_section->output_offset + rel->r_offset, \ + (uint64_t) (input_section->output_section->vma \ + + input_section->output_offset \ + + rel->r_offset), \ name, sec->name); \ } \ while (0) @@ -1264,7 +1285,8 @@ rx_elf_relocate_section + sec->output_offset + rel->r_addend); else - _bfd_error_handler (_("Warning: RX_SYM reloc with an unknown symbol")); + _bfd_error_handler + (_("warning: RX_SYM reloc with an unknown symbol")); } break; @@ -1432,7 +1454,7 @@ rx_elf_relocate_section and emit a more helpful error message. */ if (r_type == R_RX_DIR24S_PCREL) /* xgettext:c-format */ - msg = _("%B(%A): error: call to undefined function '%s'"); + msg = _("%pB(%pA): error: call to undefined function '%s'"); else (*info->callbacks->reloc_overflow) (info, (h ? &h->root : NULL), name, howto->name, (bfd_vma) 0, @@ -1446,27 +1468,27 @@ rx_elf_relocate_section case bfd_reloc_other: /* xgettext:c-format */ - msg = _("%B(%A): warning: unaligned access to symbol '%s' in the small data area"); + msg = _("%pB(%pA): warning: unaligned access to symbol '%s' in the small data area"); break; case bfd_reloc_outofrange: /* xgettext:c-format */ - msg = _("%B(%A): internal error: out of range error"); + msg = _("%pB(%pA): internal error: out of range error"); break; case bfd_reloc_notsupported: /* xgettext:c-format */ - msg = _("%B(%A): internal error: unsupported relocation error"); + msg = _("%pB(%pA): internal error: unsupported relocation error"); break; case bfd_reloc_dangerous: /* xgettext:c-format */ - msg = _("%B(%A): internal error: dangerous relocation"); + msg = _("%pB(%pA): internal error: dangerous relocation"); break; default: /* xgettext:c-format */ - msg = _("%B(%A): internal error: unknown error"); + msg = _("%pB(%pA): internal error: unknown error"); break; } @@ -3143,8 +3165,8 @@ rx_elf_merge_private_bfd_data (bfd * ibfd, struct bfd_link_info *info) } else { - _bfd_error_handler (_("There is a conflict merging the" - " ELF header flags from %B"), + _bfd_error_handler (_("there is a conflict merging the" + " ELF header flags from %pB"), ibfd); _bfd_error_handler (_(" the input file's flags: %s"), describe_flags (new_flags)); @@ -3755,7 +3777,7 @@ rx_table_find (struct bfd_hash_entry *vent, void *vinfo) && h->type != bfd_link_hash_defweak)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B:%A: table %s missing corresponding %s"), + _bfd_error_handler (_("%pB:%pA: table %s missing corresponding %s"), abfd, sec, name, buf); return TRUE; } @@ -3763,7 +3785,7 @@ rx_table_find (struct bfd_hash_entry *vent, void *vinfo) if (h->u.def.section != ent->u.def.section) { /* xgettext:c-format */ - _bfd_error_handler (_("%B:%A: %s and %s must be in the same input section"), + _bfd_error_handler (_("%pB:%pA: %s and %s must be in the same input section"), h->u.def.section->owner, h->u.def.section, name, buf); return TRUE; diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index c5e7581..d077104 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -323,12 +323,13 @@ elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* We need to use ELF32_R_TYPE so we have our own copy of this function, and elf32-s390.c has its own copy. */ -static void -elf_s390_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +elf_s390_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE(dst->r_info); + switch (r_type) { case R_390_GNU_VTINHERIT: @@ -343,12 +344,15 @@ elf_s390_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= sizeof (elf_howto_table) / sizeof (elf_howto_table[0])) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), - abfd, (int) r_type); - r_type = R_390_NONE; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_howto_table[r_type]; } + + return TRUE; } /* A relocation function which doesn't do anything. */ @@ -953,7 +957,7 @@ elf_s390_check_relocs (bfd *abfd, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -1181,7 +1185,7 @@ elf_s390_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h->root.root.string); return FALSE; } @@ -1848,7 +1852,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2134,10 +2138,10 @@ invalid_tls_insn (bfd *input_bfd, howto = elf_howto_table + ELF32_R_TYPE (rel->r_info); _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): invalid instruction for TLS relocation %s"), + (_("%pB(%pA+%#" PRIx64 "): invalid instruction for TLS relocation %s"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name); bfd_set_error (bfd_error_bad_value); } @@ -3201,10 +3205,11 @@ elf_s390_relocate_section (bfd *output_bfd, rel->r_offset) != (bfd_vma) -1) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); @@ -3258,9 +3263,9 @@ elf_s390_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): reloc against `%s': error %d"), + (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"), input_bfd, input_section, - rel->r_offset, name, (int) r); + (uint64_t) rel->r_offset, name, (int) r); return FALSE; } } diff --git a/bfd/elf32-score.c b/bfd/elf32-score.c index 897ab8a..42ef221 100644 --- a/bfd/elf32-score.c +++ b/bfd/elf32-score.c @@ -2375,7 +2375,7 @@ score_elf_final_link_relocate (reloc_howto_type *howto, } /* Score backend functions. */ -static void +static bfd_boolean s3_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) @@ -2384,9 +2384,10 @@ s3_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, r_type = ELF32_R_TYPE (elf_reloc->r_info); if (r_type >= ARRAY_SIZE (elf32_score_howto_table)) - bfd_reloc->howto = NULL; - else - bfd_reloc->howto = &elf32_score_howto_table[r_type]; + return FALSE; + + bfd_reloc->howto = &elf32_score_howto_table[r_type]; + return TRUE; } /* Relocate an score ELF section. */ @@ -2448,7 +2449,8 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd, r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); - s3_bfd_score_info_to_howto (input_bfd, &bfd_reloc, (Elf_Internal_Rela *) rel); + if (! s3_bfd_score_info_to_howto (input_bfd, &bfd_reloc, (Elf_Internal_Rela *) rel)) + continue; howto = bfd_reloc.howto; h = NULL; @@ -2741,7 +2743,7 @@ s3_bfd_score_elf_relocate_section (bfd *output_bfd, /* Use bfd_reloc_other to check lw48, sw48 word align. */ case bfd_reloc_other: - msg = _("address not word align"); + msg = _("address not word aligned"); goto common_error; default: @@ -2822,7 +2824,7 @@ s3_bfd_score_elf_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Malformed reloc detected for section %A"), abfd, sec); + (_("%pB: malformed reloc detected for section %pA"), abfd, sec); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2876,8 +2878,8 @@ s3_bfd_score_elf_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: CALL15 reloc at %#Lx not against global symbol"), - abfd, rel->r_offset); + (_("%pB: CALL15 reloc at %#" PRIx64 " not against global symbol"), + abfd, (uint64_t) rel->r_offset); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -4045,7 +4047,7 @@ s3_elf32_score_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (((in_flags & EF_SCORE_PIC) != 0) != ((out_flags & EF_SCORE_PIC) != 0)) _bfd_error_handler - (_("%B: warning: linking PIC files with non-PIC files"), ibfd); + (_("%pB: warning: linking PIC files with non-PIC files"), ibfd); /* FIXME: Maybe dependency fix compatibility should be checked here. */ @@ -4069,7 +4071,7 @@ s3_elf32_score_new_section_hook (bfd *abfd, asection *sec) /*****************************************************************************/ /* s3_s7: backend hooks. */ -static void +static bfd_boolean _bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) @@ -4450,7 +4452,7 @@ _bfd_score_elf_common_definition (Elf_Internal_Sym *sym) #define ELF_MACHINE_ALT1 EM_SCORE_OLD #define ELF_MAXPAGESIZE 0x8000 -#define elf_info_to_howto 0 +#define elf_info_to_howto NULL #define elf_info_to_howto_rel _bfd_score_info_to_howto #define elf_backend_relocate_section _bfd_score_elf_relocate_section #define elf_backend_check_relocs _bfd_score_elf_check_relocs @@ -4466,8 +4468,7 @@ _bfd_score_elf_common_definition (Elf_Internal_Sym *sym) _bfd_score_elf_always_size_sections #define elf_backend_size_dynamic_sections \ _bfd_score_elf_size_dynamic_sections -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all #define elf_backend_create_dynamic_sections \ _bfd_score_elf_create_dynamic_sections #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf32-score.h b/bfd/elf32-score.h index dc9fd1e..ed5c9fc 100644 --- a/bfd/elf32-score.h +++ b/bfd/elf32-score.h @@ -30,7 +30,7 @@ s7_bfd_score_elf_hide_symbol (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); -extern void +extern bfd_boolean s7_bfd_score_info_to_howto (bfd *, arelent *, Elf_Internal_Rela *); extern bfd_boolean diff --git a/bfd/elf32-score7.c b/bfd/elf32-score7.c index 2b803e6..3c022e6 100644 --- a/bfd/elf32-score7.c +++ b/bfd/elf32-score7.c @@ -2214,7 +2214,7 @@ score_elf_final_link_relocate (reloc_howto_type *howto, /* Score backend functions. */ -void +bfd_boolean s7_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) @@ -2223,9 +2223,10 @@ s7_bfd_score_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, r_type = ELF32_R_TYPE (elf_reloc->r_info); if (r_type >= ARRAY_SIZE (elf32_score_howto_table)) - bfd_reloc->howto = NULL; - else - bfd_reloc->howto = &elf32_score_howto_table[r_type]; + return FALSE; + + bfd_reloc->howto = &elf32_score_howto_table[r_type]; + return TRUE; } /* Relocate an score ELF section. */ @@ -2288,7 +2289,8 @@ s7_bfd_score_elf_relocate_section (bfd *output_bfd, r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); - s7_bfd_score_info_to_howto (input_bfd, &bfd_reloc, (Elf_Internal_Rela *) rel); + if (! s7_bfd_score_info_to_howto (input_bfd, &bfd_reloc, (Elf_Internal_Rela *) rel)) + continue; howto = bfd_reloc.howto; h = NULL; @@ -2627,7 +2629,7 @@ s7_bfd_score_elf_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Malformed reloc detected for section %A"), abfd, sec); + (_("%pB: malformed reloc detected for section %pA"), abfd, sec); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2681,8 +2683,8 @@ s7_bfd_score_elf_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: CALL15 reloc at %#Lx not against global symbol"), - abfd, rel->r_offset); + (_("%pB: CALL15 reloc at %#" PRIx64 " not against global symbol"), + abfd, (uint64_t) rel->r_offset); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3850,7 +3852,7 @@ s7_elf32_score_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (((in_flags & EF_SCORE_PIC) != 0) != ((out_flags & EF_SCORE_PIC) != 0)) { - _bfd_error_handler (_("%B: warning: linking PIC files with non-PIC files"), ibfd); + _bfd_error_handler (_("%pB: warning: linking PIC files with non-PIC files"), ibfd); } /* Maybe dependency fix compatibility should be checked here. */ @@ -3871,5 +3873,4 @@ s7_elf32_score_new_section_hook (bfd *abfd, asection *sec) return _bfd_elf_new_section_hook (abfd, sec); } -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all diff --git a/bfd/elf32-sh-symbian.c b/bfd/elf32-sh-symbian.c index 9abfd73..b0f519b 100644 --- a/bfd/elf32-sh-symbian.c +++ b/bfd/elf32-sh-symbian.c @@ -127,7 +127,7 @@ sh_symbian_import_as (struct bfd_link_info *info, bfd * abfd, bfd_set_error (bfd_error_invalid_operation); /* xgettext:c-format */ - _bfd_error_handler (_("%B: IMPORT AS directive for %s conceals previous IMPORT AS"), + _bfd_error_handler (_("%pB: IMPORT AS directive for %s conceals previous IMPORT AS"), abfd, current_name); return FALSE; } @@ -381,7 +381,7 @@ sh_symbian_process_embedded_commands (struct bfd_link_info *info, bfd * abfd, bfd_set_error (bfd_error_invalid_operation); /* xgettext:c-format */ - _bfd_error_handler (_("%B: Unrecognised .directive command: %s"), + _bfd_error_handler (_("%pB: unrecognized .directive command: %s"), abfd, directive); break; } @@ -499,7 +499,7 @@ sh_symbian_relocate_section (bfd * output_bfd, if (new_hash == NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: Failed to add renamed symbol %s"), + _bfd_error_handler (_("%pB: failed to add renamed symbol %s"), input_bfd, ptr->new_name); continue; } diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index b4854a2..d0f5ac8 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -472,7 +472,7 @@ sh_elf_reloc_name_lookup (bfd *abfd, const char *r_name) /* Given an ELF reloc, fill in the howto field of a relent. */ -static void +static bfd_boolean sh_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r; @@ -488,13 +488,14 @@ sh_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) || (r >= R_SH_FIRST_INVALID_RELOC_6 && r <= R_SH_LAST_INVALID_RELOC_6)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised SH reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r); bfd_set_error (bfd_error_bad_value); - r = R_SH_NONE; + return FALSE; } cache_ptr->howto = get_howto_table (abfd) + r; + return TRUE; } /* This function handles relaxing for SH ELF. See the corresponding @@ -577,8 +578,9 @@ sh_elf_relax_section (bfd *abfd, asection *sec, if (laddr >= sec->size) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: %#Lx: warning: bad R_SH_USES offset"), - abfd, irel->r_offset); + _bfd_error_handler + (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES offset"), + abfd, (uint64_t) irel->r_offset); continue; } insn = bfd_get_16 (abfd, contents + laddr); @@ -589,8 +591,9 @@ sh_elf_relax_section (bfd *abfd, asection *sec, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: R_SH_USES points to unrecognized insn 0x%x"), - abfd, irel->r_offset, insn); + (_("%pB: %#" PRIx64 ": warning: " + "R_SH_USES points to unrecognized insn 0x%x"), + abfd, (uint64_t) irel->r_offset, insn); continue; } @@ -607,8 +610,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: bad R_SH_USES load offset"), - abfd, irel->r_offset); + (_("%pB: %#" PRIx64 ": warning: bad R_SH_USES load offset"), + abfd, (uint64_t) irel->r_offset); continue; } @@ -623,8 +626,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: could not find expected reloc"), - abfd, paddr); + (_("%pB: %#" PRIx64 ": warning: could not find expected reloc"), + abfd, (uint64_t) paddr); continue; } @@ -652,8 +655,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: symbol in unexpected section"), - abfd, paddr); + (_("%pB: %#" PRIx64 ": warning: symbol in unexpected section"), + abfd, (uint64_t) paddr); continue; } @@ -782,8 +785,9 @@ sh_elf_relax_section (bfd *abfd, asection *sec, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: could not find expected COUNT reloc"), - abfd, paddr); + (_("%pB: %#" PRIx64 ": warning: " + "could not find expected COUNT reloc"), + abfd, (uint64_t) paddr); continue; } @@ -792,8 +796,8 @@ sh_elf_relax_section (bfd *abfd, asection *sec, if (irelcount->r_addend == 0) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: %#Lx: warning: bad count"), - abfd, paddr); + _bfd_error_handler (_("%pB: %#" PRIx64 ": warning: bad count"), + abfd, (uint64_t) paddr); continue; } @@ -1196,8 +1200,8 @@ sh_elf_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: fatal: reloc overflow while relaxing"), - abfd, irel->r_offset); + (_("%pB: %#" PRIx64 ": fatal: reloc overflow while relaxing"), + abfd, (uint64_t) irel->r_offset); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1567,8 +1571,8 @@ sh_elf_swap_insns (bfd *abfd, asection *sec, void *relocs, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: fatal: reloc overflow while relaxing"), - abfd, irel->r_offset); + (_("%pB: %#" PRIx64 ": fatal: reloc overflow while relaxing"), + abfd, (uint64_t) irel->r_offset); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3286,7 +3290,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -3389,7 +3393,7 @@ sh_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, if ((p->sec->output_section->flags & SEC_READONLY) != 0) { info->flags |= DF_TEXTREL; - info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"), + info->callbacks->minfo (_("%pB: dynamic relocation in read-only section `%pA'\n"), p->sec->owner, p->sec); } @@ -3944,7 +3948,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, if ((sym->st_other & STO_SH5_ISA32) != 0) (*info->callbacks->reloc_dangerous) (info, - _("Unexpected STO_SH5_ISA32 on local symbol is not handled"), + _("unexpected STO_SH5_ISA32 on local symbol is not handled"), input_bfd, input_section, rel->r_offset); if (sec != NULL && discarded_section (sec)) @@ -4000,9 +4004,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s relocation against SEC_MERGE section"), + (_("%pB(%pA+%#" PRIx64 "): " + "%s relocation against SEC_MERGE section"), input_bfd, input_section, - rel->r_offset, howto->name); + (uint64_t) rel->r_offset, howto->name); return FALSE; } @@ -4118,10 +4123,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); return FALSE; @@ -4197,9 +4203,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: fatal: unaligned branch target for relax-support relocation"), + (_("%pB: %#" PRIx64 ": fatal: " + "unaligned branch target for relax-support relocation"), input_section->owner, - rel->r_offset); + (uint64_t) rel->r_offset); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -4231,10 +4238,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: fatal: unaligned %s relocation %#Lx"), - input_section->owner, - rel->r_offset, howto->name, - relocation); + (_("%pB: %#" PRIx64 ": fatal: " + "unaligned %s relocation %#" PRIx64), + input_section->owner, (uint64_t) rel->r_offset, + howto->name, (uint64_t) relocation); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -4247,10 +4254,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: fatal: unaligned %s relocation %#Lx"), + (_("%pB: %#" PRIx64 ": fatal: " + "unaligned %s relocation %#" PRIx64 ""), input_section->owner, - rel->r_offset, howto->name, - relocation); + (uint64_t) rel->r_offset, howto->name, + (uint64_t) relocation); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -4262,10 +4270,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: fatal: R_SH_PSHA relocation %Ld not in range -32..32"), + (_("%pB: %#" PRIx64 ": fatal: R_SH_PSHA relocation %" PRId64 + " not in range -32..32"), input_section->owner, - rel->r_offset, - relocation); + (uint64_t) rel->r_offset, + (int64_t) relocation); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -4277,10 +4286,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: fatal: R_SH_PSHL relocation %Ld not in range -32..32"), + (_("%pB: %#" PRIx64 ": fatal: R_SH_PSHL relocation %" PRId64 + " not in range -32..32"), input_section->owner, - rel->r_offset, - relocation); + (uint64_t) rel->r_offset, + (int64_t) relocation); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -4423,10 +4433,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): cannot emit fixup to `%s' in read-only section"), + (_("%pB(%pA+%#" PRIx64 "): " + "cannot emit fixup to `%s' in read-only section"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, symname); return FALSE; } @@ -4896,10 +4907,11 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): cannot emit fixup to `%s' in read-only section"), + (_("%pB(%pA+%#" PRIx64 "): " + "cannot emit fixup to `%s' in read-only section"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, symname); return FALSE; } @@ -4998,9 +5010,10 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s relocation against external symbol \"%s\""), - input_bfd, input_section, rel->r_offset, howto->name, - h->root.root.string); + (_("%pB(%pA+%#" PRIx64 "): " + "%s relocation against external symbol \"%s\""), + input_bfd, input_section, (uint64_t) rel->r_offset, + howto->name, h->root.root.string); return FALSE; } else @@ -6043,18 +6056,18 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, && (old_got_type == GOT_NORMAL || got_type == GOT_NORMAL)) _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and FDPIC symbol"), + (_("%pB: `%s' accessed both as normal and FDPIC symbol"), abfd, h->root.root.string); else if (old_got_type == GOT_FUNCDESC || got_type == GOT_FUNCDESC) _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as FDPIC and thread local symbol"), + (_("%pB: `%s' accessed both as FDPIC and thread local symbol"), abfd, h->root.root.string); else _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h->root.root.string); return FALSE; } @@ -6080,7 +6093,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (rel->r_addend) { _bfd_error_handler - (_("%B: Function descriptor relocation with non-zero addend"), + (_("%pB: Function descriptor relocation with non-zero addend"), abfd); return FALSE; } @@ -6129,12 +6142,12 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (old_got_type == GOT_NORMAL) _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and FDPIC symbol"), + (_("%pB: `%s' accessed both as normal and FDPIC symbol"), abfd, h->root.root.string); else _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as FDPIC and thread local symbol"), + (_("%pB: `%s' accessed both as FDPIC and thread local symbol"), abfd, h->root.root.string); } } @@ -6318,7 +6331,7 @@ sh_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (bfd_link_dll (info)) { _bfd_error_handler - (_("%B: TLS local exec code cannot be linked into shared objects"), + (_("%pB: TLS local exec code cannot be linked into shared objects"), abfd); return FALSE; } @@ -6433,7 +6446,7 @@ sh_merge_bfd_arch (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses %s instructions while previous modules " + (_("%pB: uses %s instructions while previous modules " "use %s instructions"), ibfd, SH_ARCH_SET_HAS_DSP (new_arch) ? "dsp" : "floating point", @@ -6482,7 +6495,7 @@ sh_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info) if (! sh_merge_bfd_arch (ibfd, info)) { - _bfd_error_handler (_("%B: uses instructions which are incompatible " + _bfd_error_handler (_("%pB: uses instructions which are incompatible " "with instructions used in previous modules"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -6495,7 +6508,7 @@ sh_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info) if (fdpic_object_p (ibfd) != fdpic_object_p (obfd)) { - _bfd_error_handler (_("%B: attempt to mix FDPIC and non-FDPIC objects"), + _bfd_error_handler (_("%pB: attempt to mix FDPIC and non-FDPIC objects"), ibfd); bfd_set_error (bfd_error_bad_value); return FALSE; diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c index 51eca0b..b635841 100644 --- a/bfd/elf32-sh64.c +++ b/bfd/elf32-sh64.c @@ -222,14 +222,14 @@ sh64_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info) if (bfd_get_arch_size (ibfd) == 32 && bfd_get_arch_size (obfd) == 64) /* xgettext:c-format */ - msg = _("%B: compiled as 32-bit object and %B is 64-bit"); + msg = _("%pB: compiled as 32-bit object and %pB is 64-bit"); else if (bfd_get_arch_size (ibfd) == 64 && bfd_get_arch_size (obfd) == 32) /* xgettext:c-format */ - msg = _("%B: compiled as 64-bit object and %B is 32-bit"); + msg = _("%pB: compiled as 64-bit object and %pB is 32-bit"); else /* xgettext:c-format */ - msg = _("%B: object size does not match that of target %B"); + msg = _("%pB: object size does not match that of target %pB"); _bfd_error_handler (msg, ibfd, obfd); bfd_set_error (bfd_error_wrong_format); @@ -248,7 +248,7 @@ sh64_elf_merge_private_data (bfd *ibfd, struct bfd_link_info *info) else if ((new_flags & EF_SH_MACH_MASK) != EF_SH5) { _bfd_error_handler - ("%B: uses non-SH64 instructions while previous modules" + ("%pB: uses non-SH64 instructions while previous modules" " use SH64 instructions", ibfd); bfd_set_error (bfd_error_bad_value); @@ -452,7 +452,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, { /* Make sure we don't get confused on invalid input. */ _bfd_error_handler - (_("%B: encountered datalabel symbol in input"), abfd); + (_("%pB: encountered datalabel symbol in input"), abfd); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -547,7 +547,7 @@ shmedia_prepare_reloc (struct bfd_link_info *info, bfd *abfd, if ((insn & SHMEDIA_PTB_BIT) != 0) { _bfd_error_handler - (_("%B: GAS error: unexpected PTB insn with R_SH_PT_16"), + (_("%pB: GAS error: unexpected PTB insn with R_SH_PT_16"), input_section->owner); return FALSE; } @@ -597,9 +597,10 @@ shmedia_prepare_reloc (struct bfd_link_info *info, bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: error: unaligned relocation type %d at %#Lx reloc %#Lx"), + (_("%pB: error: unaligned relocation type %d " + "at %#" PRIx64 " reloc %#" PRIx64), input_section->owner, (int) ELF32_R_TYPE (rel->r_info), - rel->r_offset, *relocation); + (uint64_t) rel->r_offset, (uint64_t) *relocation); return FALSE; } @@ -673,7 +674,7 @@ sh64_elf_final_write_processing (bfd *abfd, { bfd_set_error (bfd_error_file_truncated); _bfd_error_handler - (_("%B: could not write out added .cranges entries"), abfd); + (_("%pB: could not write out added .cranges entries"), abfd); } } @@ -732,7 +733,7 @@ sh64_elf_final_write_processing (bfd *abfd, { bfd_set_error (bfd_error_file_truncated); _bfd_error_handler - (_("%B: could not write out sorted .cranges entries"), abfd); + (_("%pB: could not write out sorted .cranges entries"), abfd); } } } diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index e8ca810..1a18e1e 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -86,7 +86,7 @@ elf32_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { error = TRUE; _bfd_error_handler - (_("%B: compiled for a 64 bit system and target is 32 bit"), ibfd); + (_("%pB: compiled for a 64 bit system and target is 32 bit"), ibfd); } else if ((ibfd->flags & DYNAMIC) == 0) { @@ -99,7 +99,7 @@ elf32_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) && previous_ibfd_e_flags != (unsigned long) -1) { _bfd_error_handler - (_("%B: linking little endian files with big endian files"), ibfd); + (_("%pB: linking little endian files with big endian files"), ibfd); error = TRUE; } previous_ibfd_e_flags = elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA; diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c index 941ae58..c3bfbbd 100644 --- a/bfd/elf32-spu.c +++ b/bfd/elf32-spu.c @@ -145,8 +145,8 @@ spu_elf_bfd_to_reloc_type (bfd_reloc_code_real_type code) } } -static void -spu_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +spu_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -157,12 +157,13 @@ spu_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= R_SPU_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised SPU reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_SPU_NONE; + return FALSE; } cache_ptr->howto = &elf_howto_table[(int) r_type]; + return TRUE; } static reloc_howto_type * @@ -723,16 +724,16 @@ spu_elf_find_overlays (struct bfd_link_info *info) if ((s->vma - vma_start) & (htab->params->line_size - 1)) { - info->callbacks->einfo (_("%X%P: overlay section %A " - "does not start on a cache line.\n"), + info->callbacks->einfo (_("%X%P: overlay section %pA " + "does not start on a cache line\n"), s); bfd_set_error (bfd_error_bad_value); return 0; } else if (s->size > htab->params->line_size) { - info->callbacks->einfo (_("%X%P: overlay section %A " - "is larger than a cache line.\n"), + info->callbacks->einfo (_("%X%P: overlay section %pA " + "is larger than a cache line\n"), s); bfd_set_error (bfd_error_bad_value); return 0; @@ -751,8 +752,8 @@ spu_elf_find_overlays (struct bfd_link_info *info) s = alloc_sec[i]; if (s->vma < ovl_end) { - info->callbacks->einfo (_("%X%P: overlay section %A " - "is not in cache area.\n"), + info->callbacks->einfo (_("%X%P: overlay section %pA " + "is not in cache area\n"), alloc_sec[i-1]); bfd_set_error (bfd_error_bad_value); return 0; @@ -792,9 +793,9 @@ spu_elf_find_overlays (struct bfd_link_info *info) if (s0->vma != s->vma) { /* xgettext:c-format */ - info->callbacks->einfo (_("%X%P: overlay sections %A " - "and %A do not start at the " - "same address.\n"), + info->callbacks->einfo (_("%X%P: overlay sections %pA " + "and %pA do not start at the " + "same address\n"), s0, s); bfd_set_error (bfd_error_bad_value); return 0; @@ -1018,7 +1019,7 @@ needs_ovl_stub (struct elf_link_hash_entry *h, } _bfd_error_handler /* xgettext:c-format */ - (_("warning: call to non-function symbol %s defined in %B"), + (_("warning: call to non-function symbol %s defined in %pB"), sym_name, sym_sec->owner); } @@ -1368,7 +1369,7 @@ build_stub (struct bfd_link_info *info, if (stub_type != br000_ovl_stub && lrlive != stub_type - br000_ovl_stub) /* xgettext:c-format */ - info->callbacks->einfo (_("%A:0x%v lrlive .brinfo (%u) differs " + info->callbacks->einfo (_("%pA:0x%v lrlive .brinfo (%u) differs " "from analysis (%u)\n"), isec, irela->r_offset, lrlive, stub_type - br000_ovl_stub); @@ -1900,7 +1901,7 @@ define_ovtab_symbol (struct spu_link_hash_table *htab, const char *name) else if (h->root.u.def.section->owner != NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B is not allowed to define %s"), + _bfd_error_handler (_("%pB is not allowed to define %s"), h->root.u.def.section->owner, h->root.root.string); bfd_set_error (bfd_error_bad_value); @@ -2611,7 +2612,7 @@ find_function (asection *sec, bfd_vma offset, struct bfd_link_info *info) return &sinfo->fun[mid]; } /* xgettext:c-format */ - info->callbacks->einfo (_("%A:0x%v not found in function table\n"), + info->callbacks->einfo (_("%pA:0x%v not found in function table\n"), sec, offset); bfd_set_error (bfd_error_bad_value); return NULL; @@ -2752,8 +2753,8 @@ mark_functions_via_relocs (asection *sec, if (!warned) info->callbacks->einfo /* xgettext:c-format */ - (_("%B(%A+0x%v): call to non-code section" - " %B(%A), analysis incomplete\n"), + (_("%pB(%pA+0x%v): call to non-code section" + " %pB(%pA), analysis incomplete\n"), sec->owner, sec, irela->r_offset, sym_sec->owner, sym_sec); warned = TRUE; @@ -3321,7 +3322,7 @@ remove_cycles (struct function_info *fun, const char *f2 = func_name (call->fun); /* xgettext:c-format */ - info->callbacks->info (_("Stack analysis will ignore the call " + info->callbacks->info (_("stack analysis will ignore the call " "from %s to %s\n"), f1, f2); } @@ -4541,7 +4542,7 @@ spu_elf_auto_overlay (struct bfd_link_info *info) if (i == base) { /* xgettext:c-format */ - info->callbacks->einfo (_("%B:%A%s exceeds overlay size\n"), + info->callbacks->einfo (_("%pB:%pA%s exceeds overlay size\n"), ovly_sections[2 * i]->owner, ovly_sections[2 * i], ovly_sections[2 * i + 1] ? " + rodata" : ""); @@ -5040,10 +5041,11 @@ spu_elf_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%s+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%s+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, bfd_get_section_name (input_bfd, input_section), - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, sym_name); ret = FALSE; diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c index 758b6a8..96965b3 100644 --- a/bfd/elf32-tic6x.c +++ b/bfd/elf32-tic6x.c @@ -1495,7 +1495,7 @@ elf32_tic6x_reloc_name_lookup (bfd *abfd, const char *r_name) return NULL; } -static void +static bfd_boolean elf32_tic6x_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { @@ -1503,12 +1503,28 @@ elf32_tic6x_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, r_type = ELF32_R_TYPE (elf_reloc->r_info); if (r_type >= ARRAY_SIZE (elf32_tic6x_howto_table)) - bfd_reloc->howto = NULL; - else - bfd_reloc->howto = &elf32_tic6x_howto_table[r_type]; + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + bfd_reloc->howto = &elf32_tic6x_howto_table[r_type]; + if (bfd_reloc->howto == NULL || bfd_reloc->howto->name == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + return TRUE; } -static void +static bfd_boolean elf32_tic6x_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { @@ -1516,9 +1532,25 @@ elf32_tic6x_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, r_type = ELF32_R_TYPE (elf_reloc->r_info); if (r_type >= ARRAY_SIZE (elf32_tic6x_howto_table_rel)) - bfd_reloc->howto = NULL; - else - bfd_reloc->howto = &elf32_tic6x_howto_table_rel[r_type]; + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + bfd_reloc->howto = &elf32_tic6x_howto_table_rel[r_type]; + if (bfd_reloc->howto == NULL || bfd_reloc->howto->name == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + return TRUE; } void @@ -2213,6 +2245,7 @@ elf32_tic6x_relocate_section (bfd *output_bfd, bfd_reloc_status_type r; struct bfd_link_hash_entry *sbh; bfd_boolean is_rel; + bfd_boolean res; r_type = ELF32_R_TYPE (rel->r_info); r_symndx = ELF32_R_SYM (rel->r_info); @@ -2221,11 +2254,11 @@ elf32_tic6x_relocate_section (bfd *output_bfd, relocs, rel); if (is_rel) - elf32_tic6x_info_to_howto_rel (input_bfd, &bfd_reloc, rel); + res = elf32_tic6x_info_to_howto_rel (input_bfd, &bfd_reloc, rel); else - elf32_tic6x_info_to_howto (input_bfd, &bfd_reloc, rel); - howto = bfd_reloc.howto; - if (howto == NULL) + res = elf32_tic6x_info_to_howto (input_bfd, &bfd_reloc, rel); + + if (!res || (howto = bfd_reloc.howto) == NULL) { bfd_set_error (bfd_error_bad_value); return FALSE; @@ -2457,7 +2490,7 @@ elf32_tic6x_relocate_section (bfd *output_bfd, } else { - _bfd_error_handler (_("%B: SB-relative relocation but " + _bfd_error_handler (_("%pB: SB-relative relocation but " "__c6xabi_DSBT_BASE not defined"), input_bfd); ok = FALSE; @@ -2567,21 +2600,21 @@ elf32_tic6x_relocate_section (bfd *output_bfd, if (h == NULL) _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s with non-zero addend %Ld" - " against local symbol"), + (_("%pB, section %pA: relocation %s with non-zero addend %" + PRId64 " against local symbol"), input_bfd, input_section, elf32_tic6x_howto_table[r_type].name, - rel->r_addend); + (int64_t) rel->r_addend); else _bfd_error_handler /* xgettext:c-format */ - (_("%B, section %A: relocation %s with non-zero addend %Ld" - " against symbol `%s'"), + (_("%pB, section %pA: relocation %s with non-zero addend %" + PRId64 " against symbol `%s'"), input_bfd, input_section, elf32_tic6x_howto_table[r_type].name, - rel->r_addend, + (int64_t) rel->r_addend, h->root.root.string[0] != '\0' ? h->root.root.string : _("[whose name is lost]")); @@ -2606,8 +2639,9 @@ elf32_tic6x_relocate_section (bfd *output_bfd, default: /* Unknown relocation. */ /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), input_bfd, r_type); + bfd_set_error (bfd_error_bad_value); ok = FALSE; continue; } @@ -2746,7 +2780,7 @@ elf32_tic6x_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -3202,7 +3236,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -3579,7 +3613,7 @@ elf32_tic6x_obj_attrs_handle_unknown (bfd *abfd, int tag) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: error: unknown mandatory EABI object attribute %d"), + (_("%pB: error: unknown mandatory EABI object attribute %d"), abfd, tag); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3588,7 +3622,7 @@ elf32_tic6x_obj_attrs_handle_unknown (bfd *abfd, int tag) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: unknown EABI object attribute %d"), + (_("%pB: warning: unknown EABI object attribute %d"), abfd, tag); return TRUE; } @@ -3702,7 +3736,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B requires more stack alignment than %B preserves"), + (_("error: %pB requires more stack alignment than %pB preserves"), ibfd, obfd); result = FALSE; } @@ -3711,7 +3745,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B requires more stack alignment than %B preserves"), + (_("error: %pB requires more stack alignment than %pB preserves"), obfd, ibfd); result = FALSE; } @@ -3721,7 +3755,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) if (array_align_in == -1) { _bfd_error_handler - (_("error: unknown Tag_ABI_array_object_alignment value in %B"), + (_("error: unknown Tag_ABI_array_object_alignment value in %pB"), ibfd); result = FALSE; } @@ -3730,7 +3764,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) if (array_align_out == -1) { _bfd_error_handler - (_("error: unknown Tag_ABI_array_object_alignment value in %B"), + (_("error: unknown Tag_ABI_array_object_alignment value in %pB"), obfd); result = FALSE; } @@ -3739,7 +3773,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) if (array_expect_in == -1) { _bfd_error_handler - (_("error: unknown Tag_ABI_array_object_align_expected value in %B"), + (_("error: unknown Tag_ABI_array_object_align_expected value in %pB"), ibfd); result = FALSE; } @@ -3748,7 +3782,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) if (array_expect_out == -1) { _bfd_error_handler - (_("error: unknown Tag_ABI_array_object_align_expected value in %B"), + (_("error: unknown Tag_ABI_array_object_align_expected value in %pB"), obfd); result = FALSE; } @@ -3757,7 +3791,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B requires more array alignment than %B preserves"), + (_("error: %pB requires more array alignment than %pB preserves"), ibfd, obfd); result = FALSE; } @@ -3765,7 +3799,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B requires more array alignment than %B preserves"), + (_("error: %pB requires more array alignment than %pB preserves"), obfd, ibfd); result = FALSE; } @@ -3788,7 +3822,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("warning: %B and %B differ in wchar_t size"), obfd, ibfd); + (_("warning: %pB and %pB differ in wchar_t size"), obfd, ibfd); } break; @@ -3807,7 +3841,7 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("warning: %B and %B differ in whether code is " + (_("warning: %pB and %pB differ in whether code is " "compiled for DSBT"), obfd, ibfd); } diff --git a/bfd/elf32-tilepro.c b/bfd/elf32-tilepro.c index 96ba98d..55b19f8 100644 --- a/bfd/elf32-tilepro.c +++ b/bfd/elf32-tilepro.c @@ -783,7 +783,7 @@ tilepro_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an TILEPro ELF reloc. */ -static void +static bfd_boolean tilepro_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, arelent * cache_ptr, Elf_Internal_Rela * dst) @@ -793,11 +793,19 @@ tilepro_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type <= (unsigned int) R_TILEPRO_IMM16_X1_TLS_LE_HA) cache_ptr->howto = &tilepro_elf_howto_table [r_type]; else if (r_type - R_TILEPRO_GNU_VTINHERIT - <= (unsigned int) R_TILEPRO_GNU_VTENTRY) + <= ((unsigned int) R_TILEPRO_GNU_VTENTRY + - (unsigned int) R_TILEPRO_GNU_VTINHERIT)) cache_ptr->howto = &tilepro_elf_howto_table2 [r_type - R_TILEPRO_GNU_VTINHERIT]; else - abort (); + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } typedef tilepro_bundle_bits (*tilepro_create_func)(int); @@ -1468,7 +1476,7 @@ tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -1581,7 +1589,7 @@ tilepro_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h ? h->root.root.string : ""); return FALSE; } @@ -2234,7 +2242,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2257,7 +2265,7 @@ tilepro_elf_omit_section_dynsym (bfd *output_bfd, if (strcmp (p->name, ".got") == 0) return FALSE; - return _bfd_elf_link_omit_section_dynsym (output_bfd, info, p); + return _bfd_elf_omit_section_dynsym_default (output_bfd, info, p); } /* Set the sizes of the dynamic sections. */ @@ -2328,7 +2336,7 @@ tilepro_elf_size_dynamic_sections (bfd *output_bfd, { info->flags |= DF_TEXTREL; - info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"), + info->callbacks->minfo (_("%pB: dynamic relocation in read-only section `%pA'\n"), p->sec->owner, p->sec); } } @@ -3144,7 +3152,7 @@ tilepro_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { BFD_FAIL (); _bfd_error_handler - (_("%B: probably compiled without -fPIC?"), + (_("%pB: probably compiled without -fPIC?"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3398,10 +3406,11 @@ tilepro_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, rel->r_offset) != (bfd_vma) -1) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); @@ -3749,7 +3758,7 @@ tilepro_elf_finish_dynamic_sections (bfd *output_bfd, if (bfd_is_abs_section (htab->elf.sgotplt->output_section)) { _bfd_error_handler - (_("discarded output section: `%A'"), htab->elf.sgotplt); + (_("discarded output section: `%pA'"), htab->elf.sgotplt); return FALSE; } diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c index 99c060a..430153a 100644 --- a/bfd/elf32-v850.c +++ b/bfd/elf32-v850.c @@ -61,7 +61,7 @@ v850_elf_check_relocs (bfd *abfd, return TRUE; #ifdef DEBUG - _bfd_error_handler ("v850_elf_check_relocs called for section %A in %B", + _bfd_error_handler ("v850_elf_check_relocs called for section %pA in %pB", sec, abfd); #endif @@ -150,19 +150,19 @@ v850_elf_check_relocs (bfd *abfd, switch (h->other & V850_OTHER_MASK) { default: - msg = _("Variable `%s' cannot occupy in multiple small data regions"); + msg = _("variable `%s' cannot occupy in multiple small data regions"); break; case V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA: - msg = _("Variable `%s' can only be in one of the small, zero, and tiny data regions"); + msg = _("variable `%s' can only be in one of the small, zero, and tiny data regions"); break; case V850_OTHER_SDA | V850_OTHER_ZDA: - msg = _("Variable `%s' cannot be in both small and zero data regions simultaneously"); + msg = _("variable `%s' cannot be in both small and zero data regions simultaneously"); break; case V850_OTHER_SDA | V850_OTHER_TDA: - msg = _("Variable `%s' cannot be in both small and tiny data regions simultaneously"); + msg = _("variable `%s' cannot be in both small and tiny data regions simultaneously"); break; case V850_OTHER_ZDA | V850_OTHER_TDA: - msg = _("Variable `%s' cannot be in both zero and tiny data regions simultaneously"); + msg = _("variable `%s' cannot be in both zero and tiny data regions simultaneously"); break; } @@ -460,7 +460,7 @@ v850_elf_perform_lo16_relocation (bfd *abfd, unsigned long *insn, } else { - _bfd_error_handler (_("FAILED to find previous HI16 reloc")); + _bfd_error_handler (_("failed to find previous HI16 reloc")); return FALSE; } } @@ -490,7 +490,8 @@ v850_elf_perform_relocation (bfd *abfd, { default: #ifdef DEBUG - fprintf (stderr, "%B: reloc number %d not recognised\n", abfd, r_type); + _bfd_error_handler ("%pB: unsupported relocation type %#x", + abfd, r_type); #endif return bfd_reloc_notsupported; @@ -1884,8 +1885,8 @@ v850_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an V850 ELF reloc. */ -static void -v850_elf_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +v850_elf_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -1895,16 +1896,19 @@ v850_elf_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_V850_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid V850 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &v850_elf_howto_table[r_type]; + return TRUE; } /* Set the howto pointer for a V850 ELF reloc (type RELA). */ -static void -v850_elf_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +v850_elf_info_to_howto_rela (bfd *abfd, arelent * cache_ptr, Elf_Internal_Rela *dst) { @@ -1914,10 +1918,13 @@ v850_elf_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_V850_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid V850 reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &v850_elf_howto_table[r_type]; + return TRUE; } static bfd_boolean @@ -2145,7 +2152,8 @@ v850_elf_final_link_relocate (reloc_howto_type *howto, default: #ifdef DEBUG - fprintf (stderr, "%B: reloc number %d not recognised\n", input_bfd, r_type); + _bfd_error_handler ("%pB: unsupported relocation type %#x", + input_bfd, r_type); #endif return bfd_reloc_notsupported; } @@ -2521,7 +2529,7 @@ v850_elf_merge_notes (bfd * ibfd, bfd *obfd) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B needs 8-byte alignment but %B is set for 4-byte alignment"), + (_("error: %pB needs 8-byte alignment but %pB is set for 4-byte alignment"), ibfd, obfd); result = FALSE; } @@ -2537,8 +2545,8 @@ v850_elf_merge_notes (bfd * ibfd, bfd *obfd) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B uses 64-bit doubles but " - "%B uses 32-bit doubles"), ibfd, obfd); + (_("error: %pB uses 64-bit doubles but " + "%pB uses 32-bit doubles"), ibfd, obfd); result = FALSE; } else @@ -2552,7 +2560,7 @@ v850_elf_merge_notes (bfd * ibfd, bfd *obfd) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B uses FPU-3.0 but %B only supports FPU-2.0"), + (_("error: %pB uses FPU-3.0 but %pB only supports FPU-2.0"), ibfd, obfd); result = FALSE; } @@ -2809,7 +2817,7 @@ v850_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_V800_850E3) != (out_flags & EF_V800_850E3)) { _bfd_error_handler - (_("%B: Architecture mismatch with previous modules"), ibfd); + (_("%pB: architecture mismatch with previous modules"), ibfd); elf_elfheader (obfd)->e_flags |= EF_V800_850E3; } @@ -2865,7 +2873,7 @@ v850_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) } _bfd_error_handler - (_("%B: Architecture mismatch with previous modules"), ibfd); + (_("%pB: architecture mismatch with previous modules"), ibfd); } return result; @@ -3598,9 +3606,9 @@ v850_elf_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: R_V850_LONGCALL points to " + (_("%pB: %#" PRIx64 ": warning: %s points to " "unrecognized insns"), - abfd, irel->r_offset); + abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL"); continue; } @@ -3608,10 +3616,11 @@ v850_elf_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: R_V850_LONGCALL points to " + (_("%pB: %#" PRIx64 ": warning: %s points to " "unrecognized insn %#x"), abfd, - irel->r_offset + no_match, + (uint64_t) (irel->r_offset + no_match), + "R_V850_LONGCALL", insn[no_match]); continue; } @@ -3653,9 +3662,9 @@ v850_elf_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: R_V850_LONGCALL points to " + (_("%pB: %#" PRIx64 ": warning: %s points to " "unrecognized reloc"), - abfd, irel->r_offset); + abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL"); continue; } @@ -3693,10 +3702,10 @@ v850_elf_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: R_V850_LONGCALL points to " - "unrecognized reloc %#Lx"), - abfd, irel->r_offset, - irelcall->r_offset); + (_("%pB: %#" PRIx64 ": warning: %s points to " + "unrecognized reloc %#" PRIx64), + abfd, (uint64_t) irel->r_offset, "R_V850_LONGCALL", + (uint64_t) irelcall->r_offset); continue; } @@ -3836,9 +3845,9 @@ v850_elf_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: R_V850_LONGJUMP points to " + (_("%pB: %#" PRIx64 ": warning: %s points to " "unrecognized insns"), - abfd, irel->r_offset); + abfd, (uint64_t) irel->r_offset, "R_V850_LONGJUMP"); continue; } @@ -3846,10 +3855,11 @@ v850_elf_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: R_V850_LONGJUMP points to " + (_("%pB: %#" PRIx64 ": warning: %s points to " "unrecognized insn %#x"), abfd, - irel->r_offset + no_match, + (uint64_t) (irel->r_offset + no_match), + "R_V850_LONGJUMP", insn[no_match]); continue; } @@ -3880,9 +3890,9 @@ v850_elf_relax_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %#Lx: warning: R_V850_LONGJUMP points to " + (_("%pB: %#" PRIx64 ": warning: %s points to " "unrecognized reloc"), - abfd, irel->r_offset); + abfd, (uint64_t) irel->r_offset, "R_V850_LONGJUMP"); continue; } @@ -4241,25 +4251,30 @@ v800_elf_reloc_name_lookup (bfd * abfd, const char * r_name) /* Set the howto pointer in CACHE_PTR for a V800 ELF reloc. */ -static void +static bfd_boolean v800_elf_info_to_howto (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); - BFD_ASSERT (bfd_get_arch (abfd) == bfd_arch_v850_rh850); - - BFD_ASSERT (r_type < (unsigned int) R_V800_max); - if (r_type == R_V800_NONE) r_type = R_V810_NONE; - BFD_ASSERT (r_type >= (unsigned int) R_V810_NONE); - r_type -= R_V810_NONE; - BFD_ASSERT (r_type < ARRAY_SIZE (v800_elf_howto_table)); + if (bfd_get_arch (abfd) != bfd_arch_v850_rh850 + || r_type >= (unsigned int) R_V800_max + || r_type < (unsigned int) R_V810_NONE + || (r_type - R_V810_NONE) >= ARRAY_SIZE (v800_elf_howto_table)) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } - cache_ptr->howto = v800_elf_howto_table + r_type; + cache_ptr->howto = v800_elf_howto_table + (r_type - R_V810_NONE); + return TRUE; } #undef TARGET_LITTLE_SYM diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c index 54364ed..0236180 100644 --- a/bfd/elf32-vax.c +++ b/bfd/elf32-vax.c @@ -27,7 +27,7 @@ #include "elf/vax.h" static reloc_howto_type *reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static void rtype_to_howto (bfd *, arelent *, Elf_Internal_Rela *); +static bfd_boolean rtype_to_howto (bfd *, arelent *, Elf_Internal_Rela *); static struct bfd_hash_entry *elf_vax_link_hash_newfunc (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); @@ -278,7 +278,7 @@ static reloc_howto_type howto_table[] = { FALSE), /* pcrel_offset */ }; -static void +static bfd_boolean rtype_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; @@ -287,12 +287,13 @@ rtype_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) if (r_type >= R_VAX_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised VAX reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_VAX_NONE; + return FALSE; } cache_ptr->howto = &howto_table[r_type]; + return TRUE; } #define elf_info_to_howto rtype_to_howto @@ -628,10 +629,10 @@ elf_vax_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, if (eh->got_addend != (bfd_vma) rel->r_addend) _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: GOT addend of %Ld to `%s' does" - " not match previous GOT addend of %Ld"), - abfd, rel->r_addend, h->root.root.string, - eh->got_addend); + (_("%pB: warning: GOT addend of %" PRId64 " to `%s' does" + " not match previous GOT addend of %" PRId64), + abfd, (int64_t) rel->r_addend, h->root.root.string, + (int64_t) eh->got_addend); } } @@ -1442,9 +1443,10 @@ elf_vax_relocate_section (bfd *output_bfd, else if (rel->r_addend != 0) _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: PLT addend of %Ld to `%s'" - " from %A section ignored"), - input_bfd, rel->r_addend, h->root.root.string, input_section); + (_("%pB: warning: PLT addend of %" PRId64 " to `%s'" + " from %pA section ignored"), + input_bfd, (int64_t) rel->r_addend, h->root.root.string, + input_section); rel->r_addend = 0; break; @@ -1567,15 +1569,16 @@ elf_vax_relocate_section (bfd *output_bfd, if (h != NULL) _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: %s relocation against symbol `%s'" - " from %A section"), + (_("%pB: warning: %s relocation against symbol `%s'" + " from %pA section"), input_bfd, howto->name, h->root.root.string, input_section); else _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: %s relocation to %#Lx from %A section"), - input_bfd, howto->name, outrel.r_addend, + (_("%pB: warning: %s relocation to %#" PRIx64 + " from %pA section"), + input_bfd, howto->name, (uint64_t) outrel.r_addend, input_section); } loc = sreloc->contents; diff --git a/bfd/elf32-visium.c b/bfd/elf32-visium.c index 45f3337..3f8d16a 100644 --- a/bfd/elf32-visium.c +++ b/bfd/elf32-visium.c @@ -458,8 +458,8 @@ visium_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for a VISIUM ELF reloc. */ -static void -visium_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, +static bfd_boolean +visium_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); @@ -478,12 +478,15 @@ visium_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, if (r_type >= (unsigned int) R_VISIUM_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid Visium reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &visium_elf_howto_table[r_type]; break; } + return TRUE; } /* Look through the relocs for a section during the first phase. @@ -814,7 +817,7 @@ visium_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (mismatch) _bfd_error_handler /* xgettext:c-format */ - (_("%B: compiled %s -mtune=%s and linked with modules" + (_("%pB: compiled %s -mtune=%s and linked with modules" " compiled %s -mtune=%s"), ibfd, new_opt_with, opt_arch, old_opt_with, opt_arch); } diff --git a/bfd/elf32-wasm32.c b/bfd/elf32-wasm32.c index 5205bef..9fc48de 100644 --- a/bfd/elf32-wasm32.c +++ b/bfd/elf32-wasm32.c @@ -103,26 +103,29 @@ elf32_wasm32_rtype_to_howto (bfd *abfd, unsigned r_type) if (i >= ARRAY_SIZE (elf32_wasm32_howto_table)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), - abfd, (int) r_type); - i = R_WASM32_NONE; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return NULL; } if (elf32_wasm32_howto_table[i].type != r_type) return NULL; - return &elf32_wasm32_howto_table[i]; + return elf32_wasm32_howto_table + i; } /* Translate the ELF-internal relocation RELA into CACHE_PTR. */ -static void -elf32_wasm32_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +elf32_wasm32_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); + cache_ptr->howto = elf32_wasm32_rtype_to_howto (abfd, r_type); + return cache_ptr->howto != NULL; } #define ELF_ARCH bfd_arch_wasm32 diff --git a/bfd/elf32-xc16x.c b/bfd/elf32-xc16x.c index 42a3dca..66fe33d 100644 --- a/bfd/elf32-xc16x.c +++ b/bfd/elf32-xc16x.c @@ -212,9 +212,7 @@ xc16x_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, { unsigned int i; - for (i = 0; - i < sizeof (xc16x_elf_howto_table) / sizeof (xc16x_elf_howto_table[0]); - i++) + for (i = 0; i < ARRAY_SIZE (xc16x_elf_howto_table); i++) if (xc16x_elf_howto_table[i].name != NULL && strcasecmp (xc16x_elf_howto_table[i].name, r_name) == 0) return &xc16x_elf_howto_table[i]; @@ -225,8 +223,8 @@ xc16x_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* For a particular operand this function is called to finalise the type of relocation. */ -static void -elf32_xc16x_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, +static bfd_boolean +elf32_xc16x_info_to_howto (bfd *abfd, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { unsigned int r; @@ -237,9 +235,12 @@ elf32_xc16x_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, if (xc16x_elf_howto_table[i].type == r) { bfd_reloc->howto = &xc16x_elf_howto_table[i]; - return; + return TRUE; } - abort (); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r); + bfd_set_error (bfd_error_bad_value); + return FALSE; } static bfd_reloc_status_type diff --git a/bfd/elf32-xgate.c b/bfd/elf32-xgate.c index 5a93b5e..a367526 100644 --- a/bfd/elf32-xgate.c +++ b/bfd/elf32-xgate.c @@ -34,7 +34,7 @@ static reloc_howto_type * bfd_elf32_bfd_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); static reloc_howto_type * bfd_elf32_bfd_reloc_name_lookup (bfd *, const char *); -static void +static bfd_boolean xgate_info_to_howto_rel (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean xgate_elf_set_mach_from_flags (bfd *); @@ -395,7 +395,7 @@ bfd_elf32_bfd_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, for (i = 0; i < ARRAY_SIZE (xgate_reloc_map); i++) if (xgate_reloc_map[i].bfd_reloc_val == code) return &elf_xgate_howto_table[xgate_reloc_map[i].elf_reloc_val]; - + return NULL; } @@ -414,8 +414,8 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for an XGATE ELF reloc. */ -static void -xgate_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +xgate_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -425,10 +425,13 @@ xgate_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_XGATE_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid XGate reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_xgate_howto_table[r_type]; + return TRUE; } /* Destroy an XGATE ELF linker hash table. */ @@ -701,12 +704,12 @@ elf32_xgate_post_process_headers (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_in #define TARGET_BIG_SYM xgate_elf32_vec #define TARGET_BIG_NAME "elf32-xgate" -#define elf_info_to_howto 0 +#define elf_info_to_howto NULL #define elf_info_to_howto_rel xgate_info_to_howto_rel #define elf_backend_check_relocs elf32_xgate_check_relocs #define elf_backend_relocate_section elf32_xgate_relocate_section #define elf_backend_object_p xgate_elf_set_mach_from_flags -#define elf_backend_final_write_processing 0 +#define elf_backend_final_write_processing NULL #define elf_backend_can_gc_sections 1 #define elf_backend_special_sections elf32_xgate_special_sections #define elf_backend_post_process_headers elf32_xgate_post_process_headers diff --git a/bfd/elf32-xstormy16.c b/bfd/elf32-xstormy16.c index 476f9e0..4cd7e62 100644 --- a/bfd/elf32-xstormy16.c +++ b/bfd/elf32-xstormy16.c @@ -375,8 +375,8 @@ xstormy16_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Set the howto pointer for an XSTORMY16 ELF reloc. */ -static void -xstormy16_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, +static bfd_boolean +xstormy16_info_to_howto_rela (bfd * abfd, arelent * cache_ptr, Elf_Internal_Rela * dst) { @@ -385,11 +385,19 @@ xstormy16_info_to_howto_rela (bfd * abfd ATTRIBUTE_UNUSED, if (r_type <= (unsigned int) R_XSTORMY16_12) cache_ptr->howto = &xstormy16_elf_howto_table [r_type]; else if (r_type - R_XSTORMY16_GNU_VTINHERIT - <= (unsigned int) R_XSTORMY16_GNU_VTENTRY) + <= ((unsigned int) R_XSTORMY16_GNU_VTENTRY + - (unsigned int) R_XSTORMY16_GNU_VTINHERIT)) cache_ptr->howto = &xstormy16_elf_howto_table2 [r_type - R_XSTORMY16_GNU_VTINHERIT]; else - abort (); + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } /* We support 16-bit pointers to code above 64k by generating a thunk @@ -1009,7 +1017,7 @@ xstormy16_elf_gc_mark_hook (asection *sec, #define elf_backend_always_size_sections \ xstormy16_elf_always_size_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + _bfd_elf_omit_section_dynsym_all #define elf_backend_finish_dynamic_sections \ xstormy16_elf_finish_dynamic_sections diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index b3a7467..cd08796 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -450,6 +450,9 @@ elf_xtensa_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, break; } + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, (int) code); + bfd_set_error (bfd_error_bad_value); TRACE ("Unknown"); return NULL; } @@ -472,8 +475,8 @@ elf_xtensa_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Given an ELF "rela" relocation, find the corresponding howto and record it in the BFD internal arelent representation of the relocation. */ -static void -elf_xtensa_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +elf_xtensa_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -482,10 +485,13 @@ elf_xtensa_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_XTENSA_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid XTENSA reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_howto_table[r_type]; + return TRUE; } @@ -923,7 +929,7 @@ xtensa_read_table_entries (bfd *abfd, blocks[blk - 1].size != 0) { /* xgettext:c-format */ - _bfd_error_handler (_("%B(%A): invalid property table"), + _bfd_error_handler (_("%pB(%pA): invalid property table"), abfd, section); bfd_set_error (bfd_error_bad_value); free (blocks); @@ -1015,7 +1021,7 @@ elf_xtensa_check_relocs (bfd *abfd, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -1189,7 +1195,7 @@ elf_xtensa_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h ? h->root.root.string : ""); return FALSE; @@ -2652,8 +2658,10 @@ elf_xtensa_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): relocation offset out of range (size=%#Lx)"), - input_bfd, input_section, rel->r_offset, input_size); + (_("%pB(%pA+%#" PRIx64 "): " + "relocation offset out of range (size=%#" PRIx64 ")"), + input_bfd, input_section, (uint64_t) rel->r_offset, + (uint64_t) input_size); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2678,12 +2686,12 @@ elf_xtensa_relocate_section (bfd *output_bfd, _bfd_error_handler ((sym_type == STT_TLS /* xgettext:c-format */ - ? _("%B(%A+%#Lx): %s used with TLS symbol %s") + ? _("%pB(%pA+%#" PRIx64 "): %s used with TLS symbol %s") /* xgettext:c-format */ - : _("%B(%A+%#Lx): %s used with non-TLS symbol %s")), + : _("%pB(%pA+%#" PRIx64 "): %s used with non-TLS symbol %s")), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, name); } @@ -2936,10 +2944,11 @@ elf_xtensa_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, name); return FALSE; @@ -3347,7 +3356,7 @@ elf_xtensa_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: incompatible machine type. Output is 0x%x. Input is 0x%x"), + (_("%pB: incompatible machine type; output is 0x%x; input is 0x%x"), ibfd, out_mach, in_mach); bfd_set_error (bfd_error_wrong_format); return FALSE; @@ -4578,7 +4587,7 @@ elf_xtensa_do_asm_simplify (bfd_byte *contents, if (content_length < address) { - *error_message = _("Attempt to convert L32R/CALLX to CALL failed"); + *error_message = _("attempt to convert L32R/CALLX to CALL failed"); return bfd_reloc_other; } @@ -4586,7 +4595,7 @@ elf_xtensa_do_asm_simplify (bfd_byte *contents, direct_call_opcode = swap_callx_for_call_opcode (opcode); if (direct_call_opcode == XTENSA_UNDEFINED) { - *error_message = _("Attempt to convert L32R/CALLX to CALL failed"); + *error_message = _("attempt to convert L32R/CALLX to CALL failed"); return bfd_reloc_other; } @@ -6414,9 +6423,10 @@ extend_ebb_bounds_forward (ebb_t *ebb) { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): could not decode instruction; " + (_("%pB(%pA+%#" PRIx64 "): could not decode instruction; " "possible configuration mismatch"), - ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len); + ebb->sec->owner, ebb->sec, + (uint64_t) (ebb->end_offset + insn_block_len)); return FALSE; } ebb->end_offset += insn_block_len; @@ -6492,9 +6502,10 @@ extend_ebb_bounds_backward (ebb_t *ebb) { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): could not decode instruction; " + (_("%pB(%pA+%#" PRIx64 "): could not decode instruction; " "possible configuration mismatch"), - ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len); + ebb->sec->owner, ebb->sec, + (uint64_t) (ebb->end_offset + insn_block_len)); return FALSE; } ebb->start_offset -= insn_block_len; @@ -7607,10 +7618,10 @@ compute_text_actions (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): could not decode instruction for " + (_("%pB(%pA+%#" PRIx64 "): could not decode instruction for " "XTENSA_ASM_SIMPLIFY relocation; " "possible configuration mismatch"), - sec->owner, sec, r_offset); + sec->owner, sec, (uint64_t) r_offset); continue; } @@ -7868,9 +7879,9 @@ compute_ebb_proposed_actions (ebb_constraint *ebb_table) decode_error: _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): could not decode instruction; " + (_("%pB(%pA+%#" PRIx64 "): could not decode instruction; " "possible configuration mismatch"), - ebb->sec->owner, ebb->sec, offset); + ebb->sec->owner, ebb->sec, (uint64_t) offset); return FALSE; } @@ -10646,8 +10657,8 @@ do_fix_for_relocatable_link (Elf_Internal_Rela *rel, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unexpected fix for %s relocation"), - input_bfd, input_section, rel->r_offset, + (_("%pB(%pA+%#" PRIx64 "): unexpected fix for %s relocation"), + input_bfd, input_section, (uint64_t) rel->r_offset, elf_howto_table[r_type].name); return FALSE; } @@ -11243,8 +11254,7 @@ static const struct bfd_elf_special_section elf_xtensa_special_sections[] = #define elf_backend_relocate_section elf_xtensa_relocate_section #define elf_backend_size_dynamic_sections elf_xtensa_size_dynamic_sections #define elf_backend_always_size_sections elf_xtensa_always_size_sections -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all #define elf_backend_special_sections elf_xtensa_special_sections #define elf_backend_action_discarded elf_xtensa_action_discarded #define elf_backend_copy_indirect_symbol elf_xtensa_copy_indirect_symbol diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index db4001c..d59c596 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -1100,8 +1100,8 @@ elf64_alpha_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Given an Alpha ELF reloc type, fill in an arelent structure. */ -static void -elf64_alpha_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, +static bfd_boolean +elf64_alpha_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned r_type = ELF64_R_TYPE(dst->r_info); @@ -1109,12 +1109,13 @@ elf64_alpha_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, if (r_type >= R_ALPHA_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognised Alpha reloc number: %d"), + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_ALPHA_NONE; + return FALSE; } cache_ptr->howto = &elf64_alpha_howto_table[r_type]; + return TRUE; } /* These two relocations create a two-word entry in the got. */ @@ -2459,7 +2460,7 @@ elf64_alpha_size_got_sections (struct bfd_link_info *info, /* Yikes! A single object file has too many entries. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: .got subsegment exceeds 64K (size %d)"), + (_("%pB: .got subsegment exceeds 64K (size %d)"), i, alpha_elf_tdata (this_got)->total_got_size); return FALSE; } @@ -3014,8 +3015,9 @@ elf64_alpha_relax_got_load (struct alpha_relax_info *info, bfd_vma symval, reloc_howto_type *howto = elf64_alpha_howto_table + r_type; _bfd_error_handler /* xgettext:c-format */ - (_("%B: %A+%#Lx: warning: %s relocation against unexpected insn"), - info->abfd, info->sec, irel->r_offset, howto->name); + (_("%pB: %pA+%#" PRIx64 ": warning: " + "%s relocation against unexpected insn"), + info->abfd, info->sec, (uint64_t) irel->r_offset, howto->name); return TRUE; } @@ -3209,8 +3211,9 @@ elf64_alpha_relax_with_lituse (struct alpha_relax_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %A+%#Lx: warning: LITERAL relocation against unexpected insn"), - abfd, info->sec, irel->r_offset); + (_("%pB: %pA+%#" PRIx64 ": warning: " + "%s relocation against unexpected insn"), + abfd, info->sec, (uint64_t) irel->r_offset, "LITERAL"); return TRUE; } @@ -4095,7 +4098,7 @@ elf64_alpha_relocate_section_r (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unknown relocation type %d"), + (_("%pB: unsupported relocation type %#x"), input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); ret_val = FALSE; @@ -4243,7 +4246,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unknown relocation type %d"), + (_("%pB: unsupported relocation type %#x"), input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); ret_val = FALSE; @@ -4409,7 +4412,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: gp-relative relocation against dynamic symbol %s"), + (_("%pB: gp-relative relocation against dynamic symbol %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; } @@ -4422,7 +4425,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: gp-relative relocation against dynamic symbol %s"), + (_("%pB: gp-relative relocation against dynamic symbol %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; } @@ -4449,7 +4452,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: pc-relative relocation against dynamic symbol %s"), + (_("%pB: pc-relative relocation against dynamic symbol %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; } @@ -4478,7 +4481,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: change in gp: BRSGP %s"), + (_("%pB: change in gp: BRSGP %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; } @@ -4509,7 +4512,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, } _bfd_error_handler /* xgettext:c-format */ - (_("%B: !samegp reloc against symbol without .prologue: %s"), + (_("%pB: !samegp reloc against symbol without .prologue: %s"), input_bfd, name); ret_val = FALSE; break; @@ -4567,7 +4570,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unhandled dynamic relocation against %s"), + (_("%pB: unhandled dynamic relocation against %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; @@ -4593,7 +4596,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: pc-relative relocation against dynamic symbol %s"), + (_("%pB: pc-relative relocation against dynamic symbol %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; } @@ -4602,7 +4605,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: pc-relative relocation against undefined weak symbol %s"), + (_("%pB: pc-relative relocation against undefined weak symbol %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; } @@ -4668,7 +4671,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: dtp-relative relocation against dynamic symbol %s"), + (_("%pB: dtp-relative relocation against dynamic symbol %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; } @@ -4685,7 +4688,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: TLS local exec code cannot be linked into shared objects"), + (_("%pB: TLS local exec code cannot be linked into shared objects"), input_bfd); ret_val = FALSE; } @@ -4693,7 +4696,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: tp-relative relocation against dynamic symbol %s"), + (_("%pB: tp-relative relocation against dynamic symbol %s"), input_bfd, h->root.root.root.string); ret_val = FALSE; } @@ -5495,7 +5498,7 @@ static const struct elf_size_info alpha_elf_size_info = #define elf_backend_size_dynamic_sections \ elf64_alpha_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + _bfd_elf_omit_section_dynsym_all #define elf_backend_relocate_section \ elf64_alpha_relocate_section #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf64-gen.c b/bfd/elf64-gen.c index 46bb32b..fef6277 100644 --- a/bfd/elf64-gen.c +++ b/bfd/elf64-gen.c @@ -41,20 +41,22 @@ static reloc_howto_type dummy = 0, /* dst_mask */ FALSE); /* pcrel_offset */ -static void +static bfd_boolean elf_generic_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED) { bfd_reloc->howto = &dummy; + return TRUE; } -static void +static bfd_boolean elf_generic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED) { bfd_reloc->howto = &dummy; + return TRUE; } static void @@ -66,7 +68,7 @@ check_for_relocs (bfd * abfd, asection * o, void * failed) ehdrp = elf_elfheader (abfd); /* xgettext:c-format */ - _bfd_error_handler (_("%B: Relocations in generic ELF (EM: %d)"), + _bfd_error_handler (_("%pB: Relocations in generic ELF (EM: %d)"), abfd, ehdrp->e_machine); bfd_set_error (bfd_error_wrong_format); diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index ff96a8c..2e66c92 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -2078,8 +2078,8 @@ elf64_hppa_finish_dynamic_symbol (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("stub entry for %s cannot load .plt, dp offset = %Ld"), - hh->eh.root.root.string, value); + (_("stub entry for %s cannot load .plt, dp offset = %" PRId64), + hh->eh.root.root.string, (int64_t) value); return FALSE; } @@ -3283,10 +3283,10 @@ elf_hppa_final_link_relocate (Elf_Internal_Rela *rel, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): cannot reach %s"), + (_("%pB(%pA+%#" PRIx64 "): cannot reach %s"), input_bfd, input_section, - offset, + (uint64_t) offset, eh ? eh->root.root.string : "unknown"); bfd_set_error (bfd_error_bad_value); return bfd_reloc_overflow; @@ -4052,8 +4052,8 @@ const struct elf_size_info hppa64_elf_size_info = elf64_hppa_create_dynamic_sections #define elf_backend_post_process_headers elf64_hppa_post_process_headers -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all + #define elf_backend_adjust_dynamic_symbol \ elf64_hppa_adjust_dynamic_symbol diff --git a/bfd/elf64-ia64-vms.c b/bfd/elf64-ia64-vms.c index 0fab317..bc66b17 100644 --- a/bfd/elf64-ia64-vms.c +++ b/bfd/elf64-ia64-vms.c @@ -240,13 +240,24 @@ static asection *get_got /* Given a ELF reloc, return the matching HOWTO structure. */ -static void +static bfd_boolean elf64_ia64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { - bfd_reloc->howto - = ia64_elf_lookup_howto ((unsigned int) ELF64_R_TYPE (elf_reloc->r_info)); + unsigned int r_type = ELF32_R_TYPE (elf_reloc->r_info); + + bfd_reloc->howto = ia64_elf_lookup_howto (r_type); + if (bfd_reloc->howto == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + return TRUE; } @@ -584,9 +595,9 @@ elf64_ia64_relax_section (bfd *abfd, asection *sec, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Can't relax br at %#Lx in section `%A'." - " Please use brl or indirect branch."), - sec->owner, roff, sec); + (_("%pB: can't relax br at %#" PRIx64 " in section `%pA';" + " please use brl or indirect branch"), + sec->owner, (uint64_t) roff, sec); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -3278,8 +3289,8 @@ elf64_ia64_choose_gp (bfd *abfd, struct bfd_link_info *info, bfd_boolean final) overflow: _bfd_error_handler /* xgettext:c-format */ - (_("%B: short data segment overflowed (%#Lx >= 0x400000)"), - abfd, max_short_vma - min_short_vma); + (_("%pB: short data segment overflowed (%#" PRIx64 " >= 0x400000)"), + abfd, (uint64_t) (max_short_vma - min_short_vma)); return FALSE; } else if ((gp_val > min_short_vma @@ -3288,7 +3299,7 @@ overflow: && max_short_vma - gp_val >= 0x200000)) { _bfd_error_handler - (_("%B: __gp does not cover short data segment"), abfd); + (_("%pB: __gp does not cover short data segment"), abfd); return FALSE; } } @@ -3425,16 +3436,20 @@ elf64_ia64_relocate_section (bfd *output_bfd, r_type = ELF64_R_TYPE (rel->r_info); if (r_type > R_IA64_MAX_RELOC_CODE) { - _bfd_error_handler - /* xgettext:c-format */ - (_("%B: unknown relocation type %d"), - input_bfd, (int) r_type); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); ret_val = FALSE; continue; } howto = ia64_elf_lookup_howto (r_type); + if (howto == NULL) + { + ret_val = FALSE; + continue; + } r_symndx = ELF64_R_SYM (rel->r_info); h = NULL; sym = NULL; @@ -3554,7 +3569,7 @@ elf64_ia64_relocate_section (bfd *output_bfd, shared libraries nor dynamic executables. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: non-pic code with imm relocation against" + (_("%pB: non-pic code with imm relocation against" " dynamic symbol `%s'"), input_bfd, h ? h->root.root.string @@ -3618,7 +3633,7 @@ elf64_ia64_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: @gprel relocation against dynamic symbol %s"), + (_("%pB: @gprel relocation against dynamic symbol %s"), input_bfd, h ? h->root.root.string : bfd_elf_sym_name (input_bfd, symtab_hdr, sym, @@ -3677,7 +3692,7 @@ elf64_ia64_relocate_section (bfd *output_bfd, /* ??? People shouldn't be doing non-pic code in shared libraries. Hork. */ _bfd_error_handler - (_("%B: linking non-pic code in a position independent executable"), + (_("%pB: linking non-pic code in a position independent executable"), input_bfd); ret_val = FALSE; continue; @@ -3779,13 +3794,13 @@ elf64_ia64_relocate_section (bfd *output_bfd, if (r_type == R_IA64_PCREL21BI) /* xgettext:c-format */ - msg = _("%B: @internal branch to dynamic symbol %s"); + msg = _("%pB: @internal branch to dynamic symbol %s"); else if (r_type == R_IA64_PCREL21F || r_type == R_IA64_PCREL21M) /* xgettext:c-format */ - msg = _("%B: speculation fixup to dynamic symbol %s"); + msg = _("%pB: speculation fixup to dynamic symbol %s"); else /* xgettext:c-format */ - msg = _("%B: @pcrel relocation against dynamic symbol %s"); + msg = _("%pB: @pcrel relocation against dynamic symbol %s"); _bfd_error_handler (msg, input_bfd, h ? h->root.root.string : bfd_elf_sym_name (input_bfd, @@ -3946,10 +3961,10 @@ elf64_ia64_relocate_section (bfd *output_bfd, case R_IA64_LTOFF_DTPREL22: _bfd_error_handler /* xgettext:c-format */ - (_("%B: missing TLS section for relocation %s against `%s'" - " at %#Lx in section `%A'."), + (_("%pB: missing TLS section for relocation %s against `%s'" + " at %#" PRIx64 " in section `%pA'."), input_bfd, howto->name, name, - rel->r_offset, input_section); + (uint64_t) rel->r_offset, input_section); break; case R_IA64_PCREL21B: @@ -3963,10 +3978,11 @@ elf64_ia64_relocate_section (bfd *output_bfd, that the section is too big to relax. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: Can't relax br (%s) to `%s' at %#Lx in section" - " `%A' with size %#Lx (> 0x1000000)."), - input_bfd, howto->name, name, rel->r_offset, - input_section, input_section->size); + (_("%pB: Can't relax br (%s) to `%s' " + "at %#" PRIx64 " in section `%pA' " + "with size %#" PRIx64 " (> 0x1000000)."), + input_bfd, howto->name, name, (uint64_t) rel->r_offset, + input_section, (uint64_t) input_section->size); break; } /* Fall through. */ @@ -4254,7 +4270,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL)) { _bfd_error_handler - (_("%B: linking trap-on-NULL-dereference with non-trapping files"), + (_("%pB: linking trap-on-NULL-dereference with non-trapping files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -4263,7 +4279,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE)) { _bfd_error_handler - (_("%B: linking big-endian files with little-endian files"), + (_("%pB: linking big-endian files with little-endian files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -4272,7 +4288,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64)) { _bfd_error_handler - (_("%B: linking 64-bit files with 32-bit files"), + (_("%pB: linking 64-bit files with 32-bit files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -4281,7 +4297,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP)) { _bfd_error_handler - (_("%B: linking constant-gp files with non-constant-gp files"), + (_("%pB: linking constant-gp files with non-constant-gp files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -4291,7 +4307,7 @@ elf64_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) != (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP)) { _bfd_error_handler - (_("%B: linking auto-pic files with non-auto-pic files"), + (_("%pB: linking auto-pic files with non-auto-pic files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -5134,15 +5150,15 @@ error_free_dyn: if (normal_bfd == NULL) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: alignment %u of common symbol `%s' in %B" - " is greater than the alignment (%u) of its section %A"), + (_("warning: alignment %u of common symbol `%s' in %pB" + " is greater than the alignment (%u) of its section %pA"), 1 << common_align, name, common_bfd, 1 << normal_align, h->root.u.def.section); else _bfd_error_handler /* xgettext:c-format */ - (_("Warning: alignment %u of symbol `%s' in %B" - " is smaller than %u in %B"), + (_("warning: alignment %u of symbol `%s' in %pB" + " is smaller than %u in %pB"), 1 << normal_align, name, normal_bfd, 1 << common_align, common_bfd); } @@ -5157,9 +5173,10 @@ error_free_dyn: && ! size_change_ok) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: size of symbol `%s' changed" - " from %Lu in %B to %Lu in %B"), - name, h->size, old_bfd, isym->st_size, abfd); + (_("warning: size of symbol `%s' changed" + " from %" PRIu64 " in %pB to %" PRIu64 " in %pB"), + name, (uint64_t) h->size, old_bfd, + (uint64_t) isym->st_size, abfd); h->size = isym->st_size; } @@ -5183,8 +5200,8 @@ error_free_dyn: if (h->type != STT_NOTYPE && ! type_change_ok) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: type of symbol `%s' changed" - " from %d to %d in %B"), + (_("warning: type of symbol `%s' changed" + " from %d to %d in %pB"), name, h->type, type, abfd); h->type = type; @@ -5481,7 +5498,7 @@ static const struct elf_size_info elf64_ia64_vms_size_info = { #define elf_backend_size_dynamic_sections \ elf64_ia64_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + _bfd_elf_omit_section_dynsym_all #define elf_backend_relocate_section \ elf64_ia64_relocate_section #define elf_backend_finish_dynamic_symbol \ diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c index 8218625..ea2e921 100644 --- a/bfd/elf64-mips.c +++ b/bfd/elf64-mips.c @@ -80,11 +80,7 @@ static void mips_elf64_be_swap_reloca_out (bfd *, const Elf_Internal_Rela *, bfd_byte *); static reloc_howto_type *bfd_elf64_bfd_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static reloc_howto_type *mips_elf64_rtype_to_howto - (unsigned int, bfd_boolean); -static void mips_elf64_info_to_howto_rel - (bfd *, arelent *, Elf_Internal_Rela *); -static void mips_elf64_info_to_howto_rela +static bfd_boolean mips_elf64_info_to_howto_rela (bfd *, arelent *, Elf_Internal_Rela *); static long mips_elf64_get_dynamic_reloc_upper_bound (bfd *); @@ -3574,7 +3570,7 @@ bfd_elf64_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * -mips_elf64_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p) +mips_elf64_rtype_to_howto (bfd *abfd, unsigned int r_type, bfd_boolean rela_p) { switch (r_type) { @@ -3612,7 +3608,8 @@ mips_elf64_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p) } if (r_type >= R_MIPS_max) { - _bfd_error_handler (_("unrecognised MIPS reloc number: %d"), r_type); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); bfd_set_error (bfd_error_bad_value); r_type = R_MIPS_NONE; } @@ -3626,20 +3623,17 @@ mips_elf64_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p) /* Prevent relocation handling by bfd for MIPS ELF64. */ -static void -mips_elf64_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, - arelent *cache_ptr ATTRIBUTE_UNUSED, - Elf_Internal_Rela *dst ATTRIBUTE_UNUSED) -{ - BFD_ASSERT (0); -} - -static void -mips_elf64_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +mips_elf64_info_to_howto_rela (bfd *abfd, arelent *cache_ptr ATTRIBUTE_UNUSED, - Elf_Internal_Rela *dst ATTRIBUTE_UNUSED) + Elf_Internal_Rela *dst) { - BFD_ASSERT (0); + unsigned int r_type = ELF32_R_TYPE (dst->r_info); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } /* Since each entry in an SHT_REL or SHT_RELA section can represent up @@ -3805,7 +3799,7 @@ mips_elf64_slurp_one_reloc_table (bfd *abfd, asection *asect, relent->addend = rela.r_addend; - relent->howto = mips_elf64_rtype_to_howto (type, rela_p); + relent->howto = mips_elf64_rtype_to_howto (abfd, type, rela_p); ++relent; } @@ -4379,7 +4373,7 @@ const struct elf_size_info mips_elf64_size_info = #define elf_backend_gc_mark_extra_sections \ _bfd_mips_elf_gc_mark_extra_sections #define elf_info_to_howto mips_elf64_info_to_howto_rela -#define elf_info_to_howto_rel mips_elf64_info_to_howto_rel +#define elf_info_to_howto_rel mips_elf64_info_to_howto_rela #define elf_backend_object_p mips_elf64_object_p #define elf_backend_symbol_processing _bfd_mips_elf_symbol_processing #define elf_backend_section_processing _bfd_mips_elf_section_processing diff --git a/bfd/elf64-mmix.c b/bfd/elf64-mmix.c index 16930c1..6f56b31 100644 --- a/bfd/elf64-mmix.c +++ b/bfd/elf64-mmix.c @@ -982,10 +982,10 @@ mmix_elf_perform_relocation (asection *isec, reloc_howto_type *howto, a verbose message. */ *error_message = _("invalid input relocation when producing" - " non-ELF, non-mmo format output." - "\n Please use the objcopy program to convert from" + " non-ELF, non-mmo format output;" + " please use the objcopy program to convert from" " ELF or mmo," - "\n or assemble using" + " or assemble using" " \"-no-expand\" (for gcc, \"-Wa,-no-expand\""); mmix_elf_section_data (isec)->has_warned_pushj = TRUE; return bfd_reloc_dangerous; @@ -1166,10 +1166,10 @@ mmix_elf_perform_relocation (asection *isec, reloc_howto_type *howto, a verbose message. */ *error_message = _("invalid input relocation when producing" - " non-ELF, non-mmo format output." - "\n Please use the objcopy program to convert from" + " non-ELF, non-mmo format output;" + " please use the objcopy program to convert from" " ELF or mmo," - "\n or compile using the gcc-option" + " or compile using the gcc-option" " \"-mno-base-addresses\"."); mmix_elf_section_data (isec)->has_warned_bpo = TRUE; return bfd_reloc_dangerous; @@ -1192,11 +1192,11 @@ mmix_elf_perform_relocation (asection *isec, reloc_howto_type *howto, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Internal inconsistency error for value for\n\ - linker-allocated global register: linked: %#Lx != relaxed: %#Lx"), + (_("%pB: Internal inconsistency error for value for\n\ + linker-allocated global register: linked: %#" PRIx64 " != relaxed: %#" PRIx64 ""), isec->owner, - value, - gregdata->reloc_request[bpo_index].value); + (uint64_t) value, + (uint64_t) gregdata->reloc_request[bpo_index].value); bfd_set_error (bfd_error_bad_value); return bfd_reloc_overflow; } @@ -1250,8 +1250,8 @@ mmix_elf_perform_relocation (asection *isec, reloc_howto_type *howto, /* Set the howto pointer for an MMIX ELF reloc (type RELA). */ -static void -mmix_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +mmix_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -1261,10 +1261,13 @@ mmix_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= (unsigned int) R_MMIX_max) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid MMIX reloc number: %d"), abfd, r_type); - r_type = 0; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_mmix_howto_table[r_type]; + return TRUE; } /* Any MMIX-specific relocation gets here at assembly time or when linking @@ -1613,14 +1616,14 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section, if (symname == NULL || *symname == 0) _bfd_error_handler /* xgettext:c-format */ - (_("%B: base-plus-offset relocation against register symbol:" - " (unknown) in %A"), + (_("%pB: base-plus-offset relocation against register symbol:" + " (unknown) in %pA"), input_section->owner, symsec); else _bfd_error_handler /* xgettext:c-format */ - (_("%B: base-plus-offset relocation against register symbol:" - " %s in %A"), + (_("%pB: base-plus-offset relocation against register symbol:" + " %s in %pA"), input_section->owner, symname, symsec); return bfd_reloc_overflow; } @@ -1664,14 +1667,14 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section, if (symname == NULL || *symname == 0) _bfd_error_handler /* xgettext:c-format */ - (_("%B: register relocation against non-register symbol:" - " (unknown) in %A"), + (_("%pB: register relocation against non-register symbol:" + " (unknown) in %pA"), input_section->owner, symsec); else _bfd_error_handler /* xgettext:c-format */ - (_("%B: register relocation against non-register symbol:" - " %s in %A"), + (_("%pB: register relocation against non-register symbol:" + " %s in %pA"), input_section->owner, symname, symsec); /* The bfd_reloc_outofrange return value, though intuitively a @@ -1707,7 +1710,7 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section, MMIX_REG_SECTION_NAME) != 0) { _bfd_error_handler - (_("%B: directive LOCAL valid only with a register or absolute value"), + (_("%pB: directive LOCAL valid only with a register or absolute value"), input_section->owner); return bfd_reloc_overflow; @@ -1738,9 +1741,10 @@ mmix_final_link_relocate (reloc_howto_type *howto, asection *input_section, /* FIXME: Better error message. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: LOCAL directive: Register $%Ld is not a local register." - " First global register is $%Ld."), - input_section->owner, srel, first_global); + (_("%pB: LOCAL directive: " + "register $%" PRId64 " is not a local register;" + " first global register is $%" PRId64), + input_section->owner, (int64_t) srel, (int64_t) first_global); return bfd_reloc_overflow; } @@ -2166,8 +2170,8 @@ mmix_elf_add_symbol_hook (bfd *abfd, h->u.def.section->owner is NULL. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: Error: multiple definition of `%s'; start of %s " - "is set in a earlier linked file\n"), + (_("%pB: error: multiple definition of `%s'; start of %s " + "is set in a earlier linked file"), abfd, *namep, *namep + strlen (MMIX_LOC_SECTION_START_SYMBOL_PREFIX)); bfd_set_error (bfd_error_bad_value); @@ -2221,7 +2225,7 @@ mmix_elf_final_link (bfd *abfd, struct bfd_link_info *info) { /* FIXME: Pass error state gracefully. */ if (bfd_get_section_flags (abfd, reg_section) & SEC_HAS_CONTENTS) - _bfd_abort (__FILE__, __LINE__, _("Register section has contents\n")); + _bfd_abort (__FILE__, __LINE__, _("register section has contents\n")); /* Really remove the section, if it hasn't already been done. */ if (!bfd_section_removed_from_list (abfd, reg_section)) @@ -2411,8 +2415,8 @@ _bfd_mmix_after_linker_allocation (bfd *abfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("Internal inconsistency: remaining %lu != max %lu.\n\ - Please report this bug."), + (_("internal inconsistency: remaining %lu != max %lu;" + " please report this bug"), (unsigned long) gregdata->n_remaining_bpo_relocs_this_relaxation_round, (unsigned long) gregdata->n_bpo_relocs); return FALSE; @@ -2901,8 +2905,7 @@ mmix_elf_relax_section (bfd *abfd, #define elf_backend_check_relocs mmix_elf_check_relocs #define elf_backend_symbol_processing mmix_elf_symbol_processing -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all #define bfd_elf64_bfd_copy_link_hash_symbol_type \ _bfd_generic_copy_link_hash_symbol_type diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 5cbb035..44237bc 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -161,10 +161,6 @@ static bfd_vma opd_entry_value #define LD_R11_0R11 0xe96b0000 /* ld %r11,xxx+16@l(%r11) */ #define BCTR 0x4e800420 /* bctr */ -#define CRSETEQ 0x4c421242 /* crset 4*%cr0+%eq */ -#define BEQCTRM 0x4dc20420 /* beqctr- */ -#define BEQCTRLM 0x4dc20421 /* beqctrl- */ - #define ADDI_R11_R11 0x396b0000 /* addi %r11,%r11,off@l */ #define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */ #define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */ @@ -193,8 +189,7 @@ static bfd_vma opd_entry_value /* __glink_PLTresolve stub instructions. We enter with the index in R0. */ #define GLINK_PLTRESOLVE_SIZE(htab) \ - (8u + (htab->opd_abi ? 11 * 4 : 14 * 4) \ - + (!htab->params->speculate_indirect_jumps ? 2 * 4 : 0)) + (8u + (htab->opd_abi ? 11 * 4 : 14 * 4)) /* 0: */ /* .quad plt0-1f */ /* __glink: */ @@ -275,7 +270,8 @@ set_abiversion (bfd *abfd, int ver) /* Relocation HOWTO's. */ static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC64_max]; -static reloc_howto_type ppc64_elf_howto_raw[] = { +static reloc_howto_type ppc64_elf_howto_raw[] = +{ /* This reloc does nothing. */ HOWTO (R_PPC64_NONE, /* type */ 0, /* rightshift */ @@ -2236,7 +2232,7 @@ ppc_howto_init (void) } static reloc_howto_type * -ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, +ppc64_elf_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { enum elf_ppc64_reloc_type r = R_PPC64_NONE; @@ -2248,6 +2244,9 @@ ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, switch (code) { default: + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, (int) code); + bfd_set_error (bfd_error_bad_value); return NULL; case BFD_RELOC_NONE: r = R_PPC64_NONE; @@ -2500,12 +2499,13 @@ ppc64_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, && strcasecmp (ppc64_elf_howto_raw[i].name, r_name) == 0) return &ppc64_elf_howto_raw[i]; + return NULL; } /* Set the howto pointer for a PowerPC ELF reloc. */ -static void +static bfd_boolean ppc64_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -2519,11 +2519,22 @@ ppc64_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, if (type >= ARRAY_SIZE (ppc64_elf_howto_table)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), - abfd, (int) type); - type = R_PPC64_NONE; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = ppc64_elf_howto_table[type]; + if (cache_ptr->howto == NULL || cache_ptr->howto->name == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + return TRUE; } /* Handle the R_PPC64_ADDR16_HA and similar relocs. */ @@ -4652,8 +4663,8 @@ ppc_add_stub (const char *stub_name, if (stub_entry == NULL) { /* xgettext:c-format */ - info->callbacks->einfo (_("%P: %B: cannot create stub entry %s\n"), - section->owner, stub_name); + _bfd_error_handler (_("%pB: cannot create stub entry %s"), + section->owner, stub_name); return NULL; } @@ -4983,8 +4994,8 @@ ppc64_elf_add_symbol_hook (bfd *ibfd, set_abiversion (ibfd, 2); else if (abiversion (ibfd) == 1) { - info->callbacks->einfo (_("%P: symbol '%s' has invalid st_other" - " for ABI version 1\n"), name); + _bfd_error_handler (_("symbol '%s' has invalid st_other" + " for ABI version 1"), *name); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -5051,7 +5062,7 @@ ppc64_elf_archive_symbol_lookup (bfd *abfd, len = strlen (name); dot_name = bfd_alloc (abfd, len + 2); if (dot_name == NULL) - return (struct elf_link_hash_entry *) 0 - 1; + return (struct elf_link_hash_entry *) -1; dot_name[0] = '.'; memcpy (dot_name + 1, name, len + 1); h = _bfd_elf_archive_symbol_lookup (abfd, info, dot_name); @@ -5158,9 +5169,8 @@ ppc64_elf_before_check_relocs (bfd *ibfd, struct bfd_link_info *info) else if (abiversion (ibfd) >= 2) { /* xgettext:c-format */ - info->callbacks->einfo (_("%P: %B .opd not allowed in ABI" - " version %d\n"), - ibfd, abiversion (ibfd)); + _bfd_error_handler (_("%pB .opd not allowed in ABI version %d"), + ibfd, abiversion (ibfd)); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -5658,7 +5668,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, ppc_howto_init (); /* xgettext:c-format */ info->callbacks->einfo (_("%H: %s reloc unsupported " - "in shared libraries and PIEs.\n"), + "in shared libraries and PIEs\n"), abfd, sec, rel->r_offset, ppc64_elf_howto_table[r_type]->name); bfd_set_error (bfd_error_bad_value); @@ -6047,7 +6057,7 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B uses unknown e_flags 0x%lx"), ibfd, iflags); + (_("%pB uses unknown e_flags 0x%lx"), ibfd, iflags); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -6055,7 +6065,7 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: ABI version %ld is not compatible with ABI version %ld output"), + (_("%pB: ABI version %ld is not compatible with ABI version %ld output"), ibfd, iflags, oflags); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -7267,7 +7277,7 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, sections. Allow them to proceed, but warn that this might break at runtime. */ info->callbacks->einfo - (_("%P: copy reloc against `%T' requires lazy plt linking; " + (_("%P: copy reloc against `%pT' requires lazy plt linking; " "avoid setting LD_BIND_NOW=1 or upgrade gcc\n"), h->root.root.string); } @@ -7534,7 +7544,7 @@ tocsave_find (struct ppc_link_hash_table *htab, if (ent.sec == NULL || ent.sec->output_section == NULL) { _bfd_error_handler - (_("%B: undefined symbol on R_PPC64_TOCSAVE relocation"), ibfd); + (_("%pB: undefined symbol on R_PPC64_TOCSAVE relocation"), ibfd); return NULL; } @@ -7761,8 +7771,8 @@ dec_dynrel_count (bfd_vma r_info, } /* xgettext:c-format */ - info->callbacks->einfo (_("%P: dynreloc miscount for %B, section %A\n"), - sec->owner, sec); + _bfd_error_handler (_("dynreloc miscount for %pB, section %pA"), + sec->owner, sec); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -7850,7 +7860,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) optimization for them! */ broken_opd: _bfd_error_handler - (_("%B: .opd is not a regular array of opd entries"), ibfd); + (_("%pB: .opd is not a regular array of opd entries"), ibfd); broken = TRUE; break; } @@ -7860,7 +7870,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unexpected reloc type %u in .opd section"), + (_("%pB: unexpected reloc type %u in .opd section"), ibfd, r_type); broken = TRUE; break; @@ -7882,7 +7892,7 @@ ppc64_elf_edit_opd (struct bfd_link_info *info) _bfd_error_handler /* xgettext:c-format */ - (_("%B: undefined sym `%s' in .opd section"), + (_("%pB: undefined sym `%s' in .opd section"), ibfd, sym_name); broken = TRUE; break; @@ -8218,9 +8228,9 @@ ppc64_elf_tls_setup (struct bfd_link_info *info) if (htab->params->plt_localentry0 && elf_link_hash_lookup (&htab->elf, "GLIBC_2.26", FALSE, FALSE, FALSE) == NULL) - info->callbacks->einfo - (_("%P: warning: --plt-localentry is especially dangerous without " - "ld.so support to detect ABI violations.\n")); + _bfd_error_handler + (_("warning: --plt-localentry is especially dangerous without " + "ld.so support to detect ABI violations")); htab->tls_get_addr = ((struct ppc_link_hash_entry *) elf_link_hash_lookup (&htab->elf, ".__tls_get_addr", @@ -9178,7 +9188,7 @@ ppc64_elf_edit_toc (struct bfd_link_info *info) info->callbacks->einfo /* xgettext:c-format */ (_("%H: toc optimization is not supported for" - " %s instruction.\n"), + " %s instruction\n"), ibfd, sec, rel->r_offset & ~3, str); } } @@ -9886,8 +9896,6 @@ size_global_entry_stubs (struct elf_link_hash_entry *h, void *inf) unsigned int align_power; stub_size = 16; - if (!htab->params->speculate_indirect_jumps) - stub_size += 8; stub_off = s->size; if (htab->params->plt_stub_align >= 0) align_power = htab->params->plt_stub_align; @@ -9940,7 +9948,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *inf) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -10453,8 +10461,6 @@ plt_stub_size (struct ppc_link_hash_table *htab, size += 4; if (PPC_HA (off) != 0) size += 4; - if (!htab->params->speculate_indirect_jumps) - size += 8; if (htab->opd_abi) { size += 4; @@ -10476,11 +10482,7 @@ plt_stub_size (struct ppc_link_hash_table *htab, size += 7 * 4; if (ALWAYS_EMIT_R2SAVE || stub_entry->stub_type == ppc_stub_plt_call_r2save) - { - size += 6 * 4; - if (!htab->params->speculate_indirect_jumps) - size -= 4; - } + size += 6 * 4; } return size; } @@ -10515,26 +10517,6 @@ plt_stub_pad (struct ppc_link_hash_table *htab, return 0; } -static inline bfd_byte * -output_bctr (struct ppc_link_hash_table *htab, bfd *obfd, bfd_byte *p) -{ - if (!htab->params->speculate_indirect_jumps) - { - bfd_put_32 (obfd, CRSETEQ, p); - p += 4; - bfd_put_32 (obfd, BEQCTRM, p); - p += 4; - bfd_put_32 (obfd, B_DOT, p); - p += 4; - } - else - { - bfd_put_32 (obfd, BCTR, p); - p += 4; - } - return p; -} - /* Build a .plt call stub. */ static inline bfd_byte * @@ -10555,7 +10537,6 @@ build_plt_stub (struct ppc_link_hash_table *htab, if (!ALWAYS_USE_FAKE_DEP && plt_load_toc && plt_thread_safe - && htab->params->speculate_indirect_jumps && !((stub_entry->h == htab->tls_get_addr_fd || stub_entry->h == htab->tls_get_addr) && htab->params->tls_get_addr_opt)) @@ -10710,7 +10691,7 @@ build_plt_stub (struct ppc_link_hash_table *htab, bfd_put_32 (obfd, B_DOT | (cmp_branch_off & 0x3fffffc), p), p += 4; } else - p = output_bctr (htab, obfd, p); + bfd_put_32 (obfd, BCTR, p), p += 4; return p; } @@ -10754,13 +10735,7 @@ build_tls_get_addr_stub (struct ppc_link_hash_table *htab, if (r != NULL) r[0].r_offset += 2 * 4; p = build_plt_stub (htab, stub_entry, p, offset, r); - if (!htab->params->speculate_indirect_jumps) - { - p -= 4; - bfd_put_32 (obfd, BEQCTRLM, p - 4); - } - else - bfd_put_32 (obfd, BCTRL, p - 4); + bfd_put_32 (obfd, BCTRL, p - 4); bfd_put_32 (obfd, LD_R2_0R1 + STK_TOC (htab), p), p += 4; bfd_put_32 (obfd, LD_R11_0R1 + STK_LINKER (htab), p), p += 4; @@ -10820,7 +10795,7 @@ get_r2off (struct bfd_link_info *info, if (strcmp (opd->name, ".opd") != 0 || opd->reloc_count != 0) { - info->callbacks->einfo (_("%P: cannot find opd entry toc for `%T'\n"), + info->callbacks->einfo (_("%P: cannot find opd entry toc for `%pT'\n"), stub_entry->h->elf.root.root.string); bfd_set_error (bfd_error_bad_value); return (bfd_vma) -1; @@ -10907,8 +10882,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) if (off + (1 << 25) >= (bfd_vma) (1 << 26)) { - info->callbacks->einfo - (_("%P: long branch stub `%s' offset overflow\n"), + _bfd_error_handler + (_("long branch stub `%s' offset overflow"), stub_entry->root.string); htab->stub_error = TRUE; return FALSE; @@ -10967,8 +10942,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) FALSE, FALSE); if (br_entry == NULL) { - info->callbacks->einfo (_("%P: can't find branch stub `%s'\n"), - stub_entry->root.string); + _bfd_error_handler (_("can't find branch stub `%s'"), + stub_entry->root.string); htab->stub_error = TRUE; return FALSE; } @@ -11031,7 +11006,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) { info->callbacks->einfo - (_("%P: linkage table error against `%T'\n"), + (_("%P: linkage table error against `%pT'\n"), stub_entry->root.string); bfd_set_error (bfd_error_bad_value); htab->stub_error = TRUE; @@ -11113,7 +11088,8 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) p += 4; bfd_put_32 (htab->params->stub_bfd, MTCTR_R12, p); p += 4; - p = output_bctr (htab, htab->params->stub_bfd, p); + bfd_put_32 (htab->params->stub_bfd, BCTR, p); + p += 4; break; case ppc_stub_plt_call: @@ -11176,7 +11152,7 @@ ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { info->callbacks->einfo /* xgettext:c-format */ - (_("%P: linkage table error against `%T'\n"), + (_("%P: linkage table error against `%pT'\n"), stub_entry->h != NULL ? stub_entry->h->elf.root.root.string : ""); @@ -11394,8 +11370,8 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) TRUE, FALSE); if (br_entry == NULL) { - info->callbacks->einfo (_("%P: can't build branch stub `%s'\n"), - stub_entry->root.string); + _bfd_error_handler (_("can't build branch stub `%s'"), + stub_entry->root.string); htab->stub_error = TRUE; return FALSE; } @@ -11446,8 +11422,6 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) if (PPC_LO (r2off) != 0) size += 4; } - if (!htab->params->speculate_indirect_jumps) - size += 8; } else if (info->emitrelocations) { @@ -12169,7 +12143,7 @@ group_sections (struct bfd_link_info *info, big_sec = total > group_size; if (big_sec && !suppress_size_errors) /* xgettext:c-format */ - _bfd_error_handler (_("%B section %A exceeds stub group size"), + _bfd_error_handler (_("%pB section %pA exceeds stub group size"), tail->owner, tail); curr_toc = htab->sec_info[tail->id].toc_off; @@ -13047,7 +13021,7 @@ build_global_entry_stubs (struct elf_link_hash_entry *h, void *inf) if (off + 0x80008000 > 0xffffffff || (off & 3) != 0) { info->callbacks->einfo - (_("%P: linkage table error against `%T'\n"), + (_("%P: linkage table error against `%pT'\n"), h->root.root.string); bfd_set_error (bfd_error_bad_value); htab->stub_error = TRUE; @@ -13089,7 +13063,7 @@ build_global_entry_stubs (struct elf_link_hash_entry *h, void *inf) p += 4; bfd_put_32 (s->owner, MTCTR_R12, p); p += 4; - output_bctr (htab, s->owner, p); + bfd_put_32 (s->owner, BCTR, p); break; } return TRUE; @@ -13218,7 +13192,8 @@ ppc64_elf_build_stubs (struct bfd_link_info *info, bfd_put_32 (htab->glink->owner, LD_R11_0R11 | 8, p); p += 4; } - p = output_bctr (htab, htab->glink->owner, p); + bfd_put_32 (htab->glink->owner, BCTR, p); + p += 4; BFD_ASSERT (p == htab->glink->contents + GLINK_PLTRESOLVE_SIZE (htab)); /* Build the .glink lazy link call stubs. */ @@ -13311,7 +13286,7 @@ ppc64_elf_build_stubs (struct bfd_link_info *info, if (group != NULL) { htab->stub_error = TRUE; - info->callbacks->einfo (_("%P: stubs don't match calculated size\n")); + _bfd_error_handler (_("stubs don't match calculated size")); } if (htab->stub_error) @@ -13648,9 +13623,9 @@ ppc64_elf_relocate_section (bfd *output_bfd, info->callbacks->einfo (!IS_PPC64_TLS_RELOC (r_type) /* xgettext:c-format */ - ? _("%H: %s used with TLS symbol `%T'\n") + ? _("%H: %s used with TLS symbol `%pT'\n") /* xgettext:c-format */ - : _("%H: %s used with non-TLS symbol `%T'\n"), + : _("%H: %s used with non-TLS symbol `%pT'\n"), input_bfd, input_section, rel->r_offset, ppc64_elf_howto_table[r_type]->name, sym_name); @@ -14260,13 +14235,13 @@ ppc64_elf_relocate_section (bfd *output_bfd, || stub_entry->stub_type == ppc_stub_plt_call_r2save) info->callbacks->einfo /* xgettext:c-format */ - (_("%H: call to `%T' lacks nop, can't restore toc; " + (_("%H: call to `%pT' lacks nop, can't restore toc; " "recompile with -fPIC\n"), input_bfd, input_section, rel->r_offset, sym_name); else info->callbacks->einfo /* xgettext:c-format */ - (_("%H: call to `%T' lacks nop, can't restore toc; " + (_("%H: call to `%pT' lacks nop, can't restore toc; " "(-mcmodel=small toc adjust stub)\n"), input_bfd, input_section, rel->r_offset, sym_name); @@ -14392,10 +14367,9 @@ ppc64_elf_relocate_section (bfd *output_bfd, switch (r_type) { default: - info->callbacks->einfo - /* xgettext:c-format */ - (_("%P: %B: unknown relocation type %d for `%T'\n"), - input_bfd, (int) r_type, sym_name); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: %s unsupported"), + input_bfd, ppc64_elf_howto_table[r_type]->name); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -14944,7 +14918,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, info->callbacks->einfo /* xgettext:c-format */ (_("%H: %s for indirect " - "function `%T' unsupported\n"), + "function `%pT' unsupported\n"), input_bfd, input_section, rel->r_offset, ppc64_elf_howto_table[r_type]->name, sym_name); @@ -15055,7 +15029,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, info->callbacks->einfo /* xgettext:c-format */ - (_("%P: %B: %s is not supported for `%T'\n"), + (_("%P: %pB: %s is not supported for `%pT'\n"), input_bfd, ppc64_elf_howto_table[r_type]->name, sym_name); @@ -15067,7 +15041,6 @@ ppc64_elf_relocate_section (bfd *output_bfd, /* Multi-instruction sequences that access the TOC can be optimized, eg. addis ra,r2,0; addi rb,ra,x; to nop; addi rb,r2,x; */ - howto = ppc64_elf_howto_table[(int) r_type]; switch (r_type) { default: @@ -15099,6 +15072,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, { bfd_byte *p = contents + (rel->r_offset & ~3); bfd_put_32 (input_bfd, NOP, p); + goto copy_reloc; } break; @@ -15140,9 +15114,13 @@ ppc64_elf_relocate_section (bfd *output_bfd, /* xgettext:c-format */ info->callbacks->minfo (_("%H: warning: %s unexpected insn %#x.\n"), - input_bfd, input_section, rel->r_offset, howto->name, insn); + input_bfd, input_section, rel->r_offset, + ppc64_elf_howto_table[r_type]->name, insn); else - bfd_put_32 (input_bfd, NOP, p); + { + bfd_put_32 (input_bfd, NOP, p); + goto copy_reloc; + } } break; @@ -15240,7 +15218,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, /* xgettext:c-format */ (_("%H: error: %s not a multiple of %u\n"), input_bfd, input_section, rel->r_offset, - howto->name, + ppc64_elf_howto_table[r_type]->name, mask + 1); bfd_set_error (bfd_error_bad_value); ret = FALSE; @@ -15252,6 +15230,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, /* Dynamic relocs are not propagated for SEC_DEBUGGING sections because such sections are not SEC_ALLOC and thus ld.so will not process them. */ + howto = ppc64_elf_howto_table[(int) r_type]; if (unresolved_reloc && !((input_section->flags & SEC_DEBUGGING) != 0 && h->elf.def_dynamic) @@ -15260,7 +15239,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, { info->callbacks->einfo /* xgettext:c-format */ - (_("%H: unresolvable %s against `%T'\n"), + (_("%H: unresolvable %s against `%pT'\n"), input_bfd, input_section, rel->r_offset, howto->name, h->elf.root.root.string); @@ -15357,7 +15336,7 @@ ppc64_elf_relocate_section (bfd *output_bfd, { info->callbacks->einfo /* xgettext:c-format */ - (_("%H: %s against `%T': error %d\n"), + (_("%H: %s against `%pT': error %d\n"), input_bfd, input_section, rel->r_offset, reloc_name, sym_name, (int) r); ret = FALSE; @@ -15746,8 +15725,8 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, + (p + 8 - htab->glink_eh_frame->contents)); if (val + 0x80000000 > 0xffffffff) { - info->callbacks->einfo - (_("%P: %s offset too large for .eh_frame sdata4 encoding"), + _bfd_error_handler + (_("%s offset too large for .eh_frame sdata4 encoding"), group->stub_sec->name); return FALSE; } @@ -15765,8 +15744,8 @@ ppc64_elf_finish_dynamic_sections (bfd *output_bfd, + (p + 8 - htab->glink_eh_frame->contents)); if (val + 0x80000000 > 0xffffffff) { - info->callbacks->einfo - (_("%P: %s offset too large for .eh_frame sdata4 encoding"), + _bfd_error_handler + (_("%s offset too large for .eh_frame sdata4 encoding"), htab->glink->name); return FALSE; } diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index b3d4d59..8fa0140 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -51,9 +51,6 @@ struct ppc64_elf_params /* Set if PLT call stubs for localentry:0 functions should omit r2 save. */ int plt_localentry0; - /* Clear if PLT call stubs should use a speculative execution barrier. */ - int speculate_indirect_jumps; - /* Whether to canonicalize .opd so that there are no overlapping .opd entries. */ int non_overlapping_opd; diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 7549971..9eca035 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -189,7 +189,7 @@ static reloc_howto_type elf64_s390_vtentry_howto = HOWTO (R_390_GNU_VTENTRY, 0,4,0,FALSE,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", FALSE,0,0, FALSE); static reloc_howto_type * -elf_s390_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, +elf_s390_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { switch (code) @@ -323,7 +323,11 @@ elf_s390_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, default: break; } - return 0; + + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, (int) code); + bfd_set_error (bfd_error_bad_value); + return NULL; } static reloc_howto_type * @@ -350,12 +354,13 @@ elf_s390_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* We need to use ELF64_R_TYPE so we have our own copy of this function, and elf64-s390.c has its own copy. */ -static void +static bfd_boolean elf_s390_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = ELF64_R_TYPE(dst->r_info); + switch (r_type) { case R_390_GNU_VTINHERIT: @@ -370,12 +375,14 @@ elf_s390_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, if (r_type >= sizeof (elf_howto_table) / sizeof (elf_howto_table[0])) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), - abfd, (int) r_type); - r_type = R_390_NONE; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; } cache_ptr->howto = &elf_howto_table[r_type]; } + return TRUE; } /* A relocation function which doesn't do anything. */ @@ -872,7 +879,7 @@ elf_s390_check_relocs (bfd *abfd, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -1110,7 +1117,7 @@ elf_s390_check_relocs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h->root.root.string); return FALSE; } @@ -1782,7 +1789,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2072,10 +2079,10 @@ invalid_tls_insn (bfd *input_bfd, howto = elf_howto_table + ELF64_R_TYPE (rel->r_info); _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): invalid instruction for TLS relocation %s"), + (_("%pB(%pA+%#" PRIx64 "): invalid instruction for TLS relocation %s"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name); bfd_set_error (bfd_error_bad_value); } @@ -2530,7 +2537,7 @@ elf_s390_relocate_section (bfd *output_bfd, && bfd_link_pie (info) && !h->def_regular) { - _bfd_error_handler (_("%B: `%s' non-PLT reloc for symbol defined " + _bfd_error_handler (_("%pB: `%s' non-PLT reloc for symbol defined " "in shared library and accessed " "from executable " "(rebuild file with -fPIC ?)"), @@ -3115,10 +3122,11 @@ elf_s390_relocate_section (bfd *output_bfd, rel->r_offset) != (bfd_vma) -1) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); @@ -3172,9 +3180,9 @@ elf_s390_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): reloc against `%s': error %d"), + (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"), input_bfd, input_section, - rel->r_offset, name, (int) r); + (uint64_t) rel->r_offset, name, (int) r); return FALSE; } } diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 8a41764..b771759 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -1400,7 +1400,7 @@ sh_elf64_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, See sh_elf_info_to_howto in elf32-sh.c for the original. */ -static void +static bfd_boolean sh_elf64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) { @@ -1408,13 +1408,21 @@ sh_elf64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, r = ELF64_R_TYPE (dst->r_info); - BFD_ASSERT (r <= (unsigned int) R_SH_64_PCREL); + if (r > (unsigned int) R_SH_64_PCREL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC || r > R_SH_LAST_INVALID_RELOC); BFD_ASSERT (r < R_SH_DIR8WPN || r > R_SH_LAST_INVALID_RELOC_2); BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_3 || r > R_SH_GOTPLT32); BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_4 || r > R_SH_LAST_INVALID_RELOC_4); cache_ptr->howto = &sh_elf64_howto_table[r]; + return cache_ptr->howto != NULL; } /* Relocate an SH ELF section. @@ -1505,7 +1513,7 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, if ((sym->st_other & STO_SH5_ISA32) != 0) (*info->callbacks->reloc_dangerous) (info, - _("Unexpected STO_SH5_ISA32 on local symbol is not handled"), + _("unexpected STO_SH5_ISA32 on local symbol is not handled"), input_bfd, input_section, rel->r_offset); if (sec != NULL && discarded_section (sec)) @@ -1536,9 +1544,10 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): %s relocation against SEC_MERGE section"), + (_("%pB(%pA+%#" PRIx64 "): " + "%s relocation against SEC_MERGE section"), input_bfd, input_section, - rel->r_offset, howto->name); + (uint64_t) rel->r_offset, howto->name); return FALSE; } @@ -1633,10 +1642,11 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); } @@ -1677,9 +1687,10 @@ sh_elf64_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: error: unaligned relocation type %d at %08Lx reloc %08Lx"), - input_bfd, (int) r_type, rel->r_offset, - relocation); + (_("%pB: error: unaligned relocation type %d at " + "%08" PRIx64 " reloc %08" PRIx64 ""), + input_bfd, (int) r_type, + (uint64_t) rel->r_offset, (uint64_t) relocation); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2274,14 +2285,14 @@ sh_elf64_merge_private_data (bfd *ibfd, struct bfd_link_info *info) if (bfd_get_arch_size (ibfd) == 32 && bfd_get_arch_size (obfd) == 64) /* xgettext:c-format */ - msg = _("%B: compiled as 32-bit object and %B is 64-bit"); + msg = _("%pB: compiled as 32-bit object and %pB is 64-bit"); else if (bfd_get_arch_size (ibfd) == 64 && bfd_get_arch_size (obfd) == 32) /* xgettext:c-format */ - msg = _("%B: compiled as 64-bit object and %B is 32-bit"); + msg = _("%pB: compiled as 64-bit object and %pB is 32-bit"); else /* xgettext:c-format */ - msg = _("%B: object size does not match that of target %B"); + msg = _("%pB: object size does not match that of target %pB"); _bfd_error_handler (msg, ibfd, obfd); bfd_set_error (bfd_error_wrong_format); @@ -2302,7 +2313,7 @@ sh_elf64_merge_private_data (bfd *ibfd, struct bfd_link_info *info) else if ((new_flags & EF_SH_MACH_MASK) != EF_SH5) { _bfd_error_handler - ("%B: does not use the SH64 64-bit ABI as previous modules do", ibfd); + ("%pB: does not use the SH64 64-bit ABI as previous modules do", ibfd); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2769,7 +2780,7 @@ sh64_elf64_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, { /* Make sure we don't get confused on invalid input. */ _bfd_error_handler - (_("%B: encountered datalabel symbol in input"), abfd); + (_("%pB: encountered datalabel symbol in input"), abfd); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3926,8 +3937,7 @@ static const struct bfd_elf_special_section sh64_elf64_special_sections[]= sh64_elf64_adjust_dynamic_symbol #define elf_backend_size_dynamic_sections \ sh64_elf64_size_dynamic_sections -#define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_all #define elf_backend_finish_dynamic_symbol \ sh64_elf64_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections \ diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 089636f..b4c0475 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -122,15 +122,19 @@ elf64_sparc_slurp_one_reloc_table (bfd *abfd, asection *asect, r_type = ELF64_R_TYPE_ID (rela.r_info); if (r_type == R_SPARC_OLO10) { - relent->howto = _bfd_sparc_elf_info_to_howto_ptr (R_SPARC_LO10); + relent->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, R_SPARC_LO10); relent[1].address = relent->address; relent++; relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; relent->addend = ELF64_R_TYPE_DATA (rela.r_info); - relent->howto = _bfd_sparc_elf_info_to_howto_ptr (R_SPARC_13); + relent->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, R_SPARC_13); } else - relent->howto = _bfd_sparc_elf_info_to_howto_ptr (r_type); + { + relent->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, r_type); + if (relent->howto == NULL) + goto error_return; + } } canon_reloc_count (asect) += relent - relents; @@ -457,7 +461,7 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, case 6: reg -= 4; break; default: _bfd_error_handler - (_("%B: Only registers %%g[2367] can be declared using STT_REGISTER"), + (_("%pB: only registers %%g[2367] can be declared using STT_REGISTER"), abfd); return FALSE; } @@ -478,8 +482,8 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("Register %%g%d used incompatibly: %s in %B," - " previously %s in %B"), + (_("register %%g%d used incompatibly: %s in %pB," + " previously %s in %pB"), (int) sym->st_value, **namep ? *namep : "#scratch", abfd, *p->name ? p->name : "#scratch", p->abfd); return FALSE; @@ -502,8 +506,8 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, type = 0; _bfd_error_handler /* xgettext:c-format */ - (_("Symbol `%s' has differing types: REGISTER in %B," - " previously %s in %B"), + (_("symbol `%s' has differing types: REGISTER in %pB," + " previously %s in %pB"), *namep, abfd, stt_types[type], p->abfd); return FALSE; } @@ -549,8 +553,8 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, type = 0; _bfd_error_handler /* xgettext:c-format */ - (_("Symbol `%s' has differing types: %s in %B," - " previously REGISTER in %B"), + (_("Symbol `%s' has differing types: %s in %pB," + " previously REGISTER in %pB"), *namep, stt_types[type], abfd, p->abfd); return FALSE; } @@ -704,7 +708,7 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { error = TRUE; _bfd_error_handler - (_("%B: linking UltraSPARC specific with HAL specific code"), + (_("%pB: linking UltraSPARC specific with HAL specific code"), ibfd); } /* Choose the most restrictive memory ordering. */ @@ -724,7 +728,7 @@ elf64_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) error = TRUE; _bfd_error_handler /* xgettext:c-format */ - (_("%B: uses different e_flags (%#x) fields than previous modules (%#x)"), + (_("%pB: uses different e_flags (%#x) fields than previous modules (%#x)"), ibfd, new_flags, old_flags); } diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index ba4f47b..7016964 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -282,9 +282,10 @@ elf_x86_64_rtype_to_howto (bfd *abfd, unsigned r_type) if (r_type >= (unsigned int) R_X86_64_standard) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: invalid relocation type %d"), - abfd, (int) r_type); - r_type = R_X86_64_NONE; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return NULL; } i = r_type; } @@ -336,8 +337,8 @@ elf_x86_64_reloc_name_lookup (bfd *abfd, /* Given an x86_64 ELF reloc type, fill in an arelent structure. */ -static void -elf_x86_64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, +static bfd_boolean +elf_x86_64_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned r_type; @@ -347,8 +348,10 @@ elf_x86_64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, && r_type != (unsigned int) R_X86_64_GNU_VTENTRY) r_type &= ~R_X86_64_converted_reloc_bit; cache_ptr->howto = elf_x86_64_rtype_to_howto (abfd, r_type); - + if (cache_ptr->howto == NULL) + return FALSE; BFD_ASSERT (r_type == cache_ptr->howto->type || cache_ptr->howto->type == R_X86_64_NONE); + return TRUE; } /* Support for core dump NOTE sections. */ @@ -1311,6 +1314,9 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd, from = elf_x86_64_rtype_to_howto (abfd, from_type); to = elf_x86_64_rtype_to_howto (abfd, to_type); + if (from == NULL || to == NULL) + return FALSE; + if (h) name = h->root.root.string; else @@ -1332,9 +1338,9 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd, _bfd_error_handler /* xgettext:c-format */ - (_("%B: TLS transition from %s to %s against `%s' at %#Lx " - "in section `%A' failed"), - abfd, from->name, to->name, name, rel->r_offset, sec); + (_("%pB: TLS transition from %s to %s against `%s' at %#" PRIx64 + " in section `%pA' failed"), + abfd, from->name, to->name, name, (uint64_t) rel->r_offset, sec); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1401,7 +1407,7 @@ elf_x86_64_need_pic (struct bfd_link_info *info, object = _("a PDE object"); /* xgettext:c-format */ - _bfd_error_handler (_("%B: relocation %s against %s%s`%s' can " + _bfd_error_handler (_("%pB: relocation %s against %s%s`%s' can " "not be used when making %s%s"), input_bfd, howto->name, und, v, name, object, pic); @@ -1820,7 +1826,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); goto error_return; } @@ -1886,7 +1892,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against symbol `%s' isn't " + (_("%pB: relocation %s against symbol `%s' isn't " "supported in x32 mode"), abfd, x86_64_elf_howto_table[r_type].name, name); bfd_set_error (bfd_error_bad_value); @@ -1927,6 +1933,10 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, rel, rel_end, h, r_symndx, FALSE)) goto error_return; + /* Check if _GLOBAL_OFFSET_TABLE_ is referenced. */ + if (h == htab->elf.hgot) + htab->got_referenced = TRUE; + eh = (struct elf_x86_link_hash_entry *) h; switch (r_type) { @@ -2024,7 +2034,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, isym, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: '%s' accessed both as normal and" + (_("%pB: '%s' accessed both as normal and" " thread local symbol"), abfd, name); bfd_set_error (bfd_error_bad_value); @@ -2131,7 +2141,17 @@ pointer: as pointer, make sure that PLT is used if foo is a function defined in a shared library. */ if ((sec->flags & SEC_CODE) == 0) - h->pointer_equality_needed = 1; + { + h->pointer_equality_needed = 1; + if (bfd_link_pie (info) + && h->type == STT_FUNC + && !h->def_regular + && h->def_dynamic) + { + h->needs_plt = 1; + h->plt.refcount = 1; + } + } } else if (r_type != R_X86_64_PC32_BND && r_type != R_X86_64_PC64) @@ -2169,7 +2189,7 @@ pointer: size_reloc = FALSE; do_size: - if (NEED_DYNAMIC_RELOCATION_P (info, h, sec, r_type, + if (NEED_DYNAMIC_RELOCATION_P (info, TRUE, h, sec, r_type, htab->pointer_r_type)) { struct elf_dyn_relocs *p; @@ -2303,24 +2323,6 @@ elf_x86_64_tpoff (struct bfd_link_info *info, bfd_vma address) return address - static_tls_size - htab->tls_sec->vma; } -/* Is the instruction before OFFSET in CONTENTS a 32bit relative - branch? */ - -static bfd_boolean -is_32bit_relative_branch (bfd_byte *contents, bfd_vma offset) -{ - /* Opcode Instruction - 0xe8 call - 0xe9 jump - 0x0f 0x8x conditional jump */ - return ((offset > 0 - && (contents [offset - 1] == 0xe8 - || contents [offset - 1] == 0xe9)) - || (offset > 1 - && contents [offset - 2] == 0x0f - && (contents [offset - 1] & 0xf0) == 0x80)); -} - /* Relocate an x86_64 ELF section. */ static bfd_boolean @@ -2622,7 +2624,7 @@ bad_ifunc_reloc: NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against STT_GNU_IFUNC " + (_("%pB: relocation %s against STT_GNU_IFUNC " "symbol `%s' isn't supported"), input_bfd, howto->name, name); bfd_set_error (bfd_error_bad_value); @@ -2648,9 +2650,9 @@ do_ifunc_pointer: sym, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against STT_GNU_IFUNC " - "symbol `%s' has non-zero addend: %Ld"), - input_bfd, howto->name, name, rel->r_addend); + (_("%pB: relocation %s against STT_GNU_IFUNC " + "symbol `%s' has non-zero addend: %" PRId64), + input_bfd, howto->name, name, (int64_t) rel->r_addend); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2679,7 +2681,7 @@ do_ifunc_pointer: if (POINTER_LOCAL_IFUNC_P (info, h)) { - info->callbacks->minfo (_("Local IFUNC function `%s' in %B\n"), + info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"), h->root.root.string, h->root.u.def.section->owner); @@ -2885,7 +2887,7 @@ do_ifunc_pointer: _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation R_X86_64_GOTOFF64 against undefined %s" + (_("%pB: relocation R_X86_64_GOTOFF64 against undefined %s" " `%s' can not be used when making a shared object"), input_bfd, v, h->root.root.string); bfd_set_error (bfd_error_bad_value); @@ -2899,7 +2901,7 @@ do_ifunc_pointer: { _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation R_X86_64_GOTOFF64 against protected %s" + (_("%pB: relocation R_X86_64_GOTOFF64 against protected %s" " `%s' can not be used when making a shared object"), input_bfd, h->type == STT_FUNC ? "function" : "data", @@ -2982,6 +2984,7 @@ do_ifunc_pointer: break; } +use_plt: if (h->plt.offset != (bfd_vma) -1) { if (htab->plt_second != NULL) @@ -3019,14 +3022,18 @@ do_ifunc_pointer: case R_X86_64_PC32: case R_X86_64_PC32_BND: /* Don't complain about -fPIC if the symbol is undefined when - building executable unless it is unresolved weak symbol or - -z nocopyreloc is used. */ + building executable unless it is unresolved weak symbol, + references a dynamic definition in PIE or -z nocopyreloc + is used. */ if ((input_section->flags & SEC_ALLOC) != 0 && (input_section->flags & SEC_READONLY) != 0 && h != NULL && ((bfd_link_executable (info) && ((h->root.type == bfd_link_hash_undefweak && !resolved_to_zero) + || (bfd_link_pie (info) + && !h->def_regular + && h->def_dynamic) || ((info->nocopyreloc || (eh->def_protected && elf_has_no_copy_on_protected (h->root.u.def.section->owner))) @@ -3035,32 +3042,36 @@ do_ifunc_pointer: || bfd_link_dll (info))) { bfd_boolean fail = FALSE; - bfd_boolean branch - = ((r_type == R_X86_64_PC32 - || r_type == R_X86_64_PC32_BND) - && is_32bit_relative_branch (contents, rel->r_offset)); - if (SYMBOL_REFERENCES_LOCAL_P (info, h)) { /* Symbol is referenced locally. Make sure it is - defined locally or for a branch. */ - fail = (!(h->def_regular || ELF_COMMON_DEF_P (h)) - && !branch); + defined locally. */ + fail = !(h->def_regular || ELF_COMMON_DEF_P (h)); } else if (!(bfd_link_pie (info) && (h->needs_copy || eh->needs_copy))) { /* Symbol doesn't need copy reloc and isn't referenced - locally. We only allow branch to symbol with - non-default visibility. */ - fail = (!branch - || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT); + locally. Address of protected function may not be + reachable at run-time. */ + fail = (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || (ELF_ST_VISIBILITY (h->other) == STV_PROTECTED + && h->type == STT_FUNC)); } if (fail) return elf_x86_64_need_pic (info, input_bfd, input_section, h, NULL, NULL, howto); } + /* Since x86-64 has PC-relative PLT, we can use PLT in PIE + as function address. */ + else if (h != NULL + && (input_section->flags & SEC_CODE) == 0 + && bfd_link_pie (info) + && h->type == STT_FUNC + && !h->def_regular + && h->def_dynamic) + goto use_plt; /* Fall through. */ case R_X86_64_8: @@ -3150,11 +3161,12 @@ direct: sym, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: addend %s%#x in relocation %s against " - "symbol `%s' at %#Lx in section `%A' is " - "out of range"), + (_("%pB: addend %s%#x in relocation %s against " + "symbol `%s' at %#" PRIx64 + " in section `%pA' is out of range"), input_bfd, addend < 0 ? "-" : "", addend, - howto->name, name, rel->r_offset, input_section); + howto->name, name, (uint64_t) rel->r_offset, + input_section); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3787,10 +3799,11 @@ direct: default: _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); return FALSE; @@ -3836,9 +3849,9 @@ check_relocation_error: { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): reloc against `%s': error %d"), + (_("%pB(%pA+%#" PRIx64 "): reloc against `%s': error %d"), input_bfd, input_section, - rel->r_offset, name, (int) r); + (uint64_t) rel->r_offset, name, (int) r); return FALSE; } } @@ -3983,7 +3996,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, /* Check PC-relative offset overflow in PLT entry. */ if ((plt_got_pcrel_offset + 0x80000000) > 0xffffffff) /* xgettext:c-format */ - info->callbacks->einfo (_("%F%B: PC-relative offset overflow in PLT entry for `%s'\n"), + info->callbacks->einfo (_("%F%pB: PC-relative offset overflow in PLT entry for `%s'\n"), output_bfd, h->root.root.string); bfd_put_32 (output_bfd, plt_got_pcrel_offset, @@ -4009,7 +4022,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, + got_offset); if (PLT_LOCAL_IFUNC_P (info, h)) { - info->callbacks->minfo (_("Local IFUNC function `%s' in %B\n"), + info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"), h->root.root.string, h->root.u.def.section->owner); @@ -4046,7 +4059,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, will overflow first. */ if (plt0_offset > 0x80000000) /* xgettext:c-format */ - info->callbacks->einfo (_("%F%B: branch displacement overflow in PLT entry for `%s'\n"), + info->callbacks->einfo (_("%F%pB: branch displacement overflow in PLT entry for `%s'\n"), output_bfd, h->root.root.string); bfd_put_32 (output_bfd, - plt0_offset, (plt->contents + h->plt.offset @@ -4099,7 +4112,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, if ((got_after_plt && got_pcrel_offset < 0) || (!got_after_plt && got_pcrel_offset > 0)) /* xgettext:c-format */ - info->callbacks->einfo (_("%F%B: PC-relative offset overflow in GOT PLT entry for `%s'\n"), + info->callbacks->einfo (_("%F%pB: PC-relative offset overflow in GOT PLT entry for `%s'\n"), output_bfd, h->root.root.string); bfd_put_32 (output_bfd, got_pcrel_offset, @@ -4163,7 +4176,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, } if (SYMBOL_REFERENCES_LOCAL_P (info, h)) { - info->callbacks->minfo (_("Local IFUNC function `%s' in %B\n"), + info->callbacks->minfo (_("Local IFUNC function `%s' in %pB\n"), h->root.root.string, h->root.u.def.section->owner); @@ -4515,7 +4528,7 @@ elf_x86_64_get_synthetic_symtab (bfd *abfd, if (relsize <= 0) return -1; - if (get_elf_x86_backend_data (abfd)->target_os == is_normal) + if (get_elf_x86_backend_data (abfd)->target_os != is_nacl) { lazy_plt = &elf_x86_64_lazy_plt; non_lazy_plt = &elf_x86_64_non_lazy_plt; @@ -4866,8 +4879,7 @@ elf_x86_64_link_setup_gnu_properties (struct bfd_link_info *info) /* This is unused for x86-64. */ init_table.plt0_pad_byte = 0x90; - if (get_elf_x86_backend_data (info->output_bfd)->target_os - == is_normal) + if (get_elf_x86_backend_data (info->output_bfd)->target_os != is_nacl) { if (info->bndplt) { @@ -4930,7 +4942,11 @@ elf_x86_64_special_sections[]= #define ELF_ARCH bfd_arch_i386 #define ELF_TARGET_ID X86_64_ELF_DATA #define ELF_MACHINE_CODE EM_X86_64 -#define ELF_MAXPAGESIZE 0x200000 +#if DEFAULT_LD_Z_SEPARATE_CODE +# define ELF_MAXPAGESIZE 0x1000 +#else +# define ELF_MAXPAGESIZE 0x200000 +#endif #define ELF_MINPAGESIZE 0x1000 #define ELF_COMMONPAGESIZE 0x1000 @@ -5035,6 +5051,14 @@ elf_x86_64_special_sections[]= #undef TARGET_LITTLE_NAME #define TARGET_LITTLE_NAME "elf64-x86-64-sol2" +static const struct elf_x86_backend_data elf_x86_64_solaris_arch_bed = + { + is_solaris /* os */ + }; + +#undef elf_backend_arch_data +#define elf_backend_arch_data &elf_x86_64_solaris_arch_bed + /* Restore default: we cannot use ELFOSABI_SOLARIS, otherwise ELFOSABI_NONE objects won't be recognized. */ #undef ELF_OSABI @@ -5315,7 +5339,11 @@ elf64_l1om_elf_object_p (bfd *abfd) #undef ELF_MAXPAGESIZE #undef ELF_MINPAGESIZE #undef ELF_COMMONPAGESIZE -#define ELF_MAXPAGESIZE 0x200000 +#if DEFAULT_LD_Z_SEPARATE_CODE +# define ELF_MAXPAGESIZE 0x1000 +#else +# define ELF_MAXPAGESIZE 0x200000 +#endif #define ELF_MINPAGESIZE 0x1000 #define ELF_COMMONPAGESIZE 0x1000 #undef elf_backend_plt_alignment diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 00a9001..fb02e25 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -680,7 +680,7 @@ elf_object_p (bfd *abfd) if (i_ehdrp->e_shnum > ((bfd_size_type) -1) / sizeof (*i_shdrp)) goto got_wrong_format_error; #endif - amt = sizeof (*i_shdrp) * i_ehdrp->e_shnum; + amt = sizeof (*i_shdrp) * (bfd_size_type) i_ehdrp->e_shnum; i_shdrp = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); if (!i_shdrp) goto got_no_match; @@ -757,7 +757,7 @@ elf_object_p (bfd *abfd) so that at least some processing can be done. */ i_ehdrp->e_shstrndx = SHN_UNDEF; _bfd_error_handler - (_("warning: %B has a corrupt string table index - ignoring"), + (_("warning: %pB has a corrupt string table index - ignoring"), abfd); } } @@ -776,7 +776,7 @@ elf_object_p (bfd *abfd) if (i_ehdrp->e_phnum > ((bfd_size_type) -1) / sizeof (*i_phdr)) goto got_wrong_format_error; #endif - amt = i_ehdrp->e_phnum * sizeof (*i_phdr); + amt = (bfd_size_type) i_ehdrp->e_phnum * sizeof (*i_phdr); elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); if (elf_tdata (abfd)->phdr == NULL) goto got_no_match; @@ -1196,9 +1196,10 @@ elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: version count (%Ld) does not match symbol count (%ld)"), + (_("%pB: version count (%" PRId64 ")" + " does not match symbol count (%ld)"), abfd, - verhdr->sh_size / sizeof (Elf_External_Versym), + (int64_t) (verhdr->sh_size / sizeof (Elf_External_Versym)), symcount); /* Slurp in the symbols without the version information, @@ -1429,6 +1430,7 @@ elf_slurp_reloc_table_from_section (bfd *abfd, i < reloc_count; i++, relent++, native_relocs += entsize) { + bfd_boolean res; Elf_Internal_Rela rela; if (entsize == sizeof (Elf_External_Rela)) @@ -1453,8 +1455,9 @@ elf_slurp_reloc_table_from_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A): relocation %d has invalid symbol index %ld"), + (_("%pB(%pA): relocation %d has invalid symbol index %ld"), abfd, asect, i, (long) ELF_R_SYM (rela.r_info)); + bfd_set_error (bfd_error_bad_value); relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; } else @@ -1471,14 +1474,16 @@ elf_slurp_reloc_table_from_section (bfd *abfd, if ((entsize == sizeof (Elf_External_Rela) && ebd->elf_info_to_howto != NULL) || ebd->elf_info_to_howto_rel == NULL) - (*ebd->elf_info_to_howto) (abfd, relent, &rela); + res = ebd->elf_info_to_howto (abfd, relent, &rela); else - (*ebd->elf_info_to_howto_rel) (abfd, relent, &rela); + res = ebd->elf_info_to_howto_rel (abfd, relent, &rela); + + if (! res || relent->howto == NULL) + goto error_return; } if (allocated != NULL) free (allocated); - return TRUE; error_return: diff --git a/bfd/elfcore.h b/bfd/elfcore.h index 562b708..117a1b7 100644 --- a/bfd/elfcore.h +++ b/bfd/elfcore.h @@ -297,9 +297,9 @@ elf_core_file_p (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("warning: %B is truncated: expected core file " - "size >= %Lu, found: %llu"), - abfd, high, (unsigned long long) statbuf.st_size); + (_("warning: %pB is truncated: expected core file " + "size >= %" PRIu64 ", found: %" PRIu64), + abfd, (uint64_t) high, (uint64_t) statbuf.st_size); } } } diff --git a/bfd/elflink.c b/bfd/elflink.c index e3751fa..092edae 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -881,9 +881,9 @@ elf_link_renumber_local_hash_table_dynsyms (struct elf_link_hash_entry *h, /* Return true if the dynamic symbol for a given section should be omitted when creating a shared library. */ bfd_boolean -_bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, - struct bfd_link_info *info, - asection *p) +_bfd_elf_omit_section_dynsym_default (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info, + asection *p) { struct elf_link_hash_table *htab; asection *ip; @@ -913,6 +913,15 @@ _bfd_elf_link_omit_section_dynsym (bfd *output_bfd ATTRIBUTE_UNUSED, } } +bfd_boolean +_bfd_elf_omit_section_dynsym_all + (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *p ATTRIBUTE_UNUSED) +{ + return TRUE; +} + /* Assign dynsym indices. In a shared library we generate a section symbol for each output section, which come first. Next come symbols which have been forced to local binding. Then all of the back-end @@ -1350,26 +1359,26 @@ _bfd_elf_merge_symbol (bfd *abfd, if (tdef && ntdef) _bfd_error_handler /* xgettext:c-format */ - (_("%s: TLS definition in %B section %A " - "mismatches non-TLS definition in %B section %A"), + (_("%s: TLS definition in %pB section %pA " + "mismatches non-TLS definition in %pB section %pA"), h->root.root.string, tbfd, tsec, ntbfd, ntsec); else if (!tdef && !ntdef) _bfd_error_handler /* xgettext:c-format */ - (_("%s: TLS reference in %B " - "mismatches non-TLS reference in %B"), + (_("%s: TLS reference in %pB " + "mismatches non-TLS reference in %pB"), h->root.root.string, tbfd, ntbfd); else if (tdef) _bfd_error_handler /* xgettext:c-format */ - (_("%s: TLS definition in %B section %A " - "mismatches non-TLS reference in %B"), + (_("%s: TLS definition in %pB section %pA " + "mismatches non-TLS reference in %pB"), h->root.root.string, tbfd, tsec, ntbfd); else _bfd_error_handler /* xgettext:c-format */ - (_("%s: TLS reference in %B " - "mismatches non-TLS definition in %B section %A"), + (_("%s: TLS reference in %pB " + "mismatches non-TLS definition in %pB section %pA"), h->root.root.string, tbfd, ntbfd, ntsec); bfd_set_error (bfd_error_bad_value); @@ -2049,7 +2058,7 @@ nondefault: && hi->root.type != bfd_link_hash_defweak) _bfd_error_handler /* xgettext:c-format */ - (_("%B: unexpected redefinition of indirect versioned symbol `%s'"), + (_("%pB: unexpected redefinition of indirect versioned symbol `%s'"), abfd, shortname); } else @@ -2342,7 +2351,7 @@ _bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data) generating a shared archive. Return an error. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: version node not found for symbol %s"), + (_("%pB: version node not found for symbol %s"), info->output_bfd, h->root.root.string); bfd_set_error (bfd_error_bad_value); sinfo->failed = TRUE; @@ -2431,10 +2440,10 @@ elf_link_read_relocs_from_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: bad reloc symbol index (%#Lx >= %#lx)" - " for offset %#Lx in section `%A'"), - abfd, r_symndx, (unsigned long) nsyms, - irela->r_offset, sec); + (_("%pB: bad reloc symbol index (%#" PRIx64 " >= %#lx)" + " for offset %#" PRIx64 " in section `%pA'"), + abfd, (uint64_t) r_symndx, (unsigned long) nsyms, + (uint64_t) irela->r_offset, sec); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2443,11 +2452,11 @@ elf_link_read_relocs_from_section (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: non-zero symbol index (%#Lx)" - " for offset %#Lx in section `%A'" + (_("%pB: non-zero symbol index (%#" PRIx64 ")" + " for offset %#" PRIx64 " in section `%pA'" " when the object file has no symbol table"), - abfd, r_symndx, - irela->r_offset, sec); + abfd, (uint64_t) r_symndx, + (uint64_t) irela->r_offset, sec); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2634,7 +2643,7 @@ _bfd_elf_link_output_relocs (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation size mismatch in %B section %A"), + (_("%pB: relocation size mismatch in %pB section %pA"), output_bfd, input_section->owner, input_section); bfd_set_error (bfd_error_wrong_format); return FALSE; @@ -3014,7 +3023,7 @@ _bfd_elf_adjust_dynamic_copy (struct bfd_link_info *info, || (info->extern_protected_data < 0 && !get_elf_backend_data (dynbss->owner)->extern_protected_data))) info->callbacks->einfo - (_("%P: copy reloc against protected `%T' is dangerous\n"), + (_("%P: copy reloc against protected `%pT' is dangerous\n"), h->root.root.string); return TRUE; @@ -3813,9 +3822,9 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) && ehdr->e_machine == bed->elf_machine_alt1) || (bed->elf_machine_alt2 != 0 && ehdr->e_machine == bed->elf_machine_alt2))) - info->callbacks->einfo + _bfd_error_handler /* xgettext:c-format */ - (_("%P: alternate ELF machine code found (%d) in %B, expecting %d\n"), + (_("alternate ELF machine code found (%d) in %pB, expecting %d"), ehdr->e_machine, abfd, bed->elf_machine_code); /* As a GNU extension, any input sections which are named @@ -4481,7 +4490,7 @@ error_free_dyn: { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %s: invalid version %u (max %d)"), + (_("%pB: %s: invalid version %u (max %d)"), abfd, name, vernum, elf_tdata (abfd)->cverdefs); bfd_set_error (bfd_error_bad_value); @@ -4518,7 +4527,7 @@ error_free_dyn: { _bfd_error_handler /* xgettext:c-format */ - (_("%B: %s: invalid needed version %d"), + (_("%pB: %s: invalid needed version %d"), abfd, name, vernum); bfd_set_error (bfd_error_bad_value); goto error_free_vers; @@ -4770,15 +4779,15 @@ error_free_dyn: if (normal_bfd == NULL) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: alignment %u of common symbol `%s' in %B is" - " greater than the alignment (%u) of its section %A"), + (_("warning: alignment %u of common symbol `%s' in %pB is" + " greater than the alignment (%u) of its section %pA"), 1 << common_align, name, common_bfd, 1 << normal_align, h->root.u.def.section); else _bfd_error_handler /* xgettext:c-format */ - (_("Warning: alignment %u of symbol `%s' in %B" - " is smaller than %u in %B"), + (_("warning: alignment %u of symbol `%s' in %pB" + " is smaller than %u in %pB"), 1 << normal_align, name, normal_bfd, 1 << common_align, common_bfd); } @@ -4794,9 +4803,10 @@ error_free_dyn: && ! size_change_ok) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: size of symbol `%s' changed" - " from %Lu in %B to %Lu in %B"), - name, h->size, old_bfd, isym->st_size, abfd); + (_("warning: size of symbol `%s' changed" + " from %" PRIu64 " in %pB to %" PRIu64 " in %pB"), + name, (uint64_t) h->size, old_bfd, + (uint64_t) isym->st_size, abfd); h->size = isym->st_size; } @@ -4828,8 +4838,8 @@ error_free_dyn: if (h->type != STT_NOTYPE && ! type_change_ok) /* xgettext:c-format */ _bfd_error_handler - (_("Warning: type of symbol `%s' changed" - " from %d to %d in %B"), + (_("warning: type of symbol `%s' changed" + " from %d to %d in %pB"), name, h->type, type, abfd); h->type = type; @@ -4929,7 +4939,7 @@ error_free_dyn: { _bfd_error_handler /* xgettext:c-format */ - (_("%B: undefined reference to symbol '%s'"), + (_("%pB: undefined reference to symbol '%s'"), old_bfd, name); bfd_set_error (bfd_error_missing_dso); goto error_free_vers; @@ -5422,7 +5432,7 @@ _bfd_elf_archive_symbol_lookup (bfd *abfd, len = strlen (name); copy = (char *) bfd_alloc (abfd, len); if (copy == NULL) - return (struct elf_link_hash_entry *) 0 - 1; + return (struct elf_link_hash_entry *) -1; first = p - name + 1; memcpy (copy, name, first); @@ -5520,7 +5530,7 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) } h = archive_symbol_lookup (abfd, info, symdef->name); - if (h == (struct elf_link_hash_entry *) 0 - 1) + if (h == (struct elf_link_hash_entry *) -1) goto error_return; if (h == NULL) @@ -6005,11 +6015,11 @@ bfd_elf_stack_segment_size (bfd *output_bfd, h->type = STT_OBJECT; if (info->stacksize) /* xgettext:c-format */ - _bfd_error_handler (_("%B: stack size specified and %s set"), + _bfd_error_handler (_("%pB: stack size specified and %s set"), output_bfd, legacy_symbol); else if (h->root.u.def.section != bfd_abs_section_ptr) /* xgettext:c-format */ - _bfd_error_handler (_("%B: %s not absolute"), + _bfd_error_handler (_("%pB: %s not absolute"), output_bfd, legacy_symbol); else info->stacksize = h->root.u.def.value; @@ -6777,7 +6787,7 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, == SHT_PREINIT_ARRAY) { _bfd_error_handler - (_("%B: .preinit_array section is not allowed in DSO"), + (_("%pB: .preinit_array section is not allowed in DSO"), sub); break; } @@ -6901,7 +6911,7 @@ _bfd_elf_init_1_index_section (bfd *output_bfd, struct bfd_link_info *info) for (s = output_bfd->sections; s != NULL; s = s->next) if ((s->flags & (SEC_EXCLUDE | SEC_ALLOC)) == SEC_ALLOC - && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + && !_bfd_elf_omit_section_dynsym_default (output_bfd, info, s)) { elf_hash_table (info)->text_index_section = s; break; @@ -6919,7 +6929,7 @@ _bfd_elf_init_2_index_sections (bfd *output_bfd, struct bfd_link_info *info) _bfd_elf_link_omit_section_dynsym. */ for (s = output_bfd->sections; s != NULL; s = s->next) if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) == SEC_ALLOC) - && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + && !_bfd_elf_omit_section_dynsym_default (output_bfd, info, s)) { elf_hash_table (info)->data_index_section = s; break; @@ -6928,7 +6938,7 @@ _bfd_elf_init_2_index_sections (bfd *output_bfd, struct bfd_link_info *info) for (s = output_bfd->sections; s != NULL; s = s->next) if (((s->flags & (SEC_EXCLUDE | SEC_ALLOC | SEC_READONLY)) == (SEC_ALLOC | SEC_READONLY)) - && !_bfd_elf_link_omit_section_dynsym (output_bfd, info, s)) + && !_bfd_elf_omit_section_dynsym_default (output_bfd, info, s)) { elf_hash_table (info)->text_index_section = s; break; @@ -8707,10 +8717,10 @@ elf_link_adjust_relocs (bfd *abfd, && ! info->gc_keep_exported) { /* PR 21524: Let the user know if a symbol was removed by garbage collection. */ - _bfd_error_handler (_("%B:%A: error: relocation references symbol %s which was removed by garbage collection."), + _bfd_error_handler (_("%pB:%pA: error: relocation references symbol %s which was removed by garbage collection"), abfd, sec, (*rel_hash)->root.root.string); - _bfd_error_handler (_("%B:%A: error: try relinking with --gc-keep-exported enabled."), + _bfd_error_handler (_("%pB:%pA: error: try relinking with --gc-keep-exported enabled"), abfd, sec); bfd_set_error (bfd_error_invalid_operation); return FALSE; @@ -8946,7 +8956,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) /* Section size is only divisible by rela. */ if (use_rela_initialised && !use_rela) { - _bfd_error_handler (_("%B: Unable to sort relocs - " + _bfd_error_handler (_("%pB: unable to sort relocs - " "they are in more than one size"), abfd); bfd_set_error (bfd_error_invalid_operation); @@ -8964,7 +8974,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) /* Section size is only divisible by rel. */ if (use_rela_initialised && use_rela) { - _bfd_error_handler (_("%B: Unable to sort relocs - " + _bfd_error_handler (_("%pB: unable to sort relocs - " "they are in more than one size"), abfd); bfd_set_error (bfd_error_invalid_operation); @@ -8980,7 +8990,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) { /* The section size is not divisible by either - something is wrong. */ - _bfd_error_handler (_("%B: Unable to sort relocs - " + _bfd_error_handler (_("%pB: unable to sort relocs - " "they are of an unknown size"), abfd); bfd_set_error (bfd_error_invalid_operation); return 0; @@ -9003,7 +9013,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) /* Section size is only divisible by rela. */ if (use_rela_initialised && !use_rela) { - _bfd_error_handler (_("%B: Unable to sort relocs - " + _bfd_error_handler (_("%pB: unable to sort relocs - " "they are in more than one size"), abfd); bfd_set_error (bfd_error_invalid_operation); @@ -9021,7 +9031,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) /* Section size is only divisible by rel. */ if (use_rela_initialised && use_rela) { - _bfd_error_handler (_("%B: Unable to sort relocs - " + _bfd_error_handler (_("%pB: unable to sort relocs - " "they are in more than one size"), abfd); bfd_set_error (bfd_error_invalid_operation); @@ -9037,7 +9047,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) { /* The section size is not divisible by either - something is wrong. */ - _bfd_error_handler (_("%B: Unable to sort relocs - " + _bfd_error_handler (_("%pB: unable to sort relocs - " "they are of an unknown size"), abfd); bfd_set_error (bfd_error_invalid_operation); return 0; @@ -9089,7 +9099,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) if (sort == NULL) { (*info->callbacks->warning) - (info, _("Not enough memory to sort relocations"), 0, abfd, 0, 0); + (info, _("not enough memory to sort relocations"), 0, abfd, 0, 0); return 0; } @@ -9357,7 +9367,7 @@ check_dynsym (bfd *abfd, Elf_Internal_Sym *sym) beyond 64k. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: Too many sections: %d (>= %d)"), + (_("%pB: too many sections: %d (>= %d)"), abfd, bfd_count_sections (abfd), SHN_LORESERVE & 0xffff); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -9637,13 +9647,13 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) if (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL) /* xgettext:c-format */ - msg = _("%B: internal symbol `%s' in %B is referenced by DSO"); + msg = _("%pB: internal symbol `%s' in %pB is referenced by DSO"); else if (ELF_ST_VISIBILITY (h->other) == STV_HIDDEN) /* xgettext:c-format */ - msg = _("%B: hidden symbol `%s' in %B is referenced by DSO"); + msg = _("%pB: hidden symbol `%s' in %pB is referenced by DSO"); else /* xgettext:c-format */ - msg = _("%B: local symbol `%s' in %B is referenced by DSO"); + msg = _("%pB: local symbol `%s' in %pB is referenced by DSO"); def_bfd = flinfo->output_bfd; if (hi->root.u.def.section != bfd_abs_section_ptr) def_bfd = hi->root.u.def.section->owner; @@ -9729,7 +9739,7 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: could not find output section %A for input section %A"), + (_("%pB: could not find output section %pA for input section %pA"), flinfo->output_bfd, input_sec->output_section, input_sec); bfd_set_error (bfd_error_nonrepresentable_section); eoinfo->failed = TRUE; @@ -9883,13 +9893,13 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) if (ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED) /* xgettext:c-format */ - msg = _("%B: protected symbol `%s' isn't defined"); + msg = _("%pB: protected symbol `%s' isn't defined"); else if (ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL) /* xgettext:c-format */ - msg = _("%B: internal symbol `%s' isn't defined"); + msg = _("%pB: internal symbol `%s' isn't defined"); else /* xgettext:c-format */ - msg = _("%B: hidden symbol `%s' isn't defined"); + msg = _("%pB: hidden symbol `%s' isn't defined"); _bfd_error_handler (msg, flinfo->output_bfd, h->root.root.string); bfd_set_error (bfd_error_bad_value); eoinfo->failed = TRUE; @@ -9920,7 +9930,7 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: No symbol version section for versioned symbol `%s'"), + (_("%pB: no symbol version section for versioned symbol `%s'"), flinfo->output_bfd, h->root.root.string); eoinfo->failed = TRUE; return FALSE; @@ -10530,7 +10540,7 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B: size of section %A is not " + (_("error: %pB: size of section %pA is not " "multiple of address size"), input_bfd, o); bfd_set_error (bfd_error_bad_value); @@ -10575,9 +10585,9 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd) { _bfd_error_handler /* xgettext:c-format */ - (_("error: %B contains a reloc (%#Lx) for section %A " + (_("error: %pB contains a reloc (%#" PRIx64 ") for section %pA " "that references a non-existent global symbol"), - input_bfd, rel->r_info, o); + input_bfd, (uint64_t) rel->r_info, o); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -10661,8 +10671,8 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd) if (action_discarded & COMPLAIN) (*flinfo->info->callbacks->einfo) /* xgettext:c-format */ - (_("%X`%s' referenced in section `%A' of %B: " - "defined in discarded section `%A' of %B\n"), + (_("%X`%s' referenced in section `%pA' of %pB: " + "defined in discarded section `%pA' of %pB\n"), sym_name, o, input_bfd, sec, sec->owner); /* Try to do the best we can to support buggy old @@ -11249,7 +11259,7 @@ elf_get_linked_section_vma (struct bfd_link_order *p) if (bed->link_order_error_handler) bed->link_order_error_handler /* xgettext:c-format */ - (_("%B: warning: sh_link not set for section `%A'"), s->owner, s); + (_("%pB: warning: sh_link not set for section `%pA'"), s->owner, s); return 0; } else @@ -11330,13 +11340,13 @@ elf_fixup_link_order (bfd *abfd, asection *o) if (other_sec && linkorder_sec) _bfd_error_handler /* xgettext:c-format */ - (_("%A has both ordered [`%A' in %B] " - "and unordered [`%A' in %B] sections"), + (_("%pA has both ordered [`%pA' in %pB] " + "and unordered [`%pA' in %pB] sections"), o, linkorder_sec, linkorder_sec->owner, other_sec, other_sec->owner); else _bfd_error_handler - (_("%A has both ordered and unordered sections"), o); + (_("%pA has both ordered and unordered sections"), o); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -11438,7 +11448,7 @@ elf_output_implib (bfd *abfd, struct bfd_link_info *info) if (symcount == 0) { bfd_set_error (bfd_error_no_symbols); - _bfd_error_handler (_("%B: no symbol found for import library"), + _bfd_error_handler (_("%pB: no symbol found for import library"), implib_bfd); goto free_sym_buf; } @@ -11618,6 +11628,13 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) else o->flags |= SEC_EXCLUDE; } + else if ((o->flags & SEC_GROUP) != 0 && o->size == 0) + { + /* Remove empty group section from linker output. */ + o->flags |= SEC_EXCLUDE; + bfd_section_list_remove (abfd, o); + abfd->section_count--; + } } /* Count up the number of relocations we will output for each output @@ -12060,7 +12077,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) bfd_set_error (bfd_error_wrong_format); _bfd_error_handler /* xgettext:c-format */ - (_("%B: file class %s incompatible with %s"), + (_("%pB: file class %s incompatible with %s"), sub, iclass, oclass); } @@ -12277,7 +12294,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) if (info->out_implib_bfd && !elf_output_implib (abfd, info)) { - _bfd_error_handler (_("%B: failed to generate import library"), + _bfd_error_handler (_("%pB: failed to generate import library"), info->out_implib_bfd); return FALSE; } @@ -12536,10 +12553,10 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) { if (info->error_textrel) info->callbacks->einfo - (_("%P%X: read-only segment has dynamic relocations.\n")); + (_("%P%X: read-only segment has dynamic relocations\n")); else info->callbacks->einfo - (_("%P: warning: creating a DT_TEXTREL in a shared object.\n")); + (_("%P: warning: creating a DT_TEXTREL in a shared object\n")); break; } } @@ -12826,7 +12843,7 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info, asection *sec, h = cookie->sym_hashes[r_symndx - cookie->extsymoff]; if (h == NULL) { - info->callbacks->einfo (_("%F%P: corrupt input: %B\n"), + info->callbacks->einfo (_("%F%P: corrupt input: %pB\n"), sec->owner); return NULL; } @@ -13148,7 +13165,7 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info) if (info->print_gc_sections && o->size != 0) /* xgettext:c-format */ - _bfd_error_handler (_("Removing unused section '%A' in file '%B'"), + _bfd_error_handler (_("removing unused section '%pA' in file '%pB'"), o, sub); } } @@ -13366,7 +13383,7 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) if (!bed->can_gc_sections || !is_elf_hash_table (info->hash)) { - _bfd_error_handler(_("Warning: gc-sections option ignored")); + _bfd_error_handler(_("warning: gc-sections option ignored")); return TRUE; } @@ -13492,8 +13509,8 @@ bfd_elf_gc_record_vtinherit (bfd *abfd, } /* xgettext:c-format */ - _bfd_error_handler (_("%B: %A+%#Lx: No symbol found for INHERIT"), - abfd, sec, offset); + _bfd_error_handler (_("%pB: %pA+%#" PRIx64 ": no symbol found for INHERIT"), + abfd, sec, (uint64_t) offset); bfd_set_error (bfd_error_invalid_operation); return FALSE; @@ -13668,7 +13685,7 @@ bfd_elf_lookup_section_flags (struct bfd_link_info *info, if (!tf->valid) { info->callbacks->einfo - (_("Unrecognized INPUT_SECTION_FLAG %s\n"), tf->name); + (_("unrecognized INPUT_SECTION_FLAG %s\n"), tf->name); return FALSE; } } @@ -14338,8 +14355,9 @@ bfd_elf_define_start_stop (struct bfd_link_info *info, if (h != NULL && (h->root.type == bfd_link_hash_undefined || h->root.type == bfd_link_hash_undefweak - || (h->ref_regular && !h->def_regular))) + || ((h->ref_regular || h->def_dynamic) && !h->def_regular))) { + bfd_boolean was_dynamic = h->ref_dynamic || h->def_dynamic; h->root.type = bfd_link_hash_defined; h->root.u.def.section = sec; h->root.u.def.value = 0; @@ -14354,8 +14372,13 @@ bfd_elf_define_start_stop (struct bfd_link_info *info, bed = get_elf_backend_data (info->output_bfd); (*bed->elf_backend_hide_symbol) (info, h, TRUE); } - else if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_PROTECTED; + else + { + if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_PROTECTED; + if (was_dynamic) + bfd_elf_link_record_dynamic_symbol (info, h); + } return &h->root; } return NULL; diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c index 141ec96..076bec1 100644 --- a/bfd/elfn32-mips.c +++ b/bfd/elfn32-mips.c @@ -66,11 +66,9 @@ static bfd_reloc_status_type mips16_gprel_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static reloc_howto_type *mips_elf_n32_rtype_to_howto - (unsigned int, bfd_boolean); -static void mips_info_to_howto_rel +static bfd_boolean mips_info_to_howto_rel (bfd *, arelent *, Elf_Internal_Rela *); -static void mips_info_to_howto_rela +static bfd_boolean mips_info_to_howto_rela (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean mips_elf_sym_is_global (bfd *, asymbol *); @@ -3402,7 +3400,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ static reloc_howto_type * -mips_elf_n32_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p) +mips_elf_n32_rtype_to_howto (bfd *abfd, unsigned int r_type, bfd_boolean rela_p) { switch (r_type) { @@ -3440,9 +3438,10 @@ mips_elf_n32_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p) } if (r_type >= R_MIPS_max) { - _bfd_error_handler (_("unrecognised MIPS reloc number: %d"), r_type); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); bfd_set_error (bfd_error_bad_value); - r_type = R_MIPS_NONE; + return NULL; } if (rela_p) return &elf_mips_howto_table_rela[r_type]; @@ -3454,13 +3453,16 @@ mips_elf_n32_rtype_to_howto (unsigned int r_type, bfd_boolean rela_p) /* Given a MIPS Elf_Internal_Rel, fill in an arelent structure. */ -static void +static bfd_boolean mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - cache_ptr->howto = mips_elf_n32_rtype_to_howto (r_type, FALSE); + cache_ptr->howto = mips_elf_n32_rtype_to_howto (abfd, r_type, FALSE); + + if (cache_ptr->howto == NULL) + return FALSE; /* The addend for a GPREL16 or LITERAL relocation comes from the GP value for the object file. We get the addend now, rather than @@ -3469,19 +3471,22 @@ mips_info_to_howto_rel (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) if (((*cache_ptr->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0 && (gprel16_reloc_p (r_type) || r_type == (unsigned int) R_MIPS_LITERAL)) cache_ptr->addend = elf_gp (abfd); + + return TRUE; } /* Given a MIPS Elf_Internal_Rela, fill in an arelent structure. */ -static void -mips_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +mips_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type; r_type = ELF32_R_TYPE (dst->r_info); - cache_ptr->howto = mips_elf_n32_rtype_to_howto (r_type, TRUE); + cache_ptr->howto = mips_elf_n32_rtype_to_howto (abfd, r_type, TRUE); cache_ptr->addend = dst->r_addend; + return cache_ptr->howto != NULL; } /* Determine whether a symbol is global for the purposes of splitting diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index d5711e0..dc24df8 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -617,6 +617,114 @@ static reloc_howto_type elfNN_aarch64_howto_table[] = 0xffff, /* dst_mask */ FALSE), /* pcrel_offset */ + /* Group relocations to create a 16, 32, 48 or 64 bit + PC relative address inline. */ + + /* MOV[NZ]: ((S+A-P) >> 0) & 0xffff */ + HOWTO64 (AARCH64_R (MOVW_PREL_G0), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (MOVW_PREL_G0), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* MOVK: ((S+A-P) >> 0) & 0xffff [no overflow check] */ + HOWTO64 (AARCH64_R (MOVW_PREL_G0_NC), /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (MOVW_PREL_G0_NC), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* MOV[NZ]: ((S+A-P) >> 16) & 0xffff */ + HOWTO64 (AARCH64_R (MOVW_PREL_G1), /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (MOVW_PREL_G1), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* MOVK: ((S+A-P) >> 16) & 0xffff [no overflow check] */ + HOWTO64 (AARCH64_R (MOVW_PREL_G1_NC), /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (MOVW_PREL_G1_NC), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* MOV[NZ]: ((S+A-P) >> 32) & 0xffff */ + HOWTO64 (AARCH64_R (MOVW_PREL_G2), /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 17, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (MOVW_PREL_G2), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* MOVK: ((S+A-P) >> 32) & 0xffff [no overflow check] */ + HOWTO64 (AARCH64_R (MOVW_PREL_G2_NC), /* type */ + 32, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (MOVW_PREL_G2_NC), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + + /* MOV[NZ]: ((S+A-P) >> 48) & 0xffff */ + HOWTO64 (AARCH64_R (MOVW_PREL_G3), /* type */ + 48, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + AARCH64_R_STR (MOVW_PREL_G3), /* name */ + FALSE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + TRUE), /* pcrel_offset */ + /* Relocations to generate 19, 21 and 33 bit PC-relative load/store addresses: PG(x) is (x & ~0xfff). */ @@ -1864,7 +1972,7 @@ elfNN_aarch64_bfd_reloc_from_howto (reloc_howto_type *howto) /* Given R_TYPE, return the bfd internal relocation enumerator. */ static bfd_reloc_code_real_type -elfNN_aarch64_bfd_reloc_from_type (unsigned int r_type) +elfNN_aarch64_bfd_reloc_from_type (bfd *abfd, unsigned int r_type) { static bfd_boolean initialized_p = FALSE; /* Indexed by R_TYPE, values are offsets in the howto_table. */ @@ -1887,7 +1995,8 @@ elfNN_aarch64_bfd_reloc_from_type (unsigned int r_type) /* PR 17512: file: b371e70a. */ if (r_type >= R_AARCH64_end) { - _bfd_error_handler (_("Invalid AArch64 reloc number: %d"), r_type); + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); bfd_set_error (bfd_error_bad_value); return BFD_RELOC_AARCH64_NONE; } @@ -1946,7 +2055,7 @@ elfNN_aarch64_howto_from_bfd_reloc (bfd_reloc_code_real_type code) } static reloc_howto_type * -elfNN_aarch64_howto_from_type (unsigned int r_type) +elfNN_aarch64_howto_from_type (bfd *abfd, unsigned int r_type) { bfd_reloc_code_real_type val; reloc_howto_type *howto; @@ -1962,7 +2071,7 @@ elfNN_aarch64_howto_from_type (unsigned int r_type) if (r_type == R_AARCH64_NONE) return &elfNN_aarch64_howto_none; - val = elfNN_aarch64_bfd_reloc_from_type (r_type); + val = elfNN_aarch64_bfd_reloc_from_type (abfd, r_type); howto = elfNN_aarch64_howto_from_bfd_reloc (val); if (howto != NULL) @@ -1972,14 +2081,22 @@ elfNN_aarch64_howto_from_type (unsigned int r_type) return NULL; } -static void -elfNN_aarch64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, +static bfd_boolean +elfNN_aarch64_info_to_howto (bfd *abfd, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { unsigned int r_type; r_type = ELFNN_R_TYPE (elf_reloc->r_info); - bfd_reloc->howto = elfNN_aarch64_howto_from_type (r_type); + bfd_reloc->howto = elfNN_aarch64_howto_from_type (abfd, r_type); + + if (bfd_reloc->howto == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r_type); + return FALSE; + } + return TRUE; } static reloc_howto_type * @@ -2619,11 +2736,11 @@ aarch64_relocate (unsigned int r_type, bfd *input_bfd, asection *input_section, reloc_howto_type *howto; bfd_vma place; - howto = elfNN_aarch64_howto_from_type (r_type); + howto = elfNN_aarch64_howto_from_type (input_bfd, r_type); place = (input_section->output_section->vma + input_section->output_offset + offset); - r_type = elfNN_aarch64_bfd_reloc_from_type (r_type); + r_type = elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type); value = _bfd_aarch64_elf_resolve_relocation (r_type, place, value, 0, FALSE); return _bfd_aarch64_elf_put_addend (input_bfd, input_section->contents + offset, r_type, @@ -2851,7 +2968,7 @@ _bfd_aarch64_add_stub_entry_in_group (const char *stub_name, if (stub_entry == NULL) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: cannot create stub entry %s"), + _bfd_error_handler (_("%pB: cannot create stub entry %s"), section->owner, stub_name); return NULL; } @@ -3696,8 +3813,10 @@ _bfd_aarch64_resize_stubs (struct elf_aarch64_link_hash_table *htab) if (!strstr (section->name, STUB_SUFFIX)) continue; + /* Add space for a branch. Add 8 bytes to keep section 8 byte aligned, + as long branch stubs contain a 64-bit address. */ if (section->size) - section->size += 4; + section->size += 8; /* Ensure all stub sections have a size which is a multiple of 4096. This is important in order to ensure that the insertion @@ -3709,9 +3828,7 @@ _bfd_aarch64_resize_stubs (struct elf_aarch64_link_hash_table *htab) } } - -/* Construct an erratum 843419 workaround stub name. - */ +/* Construct an erratum 843419 workaround stub name. */ static char * _bfd_aarch64_erratum_843419_stub_name (asection *input_section, @@ -4253,8 +4370,11 @@ elfNN_aarch64_build_stubs (struct bfd_link_info *info) return FALSE; stub_sec->size = 0; + /* Add a branch around the stub section, and a nop, to keep it 8 byte + aligned, as long branch stubs contain a 64-bit address. */ bfd_putl32 (0x14000000 | (size >> 2), stub_sec->contents); - stub_sec->size += 4; + bfd_putl32 (INSN_NOP, stub_sec->contents + 4); + stub_sec->size += 8; } /* Build the stubs as directed by the stub hash table. */ @@ -4600,7 +4720,7 @@ aarch64_tls_transition (bfd *input_bfd, unsigned long r_symndx) { bfd_reloc_code_real_type bfd_r_type - = elfNN_aarch64_bfd_reloc_from_type (r_type); + = elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type); if (! aarch64_can_relax_tls (input_bfd, info, bfd_r_type, h, r_symndx)) return bfd_r_type; @@ -4776,7 +4896,7 @@ make_branch_to_erratum_835769_stub (struct bfd_hash_entry *gen_entry, abfd = stub_entry->target_section->owner; if (!aarch64_valid_branch_p (veneer_entry_loc, veneered_insn_loc)) _bfd_error_handler - (_("%B: error: Erratum 835769 stub out " + (_("%pB: error: erratum 835769 stub out " "of range (input file too large)"), abfd); target = stub_entry->target_value; @@ -4857,7 +4977,7 @@ _bfd_aarch64_erratum_843419_branch_to_stub (struct bfd_hash_entry *gen_entry, abfd = stub_entry->target_section->owner; if (!aarch64_valid_branch_p (veneer_entry_loc, veneered_insn_loc)) _bfd_error_handler - (_("%B: error: Erratum 843419 stub out " + (_("%pB: error: erratum 843419 stub out " "of range (input file too large)"), abfd); branch_insn = 0x14000000; @@ -4998,8 +5118,10 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto, name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), - input_bfd, input_section, rel->r_offset, howto->name, name); + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), + input_bfd, input_section, (uint64_t) rel->r_offset, + howto->name, name); bfd_set_error (bfd_error_bad_value); return bfd_reloc_notsupported; } @@ -5021,7 +5143,7 @@ bad_ifunc_reloc: NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against STT_GNU_IFUNC " + (_("%pB: relocation %s against STT_GNU_IFUNC " "symbol `%s' isn't handled by %s"), input_bfd, howto->name, name, __FUNCTION__); bfd_set_error (bfd_error_bad_value); @@ -5037,9 +5159,9 @@ bad_ifunc_reloc: sym, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against STT_GNU_IFUNC " - "symbol `%s' has non-zero addend: %Ld"), - input_bfd, howto->name, name, rel->r_addend); + (_("%pB: relocation %s against STT_GNU_IFUNC " + "symbol `%s' has non-zero addend: %" PRId64), + input_bfd, howto->name, name, (int64_t) rel->r_addend); bfd_set_error (bfd_error_bad_value); return bfd_reloc_notsupported; } @@ -5354,6 +5476,13 @@ bad_ifunc_reloc: case BFD_RELOC_AARCH64_ADR_HI21_PCREL: case BFD_RELOC_AARCH64_ADR_LO21_PCREL: case BFD_RELOC_AARCH64_LD_LO19_PCREL: + case BFD_RELOC_AARCH64_MOVW_PREL_G0: + case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G2: + case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G3: if (bfd_link_pic (info) && (input_section->flags & SEC_ALLOC) != 0 && (input_section->flags & SEC_READONLY) != 0 @@ -5363,7 +5492,7 @@ bad_ifunc_reloc: _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against symbol `%s' which may bind " + (_("%pB: relocation %s against symbol `%s' which may bind " "externally can not be used when making a shared object; " "recompile with -fPIC"), input_bfd, elfNN_aarch64_howto_table[howto_index].name, @@ -5454,7 +5583,7 @@ bad_ifunc_reloc: int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START; _bfd_error_handler /* xgettext:c-format */ - (_("%B: Local symbol descriptor table be NULL when applying " + (_("%pB: local symbol descriptor table be NULL when applying " "relocation %s against local symbol"), input_bfd, elfNN_aarch64_howto_table[howto_index].name); abort (); @@ -5676,7 +5805,7 @@ elfNN_aarch64_tls_relax (struct elf_aarch64_link_hash_table *globals, BFD_ASSERT (globals && input_bfd && contents && rel); - switch (elfNN_aarch64_bfd_reloc_from_type (r_type)) + switch (elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type)) { case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21: case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: @@ -6098,7 +6227,8 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, r_symndx = ELFNN_R_SYM (rel->r_info); r_type = ELFNN_R_TYPE (rel->r_info); - howto = bfd_reloc.howto = elfNN_aarch64_howto_from_type (r_type); + bfd_reloc.howto = elfNN_aarch64_howto_from_type (input_bfd, r_type); + howto = bfd_reloc.howto; if (howto == NULL) return _bfd_unrecognized_reloc (input_bfd, input_section, r_type); @@ -6182,11 +6312,11 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, _bfd_error_handler ((sym_type == STT_TLS /* xgettext:c-format */ - ? _("%B(%A+%#Lx): %s used with TLS symbol %s") + ? _("%pB(%pA+%#" PRIx64 "): %s used with TLS symbol %s") /* xgettext:c-format */ - : _("%B(%A+%#Lx): %s used with non-TLS symbol %s")), + : _("%pB(%pA+%#" PRIx64 "): %s used with non-TLS symbol %s")), input_bfd, - input_section, rel->r_offset, howto->name, name); + input_section, (uint64_t) rel->r_offset, howto->name, name); } /* We relax only if we can see that there can be a valid transition @@ -6226,7 +6356,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, h, &unresolved_reloc, save_addend, &addend, sym); - switch (elfNN_aarch64_bfd_reloc_from_type (r_type)) + switch (elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type)) { case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC: case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21: @@ -6269,7 +6399,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, bfd_elfNN_swap_reloca_out (output_bfd, &rela, loc); bfd_reloc_code_real_type real_type = - elfNN_aarch64_bfd_reloc_from_type (r_type); + elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type); if (real_type == BFD_RELOC_AARCH64_TLSLD_ADR_PREL21 || real_type == BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21 @@ -6454,8 +6584,9 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), - input_bfd, input_section, rel->r_offset, howto->name, + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), + input_bfd, input_section, (uint64_t) rel->r_offset, howto->name, h->root.root.string); return FALSE; } @@ -6463,7 +6594,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, if (r != bfd_reloc_ok && r != bfd_reloc_continue) { bfd_reloc_code_real_type real_r_type - = elfNN_aarch64_bfd_reloc_from_type (r_type); + = elfNN_aarch64_bfd_reloc_from_type (input_bfd, r_type); switch (r) { @@ -6476,7 +6607,7 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, { (*info->callbacks->warning) (info, - _("Too many GOT entries for -fpic, " + _("too many GOT entries for -fpic, " "please recompile with -fPIC"), name, input_bfd, input_section, rel->r_offset); return FALSE; @@ -6504,9 +6635,9 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, || real_r_type == BFD_RELOC_AARCH64_LDST128_LO12)) { info->callbacks->warning - (info, _("One possible cause of this error is that the \ + (info, _("one possible cause of this error is that the \ symbol is being referenced in the indicated code as if it had a larger \ -alignment than was declared where it was defined."), +alignment than was declared where it was defined"), name, input_bfd, input_section, rel->r_offset); } break; @@ -6975,7 +7106,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), abfd, r_symndx); + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -7074,14 +7205,23 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, #if ARCH_SIZE == 64 case BFD_RELOC_AARCH64_32: #endif - if (bfd_link_pic (info) - && (sec->flags & SEC_ALLOC) != 0 - && (sec->flags & SEC_READONLY) != 0) + if (bfd_link_pic (info) && (sec->flags & SEC_ALLOC) != 0) { + if (h != NULL + /* This is an absolute symbol. It represents a value instead + of an address. */ + && ((h->root.type == bfd_link_hash_defined + && bfd_is_abs_section (h->root.u.def.section)) + /* This is an undefined symbol. */ + || h->root.type == bfd_link_hash_undefined)) + break; + + /* For local symbols, defined global symbols in a non-ABS section, + it is assumed that the value is an address. */ int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START; _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against `%s' can not be used when making " + (_("%pB: relocation %s against `%s' can not be used when making " "a shared object"), abfd, elfNN_aarch64_howto_table[howto_index].name, (h) ? h->root.root.string : "a local symbol"); @@ -7100,7 +7240,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info, int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START; _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against `%s' can not be used when making " + (_("%pB: relocation %s against `%s' can not be used when making " "a shared object; recompile with -fPIC"), abfd, elfNN_aarch64_howto_table[howto_index].name, (h) ? h->root.root.string : "a local symbol"); @@ -7532,7 +7672,7 @@ elfNN_aarch64_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSE 0, &sym)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B symbol number %lu references" + _bfd_error_handler (_("%pB symbol number %lu references" " nonexistent SHT_SYMTAB_SHNDX section"), abfd, r_symndx); /* Ideally an error class should be returned here. */ @@ -8316,7 +8456,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -9169,7 +9309,7 @@ elfNN_aarch64_finish_dynamic_sections (bfd *output_bfd, if (bfd_is_abs_section (htab->root.sgotplt->output_section)) { _bfd_error_handler - (_("discarded output section: `%A'"), htab->root.sgotplt); + (_("discarded output section: `%pA'"), htab->root.sgotplt); return FALSE; } diff --git a/bfd/elfnn-ia64.c b/bfd/elfnn-ia64.c index 3af05f6..e6551df 100644 --- a/bfd/elfnn-ia64.c +++ b/bfd/elfnn-ia64.c @@ -197,13 +197,24 @@ static asection *get_pltoff /* Given a ELF reloc, return the matching HOWTO structure. */ -static void +static bfd_boolean elfNN_ia64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc) { - bfd_reloc->howto - = ia64_elf_lookup_howto ((unsigned int) ELFNN_R_TYPE (elf_reloc->r_info)); + unsigned int r_type = ELF32_R_TYPE (elf_reloc->r_info); + + bfd_reloc->howto = ia64_elf_lookup_howto (r_type); + if (bfd_reloc->howto == NULL) + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + return TRUE; } #define PLT_HEADER_SIZE (3 * 16) @@ -593,6 +604,9 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec, 1, change it to slot 2. */ if ((irel->r_offset & 3) == 1) irel->r_offset += 1; + + changed_contents = TRUE; + changed_relocs = TRUE; } continue; @@ -607,6 +621,9 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec, /* Make the relocation offset point to slot 1. */ irel->r_offset = (irel->r_offset & ~((bfd_vma) 0x3)) + 1; + + changed_contents = TRUE; + changed_relocs = TRUE; continue; } @@ -617,9 +634,9 @@ elfNN_ia64_relax_section (bfd *abfd, asection *sec, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Can't relax br at %#Lx in section `%A'." - " Please use brl or indirect branch."), - sec->owner, roff, sec); + (_("%pB: can't relax br at %#" PRIx64 " in section `%pA';" + " please use brl or indirect branch"), + sec->owner, (uint64_t) roff, sec); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -3693,8 +3710,8 @@ elfNN_ia64_choose_gp (bfd *abfd, struct bfd_link_info *info, bfd_boolean final) overflow: _bfd_error_handler /* xgettext:c-format */ - (_("%B: short data segment overflowed (%#Lx >= 0x400000)"), - abfd, max_short_vma - min_short_vma); + (_("%pB: short data segment overflowed (%#" PRIx64 " >= 0x400000)"), + abfd, (uint64_t) (max_short_vma - min_short_vma)); return FALSE; } else if ((gp_val > min_short_vma @@ -3703,7 +3720,7 @@ overflow: && max_short_vma - gp_val >= 0x200000)) { _bfd_error_handler - (_("%B: __gp does not cover short data segment"), abfd); + (_("%pB: __gp does not cover short data segment"), abfd); return FALSE; } } @@ -3842,15 +3859,21 @@ elfNN_ia64_relocate_section (bfd *output_bfd, r_type = ELFNN_R_TYPE (rel->r_info); if (r_type > R_IA64_MAX_RELOC_CODE) { - _bfd_error_handler - /* xgettext:c-format */ - (_("%B: unknown relocation type %d"), input_bfd, (int) r_type); + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + input_bfd, (int) r_type); bfd_set_error (bfd_error_bad_value); ret_val = FALSE; continue; } howto = ia64_elf_lookup_howto (r_type); + if (howto == NULL) + { + ret_val = FALSE; + continue; + } + r_symndx = ELFNN_R_SYM (rel->r_info); h = NULL; sym = NULL; @@ -3971,7 +3994,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd, shared libraries nor dynamic executables. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: non-pic code with imm relocation against dynamic symbol `%s'"), + (_("%pB: non-pic code with imm relocation against dynamic symbol `%s'"), input_bfd, h ? h->root.root.string : bfd_elf_sym_name (input_bfd, symtab_hdr, sym, @@ -4039,7 +4062,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: @gprel relocation against dynamic symbol %s"), + (_("%pB: @gprel relocation against dynamic symbol %s"), input_bfd, h ? h->root.root.string : bfd_elf_sym_name (input_bfd, symtab_hdr, sym, @@ -4102,7 +4125,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd, /* ??? People shouldn't be doing non-pic code in shared libraries. Hork. */ _bfd_error_handler - (_("%B: linking non-pic code in a position independent executable"), + (_("%pB: linking non-pic code in a position independent executable"), input_bfd); ret_val = FALSE; continue; @@ -4240,13 +4263,13 @@ elfNN_ia64_relocate_section (bfd *output_bfd, if (r_type == R_IA64_PCREL21BI) /* xgettext:c-format */ - msg = _("%B: @internal branch to dynamic symbol %s"); + msg = _("%pB: @internal branch to dynamic symbol %s"); else if (r_type == R_IA64_PCREL21F || r_type == R_IA64_PCREL21M) /* xgettext:c-format */ - msg = _("%B: speculation fixup to dynamic symbol %s"); + msg = _("%pB: speculation fixup to dynamic symbol %s"); else /* xgettext:c-format */ - msg = _("%B: @pcrel relocation against dynamic symbol %s"); + msg = _("%pB: @pcrel relocation against dynamic symbol %s"); _bfd_error_handler (msg, input_bfd, h ? h->root.root.string : bfd_elf_sym_name (input_bfd, @@ -4481,10 +4504,10 @@ missing_tls_sec: case R_IA64_LTOFF_DTPREL22: _bfd_error_handler /* xgettext:c-format */ - (_("%B: missing TLS section for relocation %s against `%s'" - " at %#Lx in section `%A'."), + (_("%pB: missing TLS section for relocation %s against `%s'" + " at %#" PRIx64 " in section `%pA'."), input_bfd, howto->name, name, - rel->r_offset, input_section); + (uint64_t) rel->r_offset, input_section); break; case R_IA64_PCREL21B: @@ -4498,10 +4521,11 @@ missing_tls_sec: that the section is too big to relax. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: Can't relax br (%s) to `%s' at %#Lx" - " in section `%A' with size %#Lx (> 0x1000000)."), - input_bfd, howto->name, name, rel->r_offset, - input_section, input_section->size); + (_("%pB: Can't relax br (%s) to `%s' at %#" PRIx64 + " in section `%pA' with size %#" PRIx64 + " (> 0x1000000)."), + input_bfd, howto->name, name, (uint64_t) rel->r_offset, + input_section, (uint64_t) input_section->size); break; } /* Fall through. */ @@ -4755,7 +4779,7 @@ elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL)) { _bfd_error_handler - (_("%B: linking trap-on-NULL-dereference with non-trapping files"), + (_("%pB: linking trap-on-NULL-dereference with non-trapping files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -4764,7 +4788,7 @@ elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE)) { _bfd_error_handler - (_("%B: linking big-endian files with little-endian files"), + (_("%pB: linking big-endian files with little-endian files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -4773,7 +4797,7 @@ elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64)) { _bfd_error_handler - (_("%B: linking 64-bit files with 32-bit files"), + (_("%pB: linking 64-bit files with 32-bit files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -4782,7 +4806,7 @@ elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP)) { _bfd_error_handler - (_("%B: linking constant-gp files with non-constant-gp files"), + (_("%pB: linking constant-gp files with non-constant-gp files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -4792,7 +4816,7 @@ elfNN_ia64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) != (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP)) { _bfd_error_handler - (_("%B: linking auto-pic files with non-auto-pic files"), + (_("%pB: linking auto-pic files with non-auto-pic files"), ibfd); bfd_set_error (bfd_error_bad_value); @@ -5046,7 +5070,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, #define elf_backend_size_dynamic_sections \ elfNN_ia64_size_dynamic_sections #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + _bfd_elf_omit_section_dynsym_all #define elf_backend_relocate_section \ elfNN_ia64_relocate_section #define elf_backend_finish_dynamic_symbol \ @@ -5064,6 +5088,7 @@ elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, elfNN_ia64_print_private_bfd_data #define elf_backend_plt_readonly 1 +#define elf_backend_can_gc_sections 1 #define elf_backend_want_plt_sym 0 #define elf_backend_plt_alignment 5 #define elf_backend_got_header_size 0 diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c index 5f66f4f..582c8d1 100644 --- a/bfd/elfnn-riscv.c +++ b/bfd/elfnn-riscv.c @@ -121,12 +121,13 @@ struct riscv_elf_link_hash_table (elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \ == RISCV_ELF_DATA ? ((struct riscv_elf_link_hash_table *) ((p)->hash)) : NULL) -static void -riscv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, +static bfd_boolean +riscv_info_to_howto_rela (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { - cache_ptr->howto = riscv_elf_rtype_to_howto (ELFNN_R_TYPE (dst->r_info)); + cache_ptr->howto = riscv_elf_rtype_to_howto (abfd, ELFNN_R_TYPE (dst->r_info)); + return cache_ptr->howto != NULL; } static void @@ -424,7 +425,7 @@ riscv_elf_record_tls_type (bfd *abfd, struct elf_link_hash_entry *h, if ((*new_tls_type & GOT_NORMAL) && (*new_tls_type & ~GOT_NORMAL)) { (*_bfd_error_handler) - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h ? h->root.root.string : ""); return FALSE; } @@ -467,11 +468,13 @@ riscv_elf_record_got_reference (bfd *abfd, struct bfd_link_info *info, static bfd_boolean bad_static_reloc (bfd *abfd, unsigned r_type, struct elf_link_hash_entry *h) { + reloc_howto_type * r = riscv_elf_rtype_to_howto (abfd, r_type); + (*_bfd_error_handler) - (_("%B: relocation %s against `%s' can not be used when making a shared " + (_("%pB: relocation %s against `%s' can not be used when making a shared " "object; recompile with -fPIC"), - abfd, riscv_elf_rtype_to_howto (r_type)->name, - h != NULL ? h->root.root.string : "a local symbol"); + abfd, r ? r->name : _(""), + h != NULL ? h->root.root.string : "a local symbol"); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -510,7 +513,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { - (*_bfd_error_handler) (_("%B: bad symbol index: %d"), + (*_bfd_error_handler) (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -624,9 +627,11 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, may need to keep relocations for symbols satisfied by a dynamic library if we manage to avoid copy relocs for the symbol. */ + reloc_howto_type * r = riscv_elf_rtype_to_howto (abfd, r_type); + if ((bfd_link_pic (info) && (sec->flags & SEC_ALLOC) != 0 - && (! riscv_elf_rtype_to_howto (r_type)->pc_relative + && ((r != NULL && ! r->pc_relative) || (h != NULL && (! info->symbolic || h->root.type == bfd_link_hash_defweak @@ -696,7 +701,7 @@ riscv_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, } p->count += 1; - p->pc_count += riscv_elf_rtype_to_howto (r_type)->pc_relative; + p->pc_count += r == NULL ? 0 : r->pc_relative; } break; @@ -1109,7 +1114,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -1724,10 +1729,11 @@ riscv_elf_relocate_section (bfd *output_bfd, bfd_boolean unresolved_reloc, is_ie = FALSE; bfd_vma pc = sec_addr (input_section) + rel->r_offset; int r_type = ELFNN_R_TYPE (rel->r_info), tls_type; - reloc_howto_type *howto = riscv_elf_rtype_to_howto (r_type); + reloc_howto_type *howto = riscv_elf_rtype_to_howto (input_bfd, r_type); const char *msg = NULL; - if (r_type == R_RISCV_GNU_VTINHERIT || r_type == R_RISCV_GNU_VTENTRY) + if (howto == NULL + || r_type == R_RISCV_GNU_VTINHERIT || r_type == R_RISCV_GNU_VTENTRY) continue; /* This is a final link. */ @@ -1888,9 +1894,11 @@ riscv_elf_relocate_section (bfd *output_bfd, howto, input_bfd); r_type = ELFNN_R_TYPE (rel->r_info); - howto = riscv_elf_rtype_to_howto (r_type); - if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc, - relocation, absolute)) + howto = riscv_elf_rtype_to_howto (input_bfd, r_type); + if (howto == NULL) + r = bfd_reloc_notsupported; + else if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc, + relocation, absolute)) r = bfd_reloc_overflow; break; @@ -1984,15 +1992,27 @@ riscv_elf_relocate_section (bfd *output_bfd, howto, input_bfd); r_type = ELFNN_R_TYPE (rel->r_info); - howto = riscv_elf_rtype_to_howto (r_type); - if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc, - relocation + rel->r_addend, - absolute)) + howto = riscv_elf_rtype_to_howto (input_bfd, r_type); + if (howto == NULL) + r = bfd_reloc_notsupported; + else if (!riscv_record_pcrel_hi_reloc (&pcrel_relocs, pc, + relocation + rel->r_addend, + absolute)) r = bfd_reloc_overflow; break; case R_RISCV_PCREL_LO12_I: case R_RISCV_PCREL_LO12_S: + /* Addends are not allowed, because then riscv_relax_delete_bytes + would have to search through all relocs to update the addends. + Also, riscv_resolve_pcrel_lo_relocs does not support addends + when searching for a matching hi reloc. */ + if (rel->r_addend) + { + r = bfd_reloc_dangerous; + break; + } + if (riscv_record_pcrel_lo_reloc (&pcrel_relocs, input_section, info, howto, rel, relocation, name, contents)) @@ -2203,10 +2223,11 @@ riscv_elf_relocate_section (bfd *output_bfd, rel->r_offset) != (bfd_vma) -1) { (*_bfd_error_handler) - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); continue; @@ -2234,25 +2255,30 @@ riscv_elf_relocate_section (bfd *output_bfd, break; case bfd_reloc_outofrange: - msg = _("internal error: out of range error"); + msg = _("%X%P: internal error: out of range error\n"); break; case bfd_reloc_notsupported: - msg = _("internal error: unsupported relocation error"); + msg = _("%X%P: internal error: unsupported relocation error\n"); break; case bfd_reloc_dangerous: - msg = _("internal error: dangerous relocation"); + info->callbacks->reloc_dangerous + (info, "%pcrel_lo with addend", input_bfd, input_section, + rel->r_offset); break; default: - msg = _("internal error: unknown error"); + msg = _("%X%P: internal error: unknown error\n"); break; } if (msg) - info->callbacks->warning - (info, msg, name, input_bfd, input_section, rel->r_offset); + info->callbacks->einfo (msg); + + /* We already reported the error via a callback, so don't try to report + it again by returning false. That leads to spurious errors. */ + ret = TRUE; goto out; } @@ -2489,7 +2515,7 @@ riscv_elf_finish_dynamic_sections (bfd *output_bfd, if (bfd_is_abs_section (output_section)) { (*_bfd_error_handler) - (_("discarded output section: `%A'"), htab->elf.sgotplt); + (_("discarded output section: `%pA'"), htab->elf.sgotplt); return FALSE; } @@ -2567,7 +2593,7 @@ _bfd_riscv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0) { (*_bfd_error_handler) - (_("%B: ABI is incompatible with that of the selected emulation:\n" + (_("%pB: ABI is incompatible with that of the selected emulation:\n" " target emulation `%s' does not match `%s'"), ibfd, bfd_get_target (ibfd), bfd_get_target (obfd)); return FALSE; @@ -2587,7 +2613,7 @@ _bfd_riscv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if ((old_flags ^ new_flags) & EF_RISCV_FLOAT_ABI) { (*_bfd_error_handler) - (_("%B: can't link hard-float modules with soft-float modules"), ibfd); + (_("%pB: can't link hard-float modules with soft-float modules"), ibfd); goto fail; } @@ -2604,7 +2630,8 @@ fail: /* Delete some bytes from a section while relaxing. */ static bfd_boolean -riscv_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, size_t count) +riscv_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, size_t count, + struct bfd_link_info *link_info) { unsigned int i, symcount; bfd_vma toaddr = sec->size; @@ -2638,10 +2665,16 @@ riscv_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, size_t count) /* If the symbol *spans* the bytes we just deleted (i.e. its *end* is in the moved bytes but its *start* isn't), then we - must adjust its size. */ - if (sym->st_value <= addr - && sym->st_value + sym->st_size > addr - && sym->st_value + sym->st_size <= toaddr) + must adjust its size. + + This test needs to use the original value of st_value, otherwise + we might accidentally decrease size when deleting bytes right + before the symbol. But since deleted relocs can't span across + symbols, we can't have both a st_value and a st_size decrease, + so it is simpler to just use an else. */ + else if (sym->st_value <= addr + && sym->st_value + sym->st_size > addr + && sym->st_value + sym->st_size <= toaddr) sym->st_size -= count; } } @@ -2654,6 +2687,31 @@ riscv_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, size_t count) { struct elf_link_hash_entry *sym_hash = sym_hashes[i]; + /* The '--wrap SYMBOL' option is causing a pain when the object file, + containing the definition of __wrap_SYMBOL, includes a direct + call to SYMBOL as well. Since both __wrap_SYMBOL and SYMBOL reference + the same symbol (which is __wrap_SYMBOL), but still exist as two + different symbols in 'sym_hashes', we don't want to adjust + the global symbol __wrap_SYMBOL twice. + This check is only relevant when symbols are being wrapped. */ + if (link_info->wrap_hash != NULL) + { + struct elf_link_hash_entry **cur_sym_hashes; + + /* Loop only over the symbols which have already been checked. */ + for (cur_sym_hashes = sym_hashes; cur_sym_hashes < &sym_hashes[i]; + cur_sym_hashes++) + { + /* If the current symbol is identical to 'sym_hash', that means + the symbol was already adjusted (or at least checked). */ + if (*cur_sym_hashes == sym_hash) + break; + } + /* Don't adjust the symbol again. */ + if (cur_sym_hashes < &sym_hashes[i]) + continue; + } + if ((sym_hash->root.type == bfd_link_hash_defined || sym_hash->root.type == bfd_link_hash_defweak) && sym_hash->root.u.def.section == sec) @@ -2664,9 +2722,9 @@ riscv_relax_delete_bytes (bfd *abfd, asection *sec, bfd_vma addr, size_t count) sym_hash->root.u.def.value -= count; /* As above, adjust the size if needed. */ - if (sym_hash->root.u.def.value <= addr - && sym_hash->root.u.def.value + sym_hash->size > addr - && sym_hash->root.u.def.value + sym_hash->size <= toaddr) + else if (sym_hash->root.u.def.value <= addr + && sym_hash->root.u.def.value + sym_hash->size > addr + && sym_hash->root.u.def.value + sym_hash->size <= toaddr) sym_hash->size -= count; } } @@ -2886,7 +2944,8 @@ _bfd_riscv_relax_call (bfd *abfd, asection *sec, asection *sym_sec, /* Delete unnecessary JALR. */ *again = TRUE; - return riscv_relax_delete_bytes (abfd, sec, rel->r_offset + len, 8 - len); + return riscv_relax_delete_bytes (abfd, sec, rel->r_offset + len, 8 - len, + link_info); } /* Traverse all output sections and return the max alignment. */ @@ -2964,7 +3023,8 @@ _bfd_riscv_relax_lui (bfd *abfd, /* We can delete the unnecessary LUI and reloc. */ rel->r_info = ELFNN_R_INFO (0, R_RISCV_NONE); *again = TRUE; - return riscv_relax_delete_bytes (abfd, sec, rel->r_offset, 4); + return riscv_relax_delete_bytes (abfd, sec, rel->r_offset, 4, + link_info); default: abort (); @@ -2991,7 +3051,8 @@ _bfd_riscv_relax_lui (bfd *abfd, rel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (rel->r_info), R_RISCV_RVC_LUI); *again = TRUE; - return riscv_relax_delete_bytes (abfd, sec, rel->r_offset + 2, 2); + return riscv_relax_delete_bytes (abfd, sec, rel->r_offset + 2, 2, + link_info); } return TRUE; @@ -3031,7 +3092,7 @@ _bfd_riscv_relax_tls_le (bfd *abfd, /* We can delete the unnecessary instruction and reloc. */ rel->r_info = ELFNN_R_INFO (0, R_RISCV_NONE); *again = TRUE; - return riscv_relax_delete_bytes (abfd, sec, rel->r_offset, 4); + return riscv_relax_delete_bytes (abfd, sec, rel->r_offset, 4, link_info); default: abort (); @@ -3043,7 +3104,7 @@ _bfd_riscv_relax_tls_le (bfd *abfd, static bfd_boolean _bfd_riscv_relax_align (bfd *abfd, asection *sec, asection *sym_sec, - struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info, Elf_Internal_Rela *rel, bfd_vma symval, bfd_vma max_alignment ATTRIBUTE_UNUSED, @@ -3066,10 +3127,11 @@ _bfd_riscv_relax_align (bfd *abfd, asection *sec, /* Make sure there are enough NOPs to actually achieve the alignment. */ if (rel->r_addend < nop_bytes) { - (*_bfd_error_handler) - (_("%B(%A+0x%lx): %d bytes required for alignment " - "to %d-byte boundary, but only %d present"), - abfd, sym_sec, rel->r_offset, nop_bytes, alignment, rel->r_addend); + _bfd_error_handler + (_("%pB(%pA+%#" PRIx64 "): %" PRId64 " bytes required for alignment " + "to %" PRId64 "-byte boundary, but only %" PRId64 " present"), + abfd, sym_sec, (uint64_t) rel->r_offset, + (int64_t) nop_bytes, (int64_t) alignment, (int64_t) rel->r_addend); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3091,7 +3153,7 @@ _bfd_riscv_relax_align (bfd *abfd, asection *sec, /* Delete the excess bytes. */ return riscv_relax_delete_bytes (abfd, sec, rel->r_offset + nop_bytes, - rel->r_addend - nop_bytes); + rel->r_addend - nop_bytes, link_info); } /* Relax PC-relative references to GP-relative references. */ @@ -3114,7 +3176,8 @@ _bfd_riscv_relax_pc (bfd *abfd, /* Chain the _LO relocs to their cooresponding _HI reloc to compute the * actual target address. */ - riscv_pcgp_hi_reloc hi_reloc = {0}; + riscv_pcgp_hi_reloc hi_reloc; + memset (&hi_reloc, 0, sizeof (hi_reloc)); switch (ELFNN_R_TYPE (rel->r_info)) { case R_RISCV_PCREL_LO12_I: @@ -3132,10 +3195,10 @@ _bfd_riscv_relax_pc (bfd *abfd, symval = hi_reloc.hi_addr; sym_sec = hi_reloc.sym_sec; if (!riscv_use_pcgp_hi_reloc(pcgp_relocs, hi->hi_sec_off)) - (*_bfd_error_handler) - (_("%B(%A+0x%lx): Unable to clear RISCV_PCREL_HI20 reloc" - "for cooresponding RISCV_PCREL_LO12 reloc"), - abfd, sec, rel->r_offset); + _bfd_error_handler + (_("%pB(%pA+%#" PRIx64 "): Unable to clear RISCV_PCREL_HI20 reloc " + "for corresponding RISCV_PCREL_LO12 reloc"), + abfd, sec, (uint64_t) rel->r_offset); } break; @@ -3212,7 +3275,7 @@ static bfd_boolean _bfd_riscv_relax_delete (bfd *abfd, asection *sec, asection *sym_sec ATTRIBUTE_UNUSED, - struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info, Elf_Internal_Rela *rel, bfd_vma symval ATTRIBUTE_UNUSED, bfd_vma max_alignment ATTRIBUTE_UNUSED, @@ -3220,7 +3283,8 @@ _bfd_riscv_relax_delete (bfd *abfd, bfd_boolean *again ATTRIBUTE_UNUSED, riscv_pcgp_relocs *pcgp_relocs ATTRIBUTE_UNUSED) { - if (!riscv_relax_delete_bytes(abfd, sec, rel->r_offset, rel->r_addend)) + if (!riscv_relax_delete_bytes(abfd, sec, rel->r_offset, rel->r_addend, + link_info)) return FALSE; rel->r_info = ELFNN_R_INFO(0, R_RISCV_NONE); return TRUE; @@ -3353,8 +3417,14 @@ _bfd_riscv_relax_section (bfd *abfd, asection *sec, { BFD_ASSERT (isym->st_shndx < elf_numsections (abfd)); sym_sec = elf_elfsections (abfd)[isym->st_shndx]->bfd_section; +#if 0 + /* The purpose of this code is unknown. It breaks linker scripts + for embedded development that place sections at address zero. + This code is believed to be unnecessary. Disabling it but not + yet removing it, in case something breaks. */ if (sec_addr (sym_sec) == 0) continue; +#endif symval = sec_addr (sym_sec) + isym->st_value; } } diff --git a/bfd/elfxx-aarch64.c b/bfd/elfxx-aarch64.c index 9d4aa8f..4fa5682 100644 --- a/bfd/elfxx-aarch64.c +++ b/bfd/elfxx-aarch64.c @@ -301,6 +301,10 @@ _bfd_aarch64_elf_put_addend (bfd *abfd, case BFD_RELOC_AARCH64_MOVW_G0_S: case BFD_RELOC_AARCH64_MOVW_G1_S: case BFD_RELOC_AARCH64_MOVW_G2_S: + case BFD_RELOC_AARCH64_MOVW_PREL_G0: + case BFD_RELOC_AARCH64_MOVW_PREL_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G2: + case BFD_RELOC_AARCH64_MOVW_PREL_G3: case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0: case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1: case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2: @@ -333,6 +337,9 @@ _bfd_aarch64_elf_put_addend (bfd *abfd, case BFD_RELOC_AARCH64_MOVW_G3: case BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC: case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC: case BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC: case BFD_RELOC_AARCH64_TLSDESC_OFF_G1: case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC: @@ -395,6 +402,13 @@ _bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type, case BFD_RELOC_AARCH64_ADR_LO21_PCREL: case BFD_RELOC_AARCH64_BRANCH19: case BFD_RELOC_AARCH64_LD_LO19_PCREL: + case BFD_RELOC_AARCH64_MOVW_PREL_G0: + case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G2: + case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G3: case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21: case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19: case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21: diff --git a/bfd/elfxx-ia64.c b/bfd/elfxx-ia64.c index 97b67e6..290dcd8 100644 --- a/bfd/elfxx-ia64.c +++ b/bfd/elfxx-ia64.c @@ -196,12 +196,12 @@ static unsigned char elf_code_to_howto_index[R_IA64_MAX_RELOC_CODE + 1]; reloc_howto_type * ia64_elf_lookup_howto (unsigned int rtype) { - static int inited = 0; + static bfd_boolean inited = FALSE; int i; if (!inited) { - inited = 1; + inited = TRUE; memset (elf_code_to_howto_index, 0xff, sizeof (elf_code_to_howto_index)); for (i = 0; i < NELEMS (ia64_howto_table); ++i) @@ -209,15 +209,15 @@ ia64_elf_lookup_howto (unsigned int rtype) } if (rtype > R_IA64_MAX_RELOC_CODE) - return 0; + return NULL; i = elf_code_to_howto_index[rtype]; if (i >= NELEMS (ia64_howto_table)) - return 0; + return NULL; return ia64_howto_table + i; } -reloc_howto_type* -ia64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, +reloc_howto_type * +ia64_elf_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type bfd_code) { unsigned int rtype; @@ -320,7 +320,12 @@ ia64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, case BFD_RELOC_IA64_DTPREL64LSB: rtype = R_IA64_DTPREL64LSB; break; case BFD_RELOC_IA64_LTOFF_DTPREL22: rtype = R_IA64_LTOFF_DTPREL22; break; - default: return 0; + default: + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, (int) bfd_code); + bfd_set_error (bfd_error_bad_value); + return NULL; } return ia64_elf_lookup_howto (rtype); } diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index fc49f2f..ce64581 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -881,7 +881,7 @@ static bfd *reldyn_sorting_bfd; _bfd_elf_add_dynamic_entry (info, tag, val) #define MIPS_ELF_RTYPE_TO_HOWTO(abfd, rtype, rela) \ - (get_elf_backend_data (abfd)->elf_backend_mips_rtype_to_howto (rtype, rela)) + (get_elf_backend_data (abfd)->elf_backend_mips_rtype_to_howto (abfd, rtype, rela)) /* The name of the dynamic relocation section. */ #define MIPS_ELF_REL_DYN_NAME(INFO) \ @@ -5478,12 +5478,18 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd, } else { + bfd_boolean reject_undefined + = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR + || ELF_ST_VISIBILITY (h->root.other) != STV_DEFAULT); + (*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, - input_section, relocation->r_offset, - (info->unresolved_syms_in_objects == RM_GENERATE_ERROR) - || ELF_ST_VISIBILITY (h->root.other)); - return bfd_reloc_undefined; + input_section, relocation->r_offset, reject_undefined); + + if (reject_undefined) + return bfd_reloc_undefined; + + symbol = 0; } target_is_16_bit_code_p = ELF_ST_IS_MIPS16 (h->root.other); @@ -6373,7 +6379,7 @@ mips_elf_perform_relocation (struct bfd_link_info *info, : opcode == 0x1d) { info->callbacks->einfo - (_("%X%H: Unsupported JALX to the same ISA mode\n"), + (_("%X%H: unsupported JALX to the same ISA mode\n"), input_bfd, input_section, relocation->r_offset); return TRUE; } @@ -6406,7 +6412,7 @@ mips_elf_perform_relocation (struct bfd_link_info *info, if (!ok) { info->callbacks->einfo - (_("%X%H: Unsupported jump between ISA modes; " + (_("%X%H: unsupported jump between ISA modes; " "consider recompiling with interlinking enabled\n"), input_bfd, input_section, relocation->r_offset); return TRUE; @@ -6451,7 +6457,7 @@ mips_elf_perform_relocation (struct bfd_link_info *info, if ((addr >> 28) << 28 != (dest >> 28) << 28) { info->callbacks->einfo - (_("%X%H: Cannot convert branch between ISA modes " + (_("%X%H: cannot convert branch between ISA modes " "to JALX: relocation out of range\n"), input_bfd, input_section, relocation->r_offset); return TRUE; @@ -6463,7 +6469,7 @@ mips_elf_perform_relocation (struct bfd_link_info *info, else if (!mips_elf_hash_table (info)->ignore_branch_isa) { info->callbacks->einfo - (_("%X%H: Unsupported branch between ISA modes\n"), + (_("%X%H: unsupported branch between ISA modes\n"), input_bfd, input_section, relocation->r_offset); return TRUE; } @@ -7102,9 +7108,19 @@ _bfd_mips_elf_section_processing (bfd *abfd, Elf_Internal_Shdr *hdr) { bfd_byte buf[4]; - BFD_ASSERT (hdr->sh_size == sizeof (Elf32_External_RegInfo)); BFD_ASSERT (hdr->contents == NULL); + if (hdr->sh_size != sizeof (Elf32_External_RegInfo)) + { + _bfd_error_handler + (_("%pB: incorrect `.reginfo' section size; " + "expected %" PRIu64 ", got %" PRIu64), + abfd, (uint64_t) sizeof (Elf32_External_RegInfo), + (uint64_t) hdr->sh_size); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + if (bfd_seek (abfd, hdr->sh_offset + sizeof (Elf32_External_RegInfo) - 4, SEEK_SET) != 0) @@ -7141,7 +7157,7 @@ _bfd_mips_elf_section_processing (bfd *abfd, Elf_Internal_Shdr *hdr) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Warning: bad `%s' option size %u smaller than" + (_("%pB: warning: bad `%s' option size %u smaller than" " its header"), abfd, MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size); break; @@ -7376,7 +7392,7 @@ _bfd_mips_elf_section_from_shdr (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Warning: bad `%s' option size %u smaller than" + (_("%pB: warning: bad `%s' option size %u smaller than" " its header"), abfd, MIPS_ELF_OPTIONS_SECTION_NAME (abfd), intopt.size); break; @@ -8132,7 +8148,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Warning: cannot determine the target function for" + (_("%pB: warning: cannot determine the target function for" " stub section `%s'"), abfd, name); bfd_set_error (bfd_error_bad_value); @@ -8258,7 +8274,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Warning: cannot determine the target function for" + (_("%pB: warning: cannot determine the target function for" " stub section `%s'"), abfd, name); bfd_set_error (bfd_error_bad_value); @@ -8390,7 +8406,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Malformed reloc detected for section %s"), + (_("%pB: malformed reloc detected for section %s"), abfd, name); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -8462,8 +8478,8 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: GOT reloc at %#Lx not expected in executables"), - abfd, rel->r_offset); + (_("%pB: GOT reloc at %#" PRIx64 " not expected in executables"), + abfd, (uint64_t) rel->r_offset); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -8600,8 +8616,8 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: CALL16 reloc at %#Lx not against global symbol"), - abfd, rel->r_offset); + (_("%pB: CALL16 reloc at %#" PRIx64 " not against global symbol"), + abfd, (uint64_t) rel->r_offset); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -8886,7 +8902,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, howto = MIPS_ELF_RTYPE_TO_HOWTO (abfd, r_type, FALSE); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against `%s' can not be used" + (_("%pB: relocation %s against `%s' can not be used" " when making a shared object; recompile with -fPIC"), abfd, howto->name, (h) ? h->root.root.string : "a local symbol"); @@ -9284,12 +9300,19 @@ _bfd_mips_elf_always_size_sections (bfd *output_bfd, /* The .reginfo section has a fixed size. */ sect = bfd_get_section_by_name (output_bfd, ".reginfo"); if (sect != NULL) - bfd_set_section_size (output_bfd, sect, sizeof (Elf32_External_RegInfo)); + { + bfd_set_section_size (output_bfd, sect, sizeof (Elf32_External_RegInfo)); + sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; + } /* The .MIPS.abiflags section has a fixed size. */ sect = bfd_get_section_by_name (output_bfd, ".MIPS.abiflags"); if (sect != NULL) - bfd_set_section_size (output_bfd, sect, sizeof (Elf_External_ABIFlags_v0)); + { + bfd_set_section_size (output_bfd, sect, + sizeof (Elf_External_ABIFlags_v0)); + sect->flags |= SEC_FIXED_SIZE | SEC_HAS_CONTENTS; + } hti.info = info; hti.output_bfd = output_bfd; @@ -10143,10 +10166,10 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, sec); _bfd_error_handler /* xgettext:c-format */ - (_("%B: Can't find matching LO16 reloc against `%s'" - " for %s at %#Lx in section `%A'"), + (_("%pB: can't find matching LO16 reloc against `%s'" + " for %s at %#" PRIx64 " in section `%pA'"), input_bfd, name, - howto->name, rel->r_offset, input_section); + howto->name, (uint64_t) rel->r_offset, input_section); } } else @@ -10302,16 +10325,16 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, msg = NULL; if (jal_reloc_p (howto->type)) msg = (cross_mode_jump_p - ? _("Cannot convert a jump to JALX " + ? _("cannot convert a jump to JALX " "for a non-word-aligned address") : (howto->type == R_MIPS16_26 - ? _("Jump to a non-word-aligned address") - : _("Jump to a non-instruction-aligned address"))); + ? _("jump to a non-word-aligned address") + : _("jump to a non-instruction-aligned address"))); else if (b_reloc_p (howto->type)) msg = (cross_mode_jump_p - ? _("Cannot convert a branch to JALX " + ? _("cannot convert a branch to JALX " "for a non-word-aligned address") - : _("Branch to a non-instruction-aligned address")); + : _("branch to a non-instruction-aligned address")); else if (aligned_pcrel_reloc_p (howto->type)) msg = _("PC-relative load from unaligned address"); if (msg) @@ -10687,11 +10710,11 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%A' offset of %Ld from `%A' " + (_("%pB: `%pA' offset of %" PRId64 " from `%pA' " "beyond the range of ADDIUPC"), output_bfd, htab->root.sgotplt->output_section, - gotpc_offset, + (int64_t) gotpc_offset, htab->root.splt->output_section); bfd_set_error (bfd_error_no_error); return FALSE; @@ -11255,10 +11278,11 @@ mips_finish_exec_plt (bfd *output_bfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%A' offset of %Ld from `%A' beyond the range of ADDIUPC"), + (_("%pB: `%pA' offset of %" PRId64 " from `%pA' " + "beyond the range of ADDIUPC"), output_bfd, htab->root.sgotplt->output_section, - gotpc_offset, + (int64_t) gotpc_offset, htab->root.splt->output_section); bfd_set_error (bfd_error_no_error); return FALSE; @@ -12657,13 +12681,29 @@ _bfd_mips_elf_find_nearest_line (bfd *abfd, asymbol **symbols, line_ptr, discriminator_ptr, dwarf_debug_sections, ABI_64_P (abfd) ? 8 : 0, - &elf_tdata (abfd)->dwarf2_find_line_info)) - return TRUE; + &elf_tdata (abfd)->dwarf2_find_line_info) + || _bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset, + filename_ptr, functionname_ptr, + line_ptr)) + { + /* PR 22789: If the function name or filename was not found through + the debug information, then try an ordinary lookup instead. */ + if ((functionname_ptr != NULL && *functionname_ptr == NULL) + || (filename_ptr != NULL && *filename_ptr == NULL)) + { + /* Do not override already discovered names. */ + if (functionname_ptr != NULL && *functionname_ptr != NULL) + functionname_ptr = NULL; - if (_bfd_dwarf1_find_nearest_line (abfd, symbols, section, offset, - filename_ptr, functionname_ptr, - line_ptr)) - return TRUE; + if (filename_ptr != NULL && *filename_ptr != NULL) + filename_ptr = NULL; + + _bfd_elf_find_function (abfd, symbols, section, offset, + filename_ptr, functionname_ptr); + } + + return TRUE; + } msec = bfd_get_section_by_name (abfd, ".mdebug"); if (msec != NULL) @@ -14118,7 +14158,7 @@ update_mips_abiflags_isa (bfd *abfd, Elf_Internal_ABIFlags_v0 *abiflags) default: _bfd_error_handler /* xgettext:c-format */ - (_("%B: Unknown architecture %s"), + (_("%pB: unknown architecture %s"), abfd, bfd_printable_name (abfd)); } @@ -14341,6 +14381,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info) bfd *input_bfd; Elf32_External_RegInfo ext; Elf32_RegInfo sub; + bfd_size_type sz; if (p->type != bfd_indirect_link_order) { @@ -14352,8 +14393,11 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info) input_section = p->u.indirect.section; input_bfd = input_section->owner; + sz = (input_section->size < sizeof (ext) + ? input_section->size : sizeof (ext)); + memset (&ext, 0, sizeof (ext)); if (! bfd_get_section_contents (input_bfd, input_section, - &ext, 0, sizeof ext)) + &ext, 0, sz)) return FALSE; bfd_mips_elf32_swap_reginfo_in (input_bfd, &ext, &sub); @@ -14365,7 +14409,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info) reginfo.ri_cprmask[3] |= sub.ri_cprmask[3]; /* ri_gp_value is set by the function - mips_elf32_section_processing when the section is + `_bfd_mips_elf_section_processing' when the section is finally written out. */ /* Hack: reset the SEC_HAS_CONTENTS flag so that @@ -14374,15 +14418,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info) } /* Size has been set in _bfd_mips_elf_always_size_sections. */ - if (o->size != sizeof (Elf32_External_RegInfo)) - { - _bfd_error_handler - (_("%B: .reginfo section size should be %d bytes, " - "actual size is %d"), - abfd, sizeof (Elf32_External_RegInfo), o->size); - - return FALSE; - } + BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo)); /* Skip this section later on (I don't think this currently matters, but someday it might). */ @@ -14656,7 +14692,7 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: illegal section name `%A'"), abfd, o); + (_("%pB: illegal section name `%pA'"), abfd, o); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; } @@ -14933,7 +14969,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info) != ((old_flags & (EF_MIPS_PIC | EF_MIPS_CPIC)) != 0)) { _bfd_error_handler - (_("%B: warning: linking abicalls files with non-abicalls files"), + (_("%pB: warning: linking abicalls files with non-abicalls files"), ibfd); ok = TRUE; } @@ -14950,7 +14986,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info) if (mips_32bit_flags_p (old_flags) != mips_32bit_flags_p (new_flags)) { _bfd_error_handler - (_("%B: linking 32-bit code with 64-bit code"), + (_("%pB: linking 32-bit code with 64-bit code"), ibfd); ok = FALSE; } @@ -14982,7 +15018,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info) /* The ISAs aren't compatible. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: linking %s module with previous %s modules"), + (_("%pB: linking %s module with previous %s modules"), ibfd, bfd_printable_name (ibfd), bfd_printable_name (obfd)); @@ -15006,7 +15042,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: ABI mismatch: linking %s module with previous %s modules"), + (_("%pB: ABI mismatch: linking %s module with previous %s modules"), ibfd, elf_mips_abi_name (ibfd), elf_mips_abi_name (obfd)); @@ -15031,7 +15067,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: ASE mismatch: linking %s module with previous %s modules"), + (_("%pB: ASE mismatch: linking %s module with previous %s modules"), ibfd, m16_mis ? "MIPS16" : "microMIPS", m16_mis ? "microMIPS" : "MIPS16"); @@ -15048,7 +15084,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info) if ((new_flags & EF_MIPS_NAN2008) != (old_flags & EF_MIPS_NAN2008)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: linking %s module with previous %s modules"), + _bfd_error_handler (_("%pB: linking %s module with previous %s modules"), ibfd, (new_flags & EF_MIPS_NAN2008 ? "-mnan=2008" : "-mnan=legacy"), @@ -15063,7 +15099,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info) if ((new_flags & EF_MIPS_FP64) != (old_flags & EF_MIPS_FP64)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: linking %s module with previous %s modules"), + _bfd_error_handler (_("%pB: linking %s module with previous %s modules"), ibfd, (new_flags & EF_MIPS_FP64 ? "-mfp64" : "-mfp32"), @@ -15079,7 +15115,7 @@ mips_elf_merge_obj_e_flags (bfd *ibfd, struct bfd_link_info *info) { /* xgettext:c-format */ _bfd_error_handler - (_("%B: uses different e_flags (%#x) fields than previous modules " + (_("%pB: uses different e_flags (%#x) fields than previous modules " "(%#x)"), ibfd, new_flags, old_flags); ok = FALSE; @@ -15165,20 +15201,20 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) if (!out_string && !in_string) /* xgettext:c-format */ _bfd_error_handler - (_("Warning: %B uses unknown floating point ABI %d " - "(set by %B), %B uses unknown floating point ABI %d"), + (_("warning: %pB uses unknown floating point ABI %d " + "(set by %pB), %pB uses unknown floating point ABI %d"), obfd, out_fp, abi_fp_bfd, ibfd, in_fp); else if (!out_string) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses unknown floating point ABI %d " - "(set by %B), %B uses %s"), + (_("warning: %pB uses unknown floating point ABI %d " + "(set by %pB), %pB uses %s"), obfd, out_fp, abi_fp_bfd, ibfd, in_string); else if (!in_string) _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses %s (set by %B), " - "%B uses unknown floating point ABI %d"), + (_("warning: %pB uses %s (set by %pB), " + "%pB uses unknown floating point ABI %d"), obfd, out_string, abi_fp_bfd, ibfd, in_fp); else { @@ -15191,7 +15227,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) in_string = "-mhard-float"; _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses %s (set by %B), %B uses %s"), + (_("warning: %pB uses %s (set by %pB), %pB uses %s"), obfd, out_string, abi_fp_bfd, ibfd, in_string); } } @@ -15210,8 +15246,8 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) case Val_GNU_MIPS_ABI_MSA_128: _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses %s (set by %B), " - "%B uses unknown MSA ABI %d"), + (_("warning: %pB uses %s (set by %pB), " + "%pB uses unknown MSA ABI %d"), obfd, "-mmsa", abi_msa_bfd, ibfd, in_attr[Tag_GNU_MIPS_ABI_MSA].i); break; @@ -15222,8 +15258,8 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) case Val_GNU_MIPS_ABI_MSA_128: _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses unknown MSA ABI %d " - "(set by %B), %B uses %s"), + (_("warning: %pB uses unknown MSA ABI %d " + "(set by %pB), %pB uses %s"), obfd, out_attr[Tag_GNU_MIPS_ABI_MSA].i, abi_msa_bfd, ibfd, "-mmsa"); break; @@ -15231,8 +15267,8 @@ mips_elf_merge_obj_attributes (bfd *ibfd, struct bfd_link_info *info) default: _bfd_error_handler /* xgettext:c-format */ - (_("Warning: %B uses unknown MSA ABI %d " - "(set by %B), %B uses unknown MSA ABI %d"), + (_("warning: %pB uses unknown MSA ABI %d " + "(set by %pB), %pB uses unknown MSA ABI %d"), obfd, out_attr[Tag_GNU_MIPS_ABI_MSA].i, abi_msa_bfd, ibfd, in_attr[Tag_GNU_MIPS_ABI_MSA].i); break; @@ -15293,7 +15329,7 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (! _bfd_generic_verify_endian_match (ibfd, info)) { _bfd_error_handler - (_("%B: endianness incompatible with that of the selected emulation"), + (_("%pB: endianness incompatible with that of the selected emulation"), ibfd); return FALSE; } @@ -15307,7 +15343,7 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (strcmp (bfd_get_target (ibfd), bfd_get_target (obfd)) != 0) { _bfd_error_handler - (_("%B: ABI is incompatible with that of the selected emulation"), + (_("%pB: ABI is incompatible with that of the selected emulation"), ibfd); return FALSE; } @@ -15359,27 +15395,27 @@ _bfd_mips_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) if (LEVEL_REV (in_abiflags.isa_level, in_abiflags.isa_rev) < LEVEL_REV (abiflags.isa_level, abiflags.isa_rev)) _bfd_error_handler - (_("%B: warning: Inconsistent ISA between e_flags and " + (_("%pB: warning: inconsistent ISA between e_flags and " ".MIPS.abiflags"), ibfd); if (abiflags.fp_abi != Val_GNU_MIPS_ABI_FP_ANY && in_abiflags.fp_abi != abiflags.fp_abi) _bfd_error_handler - (_("%B: warning: Inconsistent FP ABI between .gnu.attributes and " + (_("%pB: warning: inconsistent FP ABI between .gnu.attributes and " ".MIPS.abiflags"), ibfd); if ((in_abiflags.ases & abiflags.ases) != abiflags.ases) _bfd_error_handler - (_("%B: warning: Inconsistent ASEs between e_flags and " + (_("%pB: warning: inconsistent ASEs between e_flags and " ".MIPS.abiflags"), ibfd); /* The isa_ext is allowed to be an extension of what can be inferred from e_flags. */ if (!mips_mach_extends_p (bfd_mips_isa_ext_mach (abiflags.isa_ext), bfd_mips_isa_ext_mach (in_abiflags.isa_ext))) _bfd_error_handler - (_("%B: warning: Inconsistent ISA extensions between e_flags and " + (_("%pB: warning: inconsistent ISA extensions between e_flags and " ".MIPS.abiflags"), ibfd); if (in_abiflags.flags2 != 0) _bfd_error_handler - (_("%B: warning: Unexpected flag in the flags2 field of " + (_("%pB: warning: unexpected flag in the flags2 field of " ".MIPS.abiflags (0x%lx)"), ibfd, in_abiflags.flags2); } diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index c0f006f..7d4f59f 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -948,11 +948,12 @@ riscv_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) } reloc_howto_type * -riscv_elf_rtype_to_howto (unsigned int r_type) +riscv_elf_rtype_to_howto (bfd *abfd, unsigned int r_type) { if (r_type >= ARRAY_SIZE (howto_table)) { - (*_bfd_error_handler) (_("unrecognized relocation (0x%x)"), r_type); + (*_bfd_error_handler) (_("%pB: unsupported relocation type %#x"), + abfd, r_type); bfd_set_error (bfd_error_bad_value); return NULL; } diff --git a/bfd/elfxx-riscv.h b/bfd/elfxx-riscv.h index 04da5b5..836f05d 100644 --- a/bfd/elfxx-riscv.h +++ b/bfd/elfxx-riscv.h @@ -30,4 +30,4 @@ extern reloc_howto_type * riscv_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); extern reloc_howto_type * -riscv_elf_rtype_to_howto (unsigned int r_type); +riscv_elf_rtype_to_howto (bfd *, unsigned int r_type); diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c index 9f9feda..30e7bd3 100644 --- a/bfd/elfxx-sparc.c +++ b/bfd/elfxx-sparc.c @@ -311,7 +311,7 @@ static reloc_howto_type sparc_rev32_howto = HOWTO(R_SPARC_REV32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", FALSE,0,0xffffffff,TRUE); reloc_howto_type * -_bfd_sparc_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, +_bfd_sparc_elf_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { /* We explicitly handle each relocation type in the switch @@ -585,8 +585,10 @@ _bfd_sparc_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, default: break; } - bfd_set_error (bfd_error_bad_value); - return NULL; + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, (int) code); + bfd_set_error (bfd_error_bad_value); + return NULL; } reloc_howto_type * @@ -595,10 +597,7 @@ _bfd_sparc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, { unsigned int i; - for (i = 0; - i < (sizeof (_bfd_sparc_elf_howto_table) - / sizeof (_bfd_sparc_elf_howto_table[0])); - i++) + for (i = 0; i < ARRAY_SIZE (_bfd_sparc_elf_howto_table); i++) if (_bfd_sparc_elf_howto_table[i].name != NULL && strcasecmp (_bfd_sparc_elf_howto_table[i].name, r_name) == 0) return &_bfd_sparc_elf_howto_table[i]; @@ -614,7 +613,8 @@ _bfd_sparc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, } reloc_howto_type * -_bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type) +_bfd_sparc_elf_info_to_howto_ptr (bfd *abfd ATTRIBUTE_UNUSED, + unsigned int r_type) { switch (r_type) { @@ -636,8 +636,10 @@ _bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type) default: if (r_type >= (unsigned int) R_SPARC_max_std) { - _bfd_error_handler (_("invalid relocation type %d"), (int) r_type); - r_type = R_SPARC_NONE; + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return NULL; } return &_bfd_sparc_elf_howto_table[r_type]; } @@ -648,13 +650,20 @@ _bfd_sparc_elf_info_to_howto_ptr (unsigned int r_type) #define SPARC_ELF_R_TYPE(r_info) \ ((r_info) & 0xff) -void -_bfd_sparc_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, +bfd_boolean +_bfd_sparc_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, Elf_Internal_Rela *dst) { unsigned int r_type = SPARC_ELF_R_TYPE (dst->r_info); - cache_ptr->howto = _bfd_sparc_elf_info_to_howto_ptr (r_type); + if ((cache_ptr->howto = _bfd_sparc_elf_info_to_howto_ptr (abfd, r_type)) == NULL) + { + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } @@ -673,9 +682,9 @@ _bfd_sparc_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, ((EH)->elf.root.type == bfd_link_hash_undefweak \ && bfd_link_executable (INFO) \ && (_bfd_sparc_elf_hash_table (INFO)->interp == NULL \ - || !(EH)->has_got_reloc \ + || !(INFO)->dynamic_undefined_weak \ || (EH)->has_non_got_reloc \ - || !(INFO)->dynamic_undefined_weak)) + || !(EH)->has_got_reloc)) /* SPARC ELF linker hash entry. */ @@ -750,6 +759,7 @@ sparc_elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel) bfd_byte *loc; bed = get_elf_backend_data (abfd); + BFD_ASSERT (s->reloc_count * bed->s->sizeof_rela < s->size); loc = s->contents + (s->reloc_count++ * bed->s->sizeof_rela); bed->s->swap_reloca_out (abfd, rel, loc); } @@ -1310,8 +1320,7 @@ _bfd_sparc_elf_copy_indirect_symbol (struct bfd_link_info *info, eind->dyn_relocs = NULL; } - if (ind->root.type == bfd_link_hash_indirect - && dir->got.refcount <= 0) + if (ind->root.type == bfd_link_hash_indirect && dir->got.refcount <= 0) { edir->tls_type = eind->tls_type; eind->tls_type = GOT_UNKNOWN; @@ -1331,33 +1340,25 @@ sparc_elf_tls_transition (struct bfd_link_info *info, bfd *abfd, if (! ABI_64_P (abfd) && r_type == R_SPARC_TLS_GD_HI22 && ! _bfd_sparc_elf_tdata (abfd)->has_tlsgd) - r_type = R_SPARC_REV32; + return R_SPARC_REV32; - if (bfd_link_pic (info)) + if (!bfd_link_executable (info)) return r_type; switch (r_type) { case R_SPARC_TLS_GD_HI22: - if (is_local) - return R_SPARC_TLS_LE_HIX22; - return R_SPARC_TLS_IE_HI22; + return is_local ? R_SPARC_TLS_LE_HIX22 : R_SPARC_TLS_IE_HI22; case R_SPARC_TLS_GD_LO10: - if (is_local) - return R_SPARC_TLS_LE_LOX10; - return R_SPARC_TLS_IE_LO10; - case R_SPARC_TLS_IE_HI22: - if (is_local) - return R_SPARC_TLS_LE_HIX22; - return r_type; - case R_SPARC_TLS_IE_LO10: - if (is_local) - return R_SPARC_TLS_LE_LOX10; - return r_type; + return is_local ? R_SPARC_TLS_LE_LOX10 : R_SPARC_TLS_IE_LO10; case R_SPARC_TLS_LDM_HI22: return R_SPARC_TLS_LE_HIX22; case R_SPARC_TLS_LDM_LO10: return R_SPARC_TLS_LE_LOX10; + case R_SPARC_TLS_IE_HI22: + return is_local ? R_SPARC_TLS_LE_HIX22 : r_type; + case R_SPARC_TLS_IE_LO10: + return is_local ? R_SPARC_TLS_LE_LOX10 : r_type; } return r_type; @@ -1417,7 +1418,7 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), abfd, r_symndx); + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -1425,16 +1426,14 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx < symtab_hdr->sh_info) { /* A local symbol. */ - isym = bfd_sym_from_r_symndx (&htab->sym_cache, - abfd, r_symndx); + isym = bfd_sym_from_r_symndx (&htab->sym_cache, abfd, r_symndx); if (isym == NULL) return FALSE; /* Check relocation against local STT_GNU_IFUNC symbol. */ if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC) { - h = elf_sparc_get_local_sym_hash (htab, abfd, rel, - TRUE); + h = elf_sparc_get_local_sym_hash (htab, abfd, rel, TRUE); if (h == NULL) return FALSE; @@ -1456,13 +1455,10 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, h = (struct elf_link_hash_entry *) h->root.u.i.link; } - if (h && h->type == STT_GNU_IFUNC) + if (h && h->type == STT_GNU_IFUNC && h->def_regular) { - if (h->def_regular) - { - h->ref_regular = 1; - h->plt.refcount += 1; - } + h->ref_regular = 1; + h->plt.refcount += 1; } /* Compatibility with old R_SPARC_REV32 reloc conflicting @@ -1505,13 +1501,13 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_SPARC_TLS_LE_HIX22: case R_SPARC_TLS_LE_LOX10: - if (bfd_link_pic (info)) + if (!bfd_link_executable (info)) goto r_sparc_plt32; break; case R_SPARC_TLS_IE_HI22: case R_SPARC_TLS_IE_LO10: - if (bfd_link_pic (info)) + if (!bfd_link_executable (info)) info->flags |= DF_STATIC_TLS; /* Fall through */ @@ -1530,14 +1526,6 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, switch (r_type) { - default: - case R_SPARC_GOT10: - case R_SPARC_GOT13: - case R_SPARC_GOT22: - case R_SPARC_GOTDATA_OP_HIX22: - case R_SPARC_GOTDATA_OP_LOX10: - tls_type = GOT_NORMAL; - break; case R_SPARC_TLS_GD_HI22: case R_SPARC_TLS_GD_LO10: tls_type = GOT_TLS_GD; @@ -1546,6 +1534,9 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_SPARC_TLS_IE_LO10: tls_type = GOT_TLS_IE; break; + default: + tls_type = GOT_NORMAL; + break; } if (h != NULL) @@ -1573,39 +1564,33 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, _bfd_sparc_elf_local_got_tls_type (abfd) = (char *) (local_got_refcounts + symtab_hdr->sh_info); } - switch (r_type) - { - case R_SPARC_GOTDATA_OP_HIX22: - case R_SPARC_GOTDATA_OP_LOX10: - break; - default: - local_got_refcounts[r_symndx] += 1; - break; - } + if (r_type != R_SPARC_GOTDATA_OP_HIX22 + && r_type != R_SPARC_GOTDATA_OP_LOX10) + local_got_refcounts[r_symndx] += 1; + old_tls_type = _bfd_sparc_elf_local_got_tls_type (abfd) [r_symndx]; } - /* If a TLS symbol is accessed using IE at least once, - there is no point to use dynamic model for it. */ - if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN - && (old_tls_type != GOT_TLS_GD - || tls_type != GOT_TLS_IE)) + /* If a TLS symbol is accessed using IE at least once, there is no point + in using the dynamic model for it. */ + if (old_tls_type != tls_type) { - if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD) + if (old_tls_type == GOT_UNKNOWN) + ; + else if (old_tls_type == GOT_TLS_GD && tls_type == GOT_TLS_IE) + ; + else if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD) tls_type = old_tls_type; else { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h ? h->root.root.string : ""); return FALSE; } - } - if (old_tls_type != tls_type) - { if (h != NULL) _bfd_sparc_elf_hash_entry (h)->tls_type = tls_type; else @@ -1613,11 +1598,9 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, } } - if (htab->elf.sgot == NULL) - { - if (!_bfd_elf_create_got_section (htab->elf.dynobj, info)) - return FALSE; - } + if (!htab->elf.sgot + && !_bfd_elf_create_got_section (htab->elf.dynobj, info)) + return FALSE; if (eh != NULL) eh->has_got_reloc = 1; @@ -1625,28 +1608,26 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, case R_SPARC_TLS_GD_CALL: case R_SPARC_TLS_LDM_CALL: - if (bfd_link_pic (info)) - { - /* These are basically R_SPARC_TLS_WPLT30 relocs against - __tls_get_addr. */ - h = (struct elf_link_hash_entry *) - bfd_link_hash_lookup (info->hash, "__tls_get_addr", TRUE, - FALSE, TRUE); - } - else + if (bfd_link_executable (info)) break; + + /* Essentially R_SPARC_WPLT30 relocs against __tls_get_addr. */ + h = (struct elf_link_hash_entry *) + bfd_link_hash_lookup (info->hash, "__tls_get_addr", FALSE, + FALSE, TRUE); + BFD_ASSERT (h != NULL); /* Fall through */ - case R_SPARC_PLT32: case R_SPARC_WPLT30: + case R_SPARC_PLT32: + case R_SPARC_PLT64: case R_SPARC_HIPLT22: case R_SPARC_LOPLT10: case R_SPARC_PCPLT32: case R_SPARC_PCPLT22: case R_SPARC_PCPLT10: - case R_SPARC_PLT64: - /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, + /* This symbol requires a procedure linkage table entry. + We actually build the entry in adjust_dynamic_symbol, because this might be a case of linking PIC code without linking in any dynamic objects, in which case we don't need to generate a procedure linkage table after all. */ @@ -1659,7 +1640,7 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, reloc for a local symbol if you assemble a call from one section to another when using -K pic. We treat it as WDISP30. */ - if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32) + if (r_type == R_SPARC_PLT32) goto r_sparc_plt32; break; } @@ -1675,14 +1656,9 @@ _bfd_sparc_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, h->needs_plt = 1; - { - int this_r_type; + if (r_type == R_SPARC_PLT32 || r_type == R_SPARC_PLT64) + goto r_sparc_plt32; - this_r_type = SPARC_ELF_R_TYPE (rel->r_info); - if (this_r_type == R_SPARC_PLT32 - || this_r_type == R_SPARC_PLT64) - goto r_sparc_plt32; - } h->plt.refcount += 1; eh = (struct _bfd_sparc_elf_link_hash_entry *) h; @@ -1886,9 +1862,7 @@ _bfd_sparc_elf_gc_mark_hook (asection *sec, return NULL; } - /* FIXME: The test here, in check_relocs and in relocate_section - dealing with TLS optimization, ought to be !bfd_link_executable (info). */ - if (bfd_link_pic (info)) + if (!bfd_link_executable (info)) { switch (SPARC_ELF_R_TYPE (rel->r_info)) { @@ -2004,8 +1978,8 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, if (h->plt.refcount <= 0 || (h->type != STT_GNU_IFUNC && (SYMBOL_CALLS_LOCAL (info, h) - || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT - && h->root.type == bfd_link_hash_undefweak)))) + || (h->root.type == bfd_link_hash_undefweak + && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)))) { /* This case can occur if we saw a WPLT30 reloc in an input file, but the symbol was never referred to by a dynamic @@ -2124,12 +2098,11 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) && h->def_regular && h->ref_regular)) { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && !h->forced_local + /* Undefined weak syms won't yet be marked as dynamic. */ + if (h->root.type == bfd_link_hash_undefweak && !resolved_to_zero - && h->root.type == bfd_link_hash_undefweak) + && h->dynindx == -1 + && !h->forced_local) { if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; @@ -2227,7 +2200,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) /* If R_SPARC_TLS_IE_{HI22,LO10} symbol is now local to the binary, make it a R_SPARC_TLS_LE_{HI22,LO10} requiring no TLS entry. */ if (h->got.refcount > 0 - && !bfd_link_pic (info) + && bfd_link_executable (info) && h->dynindx == -1 && _bfd_sparc_elf_hash_entry(h)->tls_type == GOT_TLS_IE) h->got.offset = (bfd_vma) -1; @@ -2237,12 +2210,11 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) bfd_boolean dyn; int tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type; - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && !h->forced_local + /* Undefined weak syms won't yet be marked as dynamic. */ + if (h->root.type == bfd_link_hash_undefweak && !resolved_to_zero - && h->root.type == bfd_link_hash_undefweak) + && h->dynindx == -1 + && !h->forced_local) { if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; @@ -2256,21 +2228,25 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) s->size += SPARC_ELF_WORD_BYTES (htab); dyn = htab->elf.dynamic_sections_created; /* R_SPARC_TLS_IE_{HI22,LO10} needs one dynamic relocation, - R_SPARC_TLS_GD_{HI22,LO10} needs one if local symbol and two if - global. No dynamic relocations are needed against resolved - undefined weak symbols in an executable. */ + R_SPARC_TLS_GD_{HI22,LO10} needs one if local and two if global. */ if ((tls_type == GOT_TLS_GD && h->dynindx == -1) || tls_type == GOT_TLS_IE || h->type == STT_GNU_IFUNC) htab->elf.srelgot->size += SPARC_ELF_RELA_BYTES (htab); else if (tls_type == GOT_TLS_GD) htab->elf.srelgot->size += 2 * SPARC_ELF_RELA_BYTES (htab); - else if (((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT - && !resolved_to_zero) - || h->root.type != bfd_link_hash_undefweak) - && WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, - bfd_link_pic (info), - h)) + else if ((WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, bfd_link_pic (info), h) + /* Even if the symbol isn't dynamic, we may generate a + reloc for the dynamic linker in PIC mode. */ + || (h->dynindx == -1 + && !h->forced_local + && h->root.type != bfd_link_hash_undefweak + && bfd_link_pic (info))) + /* No dynamic relocations are needed against resolved + undefined weak symbols in an executable. */ + && !(h->root.type == bfd_link_hash_undefweak + && (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + || resolved_to_zero))) htab->elf.srelgot->size += SPARC_ELF_RELA_BYTES (htab); } else @@ -2380,12 +2356,11 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) && (h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined)))) { - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && !h->forced_local + /* Undefined weak syms won't yet be marked as dynamic. */ + if (h->root.type == bfd_link_hash_undefweak && !resolved_to_zero - && h->root.type == bfd_link_hash_undefweak) + && h->dynindx == -1 + && !h->forced_local) { if (! bfd_elf_link_record_dynamic_symbol (info, h)) return FALSE; @@ -2449,7 +2424,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2472,7 +2447,7 @@ _bfd_sparc_elf_omit_section_dynsym (bfd *output_bfd, if (strcmp (p->name, ".got") == 0) return FALSE; - return _bfd_elf_link_omit_section_dynsym (output_bfd, info, p); + return _bfd_elf_omit_section_dynsym_default (output_bfd, info, p); } /* Set the sizes of the dynamic sections. */ @@ -2548,7 +2523,7 @@ _bfd_sparc_elf_size_dynamic_sections (bfd *output_bfd, if ((p->sec->output_section->flags & SEC_READONLY) != 0) { info->flags |= DF_TEXTREL; - info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"), + info->callbacks->minfo (_("%pB: dynamic relocation in read-only section `%pA'\n"), p->sec->owner, p->sec); } } @@ -2963,8 +2938,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, bfd_set_error (bfd_error_bad_value); return FALSE; } - howto = _bfd_sparc_elf_howto_table + r_type; + howto = _bfd_sparc_elf_howto_table + r_type; r_symndx = SPARC_ELF_R_SYMNDX (htab, rel->r_info); h = NULL; sym = NULL; @@ -3121,7 +3096,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, NULL); _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocation %s against STT_GNU_IFUNC " + (_("%pB: relocation %s against STT_GNU_IFUNC " "symbol `%s' isn't handled by %s"), input_bfd, _bfd_sparc_elf_howto_table[r_type].name, name, __FUNCTION__); @@ -3131,8 +3106,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, } eh = (struct _bfd_sparc_elf_link_hash_entry *) h; - resolved_to_zero = (eh != NULL - && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh)); + resolved_to_zero = eh && UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); switch (r_type) { @@ -3155,6 +3129,26 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, /* {ld,ldx} [%rs1 + %rs2], %rd --> add %rs1, %rs2, %rd */ relocation = 0x80000000 | (insn & 0x3e07c01f); bfd_put_32 (output_bfd, relocation, contents + rel->r_offset); + + /* If the symbol is global but not dynamic, an .rela.* slot has + been allocated for it in the GOT so output R_SPARC_NONE here. + See also the handling of other GOT relocations just below. */ + if (h != NULL + && h->dynindx == -1 + && !h->forced_local + && h->root.type != bfd_link_hash_undefweak + && (h->got.offset & 1) == 0 + && bfd_link_pic (info)) + { + asection *s = htab->elf.srelgot; + Elf_Internal_Rela outrel; + + BFD_ASSERT (s != NULL); + + memset (&outrel, 0, sizeof outrel); + sparc_elf_append_rela (output_bfd, s, &outrel); + h->got.offset |= 1; + } } continue; } @@ -3207,15 +3201,13 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, off &= ~1; else { + /* If this symbol isn't dynamic in PIC mode, treat it + like a local symbol in PIC mode below. */ if (h->dynindx == -1 && !h->forced_local && h->root.type != bfd_link_hash_undefweak && bfd_link_pic (info)) - { - /* If this symbol isn't dynamic in PIC - generate R_SPARC_RELATIVE here. */ - relative_reloc = TRUE; - } + relative_reloc = TRUE; else SPARC_ELF_PUT_WORD (htab, output_bfd, relocation, htab->elf.sgot->contents + off); @@ -3239,6 +3231,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, off &= ~1; else { + /* For a local symbol in PIC mode, we need to generate a + R_SPARC_RELATIVE reloc for the dynamic linker. */ if (bfd_link_pic (info)) relative_reloc = TRUE; else @@ -3250,12 +3244,9 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, if (relative_reloc) { - asection *s; + asection *s = htab->elf.srelgot; Elf_Internal_Rela outrel; - /* We need to generate a R_SPARC_RELATIVE reloc - for the dynamic linker. */ - s = htab->elf.srelgot; BFD_ASSERT (s != NULL); outrel.r_offset = (htab->elf.sgot->output_section->vma @@ -3378,8 +3369,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, case R_SPARC_H34: case R_SPARC_UA64: r_sparc_plt32: - if ((input_section->flags & SEC_ALLOC) == 0 - || is_vxworks_tls) + if ((input_section->flags & SEC_ALLOC) == 0 || is_vxworks_tls) break; /* Copy dynamic function pointer relocations. Don't generate @@ -3387,9 +3377,9 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, in PIE. */ if ((bfd_link_pic (info) && (h == NULL - || ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT - && !resolved_to_zero) - || h->root.type != bfd_link_hash_undefweak)) + || !(h->root.type == bfd_link_hash_undefweak + && (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + || resolved_to_zero))) && (! howto->pc_relative || !SYMBOL_CALLS_LOCAL (info, h))) || (!bfd_link_pic (info) @@ -3476,7 +3466,6 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, || !SYMBOLIC_BIND (info, h) || !h->def_regular)) { - BFD_ASSERT (h->dynindx != -1); outrel.r_info = SPARC_ELF_R_INFO (htab, rel, h->dynindx, r_type); outrel.r_addend = rel->r_addend; } @@ -3529,7 +3518,7 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, { BFD_FAIL (); _bfd_error_handler - (_("%B: probably compiled without -fPIC?"), + (_("%pB: probably compiled without -fPIC?"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3551,40 +3540,19 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, break; case R_SPARC_TLS_GD_HI22: - if (! ABI_64_P (input_bfd) - && ! _bfd_sparc_elf_tdata (input_bfd)->has_tlsgd) - { - /* R_SPARC_REV32 used the same reloc number as - R_SPARC_TLS_GD_HI22. */ - r_type = R_SPARC_REV32; - break; - } - /* Fall through */ - case R_SPARC_TLS_GD_LO10: case R_SPARC_TLS_IE_HI22: case R_SPARC_TLS_IE_LO10: - r_type = sparc_elf_tls_transition (info, input_bfd, r_type, h == NULL); - tls_type = GOT_UNKNOWN; - if (h == NULL && local_got_offsets) + r_type = sparc_elf_tls_transition (info, input_bfd, r_type, + h == NULL || h->dynindx == -1); + if (r_type == R_SPARC_REV32) + break; + if (h != NULL) + tls_type = _bfd_sparc_elf_hash_entry (h)->tls_type; + else if (local_got_offsets) tls_type = _bfd_sparc_elf_local_got_tls_type (input_bfd) [r_symndx]; - else if (h != NULL) - { - tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type; - if (!bfd_link_pic (info) - && h->dynindx == -1 - && tls_type == GOT_TLS_IE) - switch (SPARC_ELF_R_TYPE (rel->r_info)) - { - case R_SPARC_TLS_GD_HI22: - case R_SPARC_TLS_IE_HI22: - r_type = R_SPARC_TLS_LE_HIX22; - break; - default: - r_type = R_SPARC_TLS_LE_LOX10; - break; - } - } + else + tls_type = GOT_UNKNOWN; if (tls_type == GOT_TLS_IE) switch (r_type) { @@ -3695,7 +3663,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, case R_SPARC_TLS_LDM_HI22: case R_SPARC_TLS_LDM_LO10: - if (! bfd_link_pic (info)) + /* LD -> LE */ + if (bfd_link_executable (info)) { bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); continue; @@ -3706,43 +3675,42 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, case R_SPARC_TLS_LDO_HIX22: case R_SPARC_TLS_LDO_LOX10: - if (bfd_link_pic (info)) + /* LD -> LE */ + if (bfd_link_executable (info)) + { + if (r_type == R_SPARC_TLS_LDO_HIX22) + r_type = R_SPARC_TLS_LE_HIX22; + else + r_type = R_SPARC_TLS_LE_LOX10; + } + else { relocation -= dtpoff_base (info); break; } - - r_type = (r_type == R_SPARC_TLS_LDO_HIX22 - ? R_SPARC_TLS_LE_HIX22 : R_SPARC_TLS_LE_LOX10); /* Fall through. */ case R_SPARC_TLS_LE_HIX22: case R_SPARC_TLS_LE_LOX10: - if (bfd_link_pic (info)) + if (!bfd_link_executable (info)) { Elf_Internal_Rela outrel; - bfd_boolean skip; - - BFD_ASSERT (sreloc != NULL); - skip = FALSE; - outrel.r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, - rel->r_offset); - if (outrel.r_offset == (bfd_vma) -1) - skip = TRUE; - else if (outrel.r_offset == (bfd_vma) -2) - skip = TRUE; - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); - if (skip) + bfd_vma offset + = _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (offset == (bfd_vma) -1 || offset == (bfd_vma) -2) memset (&outrel, 0, sizeof outrel); else { + outrel.r_offset = offset + + input_section->output_section->vma + + input_section->output_offset; outrel.r_info = SPARC_ELF_R_INFO (htab, NULL, 0, r_type); - outrel.r_addend = relocation - dtpoff_base (info) - + rel->r_addend; + outrel.r_addend + = relocation - dtpoff_base (info) + rel->r_addend; } + BFD_ASSERT (sreloc != NULL); sparc_elf_append_rela (output_bfd, sreloc, &outrel); continue; } @@ -3750,7 +3718,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, break; case R_SPARC_TLS_LDM_CALL: - if (! bfd_link_pic (info)) + /* LD -> LE */ + if (bfd_link_executable (info)) { /* mov %g0, %o0 */ bfd_put_32 (output_bfd, 0x90100000, contents + rel->r_offset); @@ -3759,20 +3728,22 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, /* Fall through */ case R_SPARC_TLS_GD_CALL: - tls_type = GOT_UNKNOWN; - if (h == NULL && local_got_offsets) + if (h != NULL) + tls_type = _bfd_sparc_elf_hash_entry (h)->tls_type; + else if (local_got_offsets) tls_type = _bfd_sparc_elf_local_got_tls_type (input_bfd) [r_symndx]; - else if (h != NULL) - tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type; - if (! bfd_link_pic (info) + else + tls_type = GOT_UNKNOWN; + /* GD -> IE or LE */ + if (bfd_link_executable (info) || (r_type == R_SPARC_TLS_GD_CALL && tls_type == GOT_TLS_IE)) { Elf_Internal_Rela *rel2; bfd_vma insn; - if (!bfd_link_pic (info) && (h == NULL || h->dynindx == -1)) + /* GD -> LE */ + if (bfd_link_executable (info) && (h == NULL || h->dynindx == -1)) { - /* GD -> LE */ bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); continue; } @@ -3835,12 +3806,14 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, goto r_sparc_wplt30; case R_SPARC_TLS_GD_ADD: - tls_type = GOT_UNKNOWN; - if (h == NULL && local_got_offsets) + if (h != NULL) + tls_type = _bfd_sparc_elf_hash_entry (h)->tls_type; + else if (local_got_offsets) tls_type = _bfd_sparc_elf_local_got_tls_type (input_bfd) [r_symndx]; - else if (h != NULL) - tls_type = _bfd_sparc_elf_hash_entry(h)->tls_type; - if (! bfd_link_pic (info) || tls_type == GOT_TLS_IE) + else + tls_type = GOT_UNKNOWN; + /* GD -> IE or LE */ + if (bfd_link_executable (info) || tls_type == GOT_TLS_IE) { /* add %reg1, %reg2, %reg3, %tgd_add(foo) changed into IE: @@ -3848,21 +3821,23 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, or LE: add %g7, %reg2, %reg3. */ bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); - if ((h != NULL && h->dynindx != -1) || bfd_link_pic (info)) - relocation = insn | (ABI_64_P (output_bfd) ? 0xc0580000 : 0xc0000000); - else + if (bfd_link_executable (info) && (h == NULL || h->dynindx == -1)) relocation = (insn & ~0x7c000) | 0x1c000; + else + relocation = insn | (ABI_64_P (output_bfd) ? 0xc0580000 : 0xc0000000); bfd_put_32 (output_bfd, relocation, contents + rel->r_offset); } continue; case R_SPARC_TLS_LDM_ADD: - if (! bfd_link_pic (info)) + /* LD -> LE */ + if (bfd_link_executable (info)) bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); continue; case R_SPARC_TLS_LDO_ADD: - if (! bfd_link_pic (info)) + /* LD -> LE */ + if (bfd_link_executable (info)) { /* Change rs1 into %g7. */ bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); @@ -3873,7 +3848,8 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, case R_SPARC_TLS_IE_LD: case R_SPARC_TLS_IE_LDX: - if (! bfd_link_pic (info) && (h == NULL || h->dynindx == -1)) + /* IE -> LE */ + if (bfd_link_executable (info) && (h == NULL || h->dynindx == -1)) { bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); int rs2 = insn & 0x1f; @@ -3910,10 +3886,11 @@ _bfd_sparc_elf_relocate_section (bfd *output_bfd, rel->r_offset) != (bfd_vma) -1) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); @@ -4321,7 +4298,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, struct _bfd_sparc_elf_link_hash_table *htab; const struct elf_backend_data *bed; struct _bfd_sparc_elf_link_hash_entry *eh; - bfd_boolean local_undefweak; + bfd_boolean resolved_to_zero; htab = _bfd_sparc_elf_hash_table (info); BFD_ASSERT (htab != NULL); @@ -4332,7 +4309,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, /* We keep PLT/GOT entries without dynamic PLT/GOT relocations for resolved undefined weak symbols in executable so that their references have value 0 at run-time. */ - local_undefweak = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); + resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); if (h->plt.offset != (bfd_vma) -1) { @@ -4457,8 +4434,7 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, loc += rela_index * bed->s->sizeof_rela; bed->s->swap_reloca_out (output_bfd, &rela, loc); - if (!local_undefweak - && !h->def_regular) + if (!resolved_to_zero && !h->def_regular) { /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ @@ -4472,12 +4448,14 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, } } - /* Don't generate dynamic GOT relocation against undefined weak - symbol in executable. */ + /* Don't generate dynamic GOT relocation against resolved undefined weak + symbols in an executable. */ if (h->got.offset != (bfd_vma) -1 && _bfd_sparc_elf_hash_entry(h)->tls_type != GOT_TLS_GD && _bfd_sparc_elf_hash_entry(h)->tls_type != GOT_TLS_IE - && !local_undefweak) + && !(h->root.type == bfd_link_hash_undefweak + && (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + || resolved_to_zero))) { asection *sgot; asection *srela; @@ -4513,8 +4491,8 @@ _bfd_sparc_elf_finish_dynamic_symbol (bfd *output_bfd, + (h->got.offset & ~(bfd_vma) 1)); return TRUE; } - else if (bfd_link_pic (info) - && SYMBOL_REFERENCES_LOCAL (info, h)) + + if (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL (info, h)) { asection *sec = h->root.u.def.section; if (h->type == STT_GNU_IFUNC) diff --git a/bfd/elfxx-sparc.h b/bfd/elfxx-sparc.h index 7b089f3..524b39e 100644 --- a/bfd/elfxx-sparc.h +++ b/bfd/elfxx-sparc.h @@ -97,10 +97,10 @@ extern reloc_howto_type *_bfd_sparc_elf_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); extern reloc_howto_type *_bfd_sparc_elf_reloc_name_lookup (bfd *, const char *); -extern void _bfd_sparc_elf_info_to_howto +extern bfd_boolean _bfd_sparc_elf_info_to_howto (bfd *, arelent *, Elf_Internal_Rela *); extern reloc_howto_type *_bfd_sparc_elf_info_to_howto_ptr - (unsigned int); + (bfd*, unsigned int); extern bfd_boolean _bfd_sparc_elf_mkobject (bfd *); extern struct bfd_link_hash_table *_bfd_sparc_elf_link_hash_table_create diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index fcd487f..ccab02d 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -145,10 +145,9 @@ #define elf_backend_strtab_flags 0 #endif -#define bfd_elfNN_bfd_debug_info_start bfd_void -#define bfd_elfNN_bfd_debug_info_end bfd_void -#define bfd_elfNN_bfd_debug_info_accumulate \ - ((void (*) (bfd*, struct bfd_section *)) bfd_void) +#define bfd_elfNN_bfd_debug_info_start _bfd_void_bfd +#define bfd_elfNN_bfd_debug_info_end _bfd_void_bfd +#define bfd_elfNN_bfd_debug_info_accumulate _bfd_void_bfd_asection #ifndef bfd_elfNN_bfd_get_relocated_section_contents #define bfd_elfNN_bfd_get_relocated_section_contents \ @@ -211,8 +210,7 @@ #endif #ifndef bfd_elfNN_bfd_make_debug_symbol -#define bfd_elfNN_bfd_make_debug_symbol \ - ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) +#define bfd_elfNN_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #endif #ifndef bfd_elfNN_bfd_copy_private_symbol_data @@ -237,19 +235,16 @@ _bfd_elf_print_private_bfd_data #endif #ifndef bfd_elfNN_bfd_merge_private_bfd_data -#define bfd_elfNN_bfd_merge_private_bfd_data \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true) +#define bfd_elfNN_bfd_merge_private_bfd_data _bfd_bool_bfd_link_true #endif #ifndef bfd_elfNN_bfd_set_private_flags -#define bfd_elfNN_bfd_set_private_flags \ - ((bfd_boolean (*) (bfd *, flagword)) bfd_true) +#define bfd_elfNN_bfd_set_private_flags _bfd_bool_bfd_uint_true #endif #ifndef bfd_elfNN_bfd_is_local_label_name #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name #endif #ifndef bfd_elfNN_bfd_is_target_special_symbol -#define bfd_elfNN_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_elfNN_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #endif #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound @@ -344,11 +339,11 @@ #endif #ifndef elf_info_to_howto -#define elf_info_to_howto 0 +#define elf_info_to_howto NULL #endif #ifndef elf_info_to_howto_rel -#define elf_info_to_howto_rel 0 +#define elf_info_to_howto_rel NULL #endif #ifndef elf_backend_arch_data @@ -449,7 +444,7 @@ #define elf_backend_create_dynamic_sections 0 #endif #ifndef elf_backend_omit_section_dynsym -#define elf_backend_omit_section_dynsym _bfd_elf_link_omit_section_dynsym +#define elf_backend_omit_section_dynsym _bfd_elf_omit_section_dynsym_default #endif #ifndef elf_backend_relocs_compatible #define elf_backend_relocs_compatible _bfd_elf_default_relocs_compatible @@ -473,8 +468,7 @@ #define elf_backend_size_dynamic_sections 0 #endif #ifndef elf_backend_init_index_section -#define elf_backend_init_index_section \ - ((void (*) (bfd *, struct bfd_link_info *)) bfd_void) +#define elf_backend_init_index_section _bfd_void_bfd_link #endif #ifndef elf_backend_relocate_section #define elf_backend_relocate_section 0 @@ -501,8 +495,7 @@ #define elf_backend_modify_program_headers 0 #endif #ifndef elf_backend_allow_non_load_phdr -#define elf_backend_allow_non_load_phdr \ - ((bfd_boolean (*) (bfd *, const Elf_Internal_Phdr *, unsigned)) bfd_false) +#define elf_backend_allow_non_load_phdr 0 #endif #ifndef elf_backend_ecoff_debug_swap #define elf_backend_ecoff_debug_swap 0 @@ -967,14 +960,14 @@ const bfd_target TARGET_BIG_SYM = }, /* bfd_set_format: set the format of a file being written */ - { bfd_false, + { _bfd_bool_bfd_false_error, bfd_elfNN_mkobject, bfd_elfNN_mkarchive, bfd_elfNN_mkcorefile }, /* bfd_write_contents: write cached information into a file being written */ - { bfd_false, + { _bfd_bool_bfd_false_error, bfd_elfNN_write_object_contents, bfd_elfNN_write_archive_contents, bfd_elfNN_write_corefile_contents, @@ -1068,14 +1061,14 @@ const bfd_target TARGET_LITTLE_SYM = }, /* bfd_set_format: set the format of a file being written */ - { bfd_false, + { _bfd_bool_bfd_false_error, bfd_elfNN_mkobject, bfd_elfNN_mkarchive, bfd_elfNN_mkcorefile }, /* bfd_write_contents: write cached information into a file being written */ - { bfd_false, + { _bfd_bool_bfd_false_error, bfd_elfNN_write_object_contents, bfd_elfNN_write_archive_contents, bfd_elfNN_write_corefile_contents, diff --git a/bfd/elfxx-tilegx.c b/bfd/elfxx-tilegx.c index 7596b49..f029cd2 100644 --- a/bfd/elfxx-tilegx.c +++ b/bfd/elfxx-tilegx.c @@ -892,7 +892,7 @@ tilegx_put_word_32 (bfd *abfd, bfd_vma val, void *ptr) } reloc_howto_type * -tilegx_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, +tilegx_reloc_type_lookup (bfd * abfd, bfd_reloc_code_real_type code) { unsigned int i; @@ -908,6 +908,10 @@ tilegx_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED, - entry->table[0].type); } + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, (int) code); + bfd_set_error (bfd_error_bad_value); return NULL; } @@ -928,7 +932,7 @@ tilegx_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, return NULL; } -void +bfd_boolean tilegx_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, Elf_Internal_Rela *dst) @@ -938,11 +942,19 @@ tilegx_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED, if (r_type <= (unsigned int) R_TILEGX_IMM8_Y1_TLS_ADD) cache_ptr->howto = &tilegx_elf_howto_table [r_type]; else if (r_type - R_TILEGX_GNU_VTINHERIT - <= (unsigned int) R_TILEGX_GNU_VTENTRY) + <= ((unsigned int) R_TILEGX_GNU_VTENTRY + - (unsigned int) R_TILEGX_GNU_VTINHERIT)) cache_ptr->howto = &tilegx_elf_howto_table2 [r_type - R_TILEGX_GNU_VTINHERIT]; else - abort (); + { + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + abfd, r_type); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + return TRUE; } typedef tilegx_bundle_bits (*tilegx_create_func)(int); @@ -1685,7 +1697,7 @@ tilegx_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: bad symbol index: %d"), + _bfd_error_handler (_("%pB: bad symbol index: %d"), abfd, r_symndx); return FALSE; } @@ -1790,7 +1802,7 @@ tilegx_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' accessed both as normal and thread local symbol"), + (_("%pB: `%s' accessed both as normal and thread local symbol"), abfd, h ? h->root.root.string : ""); return FALSE; } @@ -2476,7 +2488,7 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *info_p) info->flags |= DF_TEXTREL; info->callbacks->minfo - (_("%B: dynamic relocation against `%T' in read-only section `%A'\n"), + (_("%pB: dynamic relocation against `%pT' in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -2499,7 +2511,7 @@ tilegx_elf_omit_section_dynsym (bfd *output_bfd, if (strcmp (p->name, ".got") == 0) return FALSE; - return _bfd_elf_link_omit_section_dynsym (output_bfd, info, p); + return _bfd_elf_omit_section_dynsym_default (output_bfd, info, p); } bfd_boolean @@ -2564,7 +2576,7 @@ tilegx_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, { info->flags |= DF_TEXTREL; - info->callbacks->minfo (_("%B: dynamic relocation in read-only section `%A'\n"), + info->callbacks->minfo (_("%pB: dynamic relocation in read-only section `%pA'\n"), p->sec->owner, p->sec); } } @@ -3528,7 +3540,7 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, { BFD_FAIL (); _bfd_error_handler - (_("%B: probably compiled without -fPIC?"), + (_("%pB: probably compiled without -fPIC?"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -3778,10 +3790,11 @@ tilegx_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info, rel->r_offset) != (bfd_vma) -1) _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'"), + (_("%pB(%pA+%#" PRIx64 "): " + "unresolvable %s relocation against symbol `%s'"), input_bfd, input_section, - rel->r_offset, + (uint64_t) rel->r_offset, howto->name, h->root.root.string); @@ -4129,7 +4142,7 @@ tilegx_elf_finish_dynamic_sections (bfd *output_bfd, if (bfd_is_abs_section (htab->elf.sgotplt->output_section)) { _bfd_error_handler - (_("discarded output section: `%A'"), htab->elf.sgotplt); + (_("discarded output section: `%pA'"), htab->elf.sgotplt); return FALSE; } @@ -4238,7 +4251,7 @@ _bfd_tilegx_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Cannot link together %s and %s objects."), + (_("%pB: cannot link together %s and %s objects"), ibfd, targ1, targ2); bfd_set_error (bfd_error_bad_value); return FALSE; diff --git a/bfd/elfxx-tilegx.h b/bfd/elfxx-tilegx.h index 2233116..a5afc54 100644 --- a/bfd/elfxx-tilegx.h +++ b/bfd/elfxx-tilegx.h @@ -76,7 +76,7 @@ tilegx_elf_gc_mark_hook (asection *, extern bfd_vma tilegx_elf_plt_sym_val (bfd_vma, const asection *, const arelent *); -extern void +extern bfd_boolean tilegx_info_to_howto_rela (bfd *, arelent *, Elf_Internal_Rela *); extern int diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index a7db5d9..5f55c94 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -179,6 +179,7 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) asection *s = htab->elf.splt; asection *second_s = htab->plt_second; asection *got_s = htab->plt_got; + bfd_boolean use_plt; /* If this is the first .plt entry, make room for the special first entry. The .plt section is used by prelink to undo @@ -196,12 +197,19 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) } /* If this symbol is not defined in a regular file, and we are - not generating a shared library, then set the symbol to this - location in the .plt. This is required to make function - pointers compare as equal between the normal executable and - the shared library. */ - if (! bfd_link_pic (info) - && !h->def_regular) + generating PDE, then set the symbol to this location in the + .plt. This is required to make function pointers compare + as equal between PDE and the shared library. + + NB: If PLT is PC-relative, we can use the .plt in PIE for + function address. */ + if (h->def_regular) + use_plt = FALSE; + else if (htab->pcrel_plt) + use_plt = ! bfd_link_dll (info); + else + use_plt = bfd_link_pde (info); + if (use_plt) { if (use_plt_got) { @@ -560,15 +568,15 @@ maybe_set_textrel (struct elf_link_hash_entry *h, void *inf) info->flags |= DF_TEXTREL; /* xgettext:c-format */ - info->callbacks->minfo (_("%B: dynamic relocation against `%T' " - "in read-only section `%A'\n"), + info->callbacks->minfo (_("%pB: dynamic relocation against `%pT' " + "in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); if ((info->warn_shared_textrel && bfd_link_pic (info)) || info->error_textrel) /* xgettext:c-format */ - info->callbacks->einfo (_("%P: %B: warning: relocation against `%s' " - "in read-only section `%A'\n"), + info->callbacks->einfo (_("%P: %pB: warning: relocation against `%s' " + "in read-only section `%pA'\n"), sec->owner, h->root.root.string, sec); /* Not an error, just cut short the traversal. */ @@ -771,6 +779,7 @@ _bfd_x86_elf_link_hash_table_create (bfd *abfd) ret->dt_reloc_sz = DT_RELASZ; ret->dt_reloc_ent = DT_RELAENT; ret->got_entry_size = 8; + ret->pcrel_plt = TRUE; ret->tls_get_addr = "__tls_get_addr"; } if (ABI_64_P (abfd)) @@ -798,6 +807,7 @@ _bfd_x86_elf_link_hash_table_create (bfd *abfd) ret->dt_reloc_ent = DT_RELENT; ret->sizeof_reloc = sizeof (Elf32_External_Rel); ret->got_entry_size = 4; + ret->pcrel_plt = FALSE; ret->pointer_r_type = R_386_32; ret->dynamic_interpreter = ELF32_DYNAMIC_INTERPRETER; ret->dynamic_interpreter_size @@ -960,8 +970,8 @@ _bfd_x86_elf_size_dynamic_sections (bfd *output_bfd, || info->error_textrel) /* xgettext:c-format */ info->callbacks->einfo - (_("%P: %B: warning: relocation " - "in read-only section `%A'\n"), + (_("%P: %pB: warning: relocation " + "in read-only section `%pA'\n"), p->sec->owner, p->sec); } } @@ -1086,7 +1096,7 @@ _bfd_x86_elf_size_dynamic_sections (bfd *output_bfd, /* Don't allocate .got.plt section if there are no GOT nor PLT entries and there is no reference to _GLOBAL_OFFSET_TABLE_. */ if ((htab->elf.hgot == NULL - || !htab->elf.hgot->ref_regular_nonweak) + || !htab->got_referenced) && (htab->elf.sgotplt->size == bed->got_header_size) && (htab->elf.splt == NULL || htab->elf.splt->size == 0) @@ -1096,7 +1106,22 @@ _bfd_x86_elf_size_dynamic_sections (bfd *output_bfd, || htab->elf.iplt->size == 0) && (htab->elf.igotplt == NULL || htab->elf.igotplt->size == 0)) - htab->elf.sgotplt->size = 0; + { + htab->elf.sgotplt->size = 0; + /* Solaris requires to keep _GLOBAL_OFFSET_TABLE_ even if it + isn't used. */ + if (htab->elf.hgot != NULL && htab->target_os != is_solaris) + { + /* Remove the unused _GLOBAL_OFFSET_TABLE_ from symbol + table. */ + htab->elf.hgot->root.type = bfd_link_hash_undefined; + htab->elf.hgot->root.u.undef.abfd + = htab->elf.hgot->root.u.def.section->owner; + htab->elf.hgot->root.linker_def = 0; + htab->elf.hgot->ref_regular = 0; + htab->elf.hgot->def_regular = 0; + } + } } if (_bfd_elf_eh_frame_present (info)) @@ -1342,7 +1367,7 @@ _bfd_x86_elf_finish_dynamic_sections (bfd *output_bfd, if (bfd_is_abs_section (htab->elf.sgotplt->output_section)) { _bfd_error_handler - (_("discarded output section: `%A'"), htab->elf.sgotplt); + (_("discarded output section: `%pA'"), htab->elf.sgotplt); return NULL; } @@ -2247,10 +2272,10 @@ _bfd_x86_elf_parse_gnu_properties (bfd *abfd, unsigned int type, { _bfd_error_handler ((type == GNU_PROPERTY_X86_ISA_1_USED - ? _("error: %B: ") + ? _("error: %pB: ") : (type == GNU_PROPERTY_X86_ISA_1_NEEDED - ? _("error: %B: ") - : _("error: %B: "))), + ? _("error: %pB: ") + : _("error: %pB: "))), abfd, datasz); return property_corrupt; } @@ -2427,7 +2452,7 @@ _bfd_x86_elf_link_setup_gnu_properties if (!bfd_set_section_alignment (ebfd, sec, class_align)) { error_alignment: - info->callbacks->einfo (_("%F%A: failed to align section\n"), + info->callbacks->einfo (_("%F%pA: failed to align section\n"), sec); } diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index e2a83ad..efa835e 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -76,14 +76,11 @@ into the shared library. However, if we are linking with -Bsymbolic, we do not need to copy a reloc against a global symbol which is defined in an object we are including in the link (i.e., DEF_REGULAR - is set). At this point we have not seen all the input files, so it - is possible that DEF_REGULAR is not set now but will be set later (it - is never cleared). In case of a weak definition, DEF_REGULAR may be - cleared later by a strong definition in a shared library. We account - for that possibility below by storing information in the relocs_copied - field of the hash table entry. A similar situation occurs when - creating shared libraries and symbol visibility changes render the - symbol local. + is set). + + If PCREL_PLT is true, don't generate dynamic relocation in PIE for + PC-relative relocation against a dynamic function definition in data + section when PLT address can be used. If on the other hand, we are creating an executable, we may need to keep relocations for symbols satisfied by a dynamic library if we @@ -91,23 +88,30 @@ We also need to generate dynamic pointer relocation against STT_GNU_IFUNC symbol in the non-code section. */ -#define NEED_DYNAMIC_RELOCATION_P(INFO, H, SEC, R_TYPE, POINTER_TYPE) \ +#define NEED_DYNAMIC_RELOCATION_P(INFO, PCREL_PLT, H, SEC, R_TYPE, \ + POINTER_TYPE) \ ((bfd_link_pic (INFO) \ && (! X86_PCREL_TYPE_P (R_TYPE) \ || ((H) != NULL \ && (! (bfd_link_pie (INFO) \ || SYMBOLIC_BIND ((INFO), (H))) \ || (H)->root.type == bfd_link_hash_defweak \ - || !(H)->def_regular)))) \ - || ((H) != NULL \ - && (H)->type == STT_GNU_IFUNC \ - && (R_TYPE) == POINTER_TYPE \ - && ((SEC)->flags & SEC_CODE) == 0) \ - || (ELIMINATE_COPY_RELOCS \ - && !bfd_link_pic (INFO) \ - && (H) != NULL \ - && ((H)->root.type == bfd_link_hash_defweak \ - || !(H)->def_regular))) + || (!(bfd_link_pie (INFO) \ + && (PCREL_PLT) \ + && (H)->plt.refcount > 0 \ + && ((SEC)->flags & SEC_CODE) == 0 \ + && (H)->type == STT_FUNC \ + && (H)->def_dynamic) \ + && !(H)->def_regular))))) \ + || ((H) != NULL \ + && (H)->type == STT_GNU_IFUNC \ + && (R_TYPE) == POINTER_TYPE \ + && ((SEC)->flags & SEC_CODE) == 0) \ + || (ELIMINATE_COPY_RELOCS \ + && !bfd_link_pic (INFO) \ + && (H) != NULL \ + && ((H)->root.type == bfd_link_hash_defweak \ + || !(H)->def_regular))) /* TRUE if dynamic relocation should be generated. Don't copy a pc-relative relocation into the output file if the symbol needs @@ -401,6 +405,7 @@ struct elf_x86_plt_layout enum elf_x86_target_os { is_normal, + is_solaris, is_vxworks, is_nacl }; @@ -478,6 +483,17 @@ struct elf_x86_link_hash_table is only used for i386. */ bfd_byte plt0_pad_byte; + /* TRUE if GOT is referenced. */ + unsigned int got_referenced : 1; + + /* TRUE if PLT is PC-relative. PLT in PDE and PC-relative PLT in PIE + can be used as function address. + + NB: i386 has non-PIC PLT and PIC PLT. Only non-PIC PLT in PDE can + be used as function address. PIC PLT in PIE can't be used as + function address. */ + unsigned int pcrel_plt : 1; + bfd_vma (*r_info) (bfd_vma, bfd_vma); bfd_vma (*r_sym) (bfd_vma); bfd_boolean (*is_reloc_section) (const char *); @@ -688,7 +704,7 @@ extern bfd * _bfd_x86_elf_link_setup_gnu_properties #define elf_backend_gc_mark_hook \ _bfd_x86_elf_gc_mark_hook #define elf_backend_omit_section_dynsym \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) bfd_true) + _bfd_elf_omit_section_dynsym_all #define elf_backend_parse_gnu_properties \ _bfd_x86_elf_parse_gnu_properties #define elf_backend_merge_gnu_properties \ diff --git a/bfd/hp300hpux.c b/bfd/hp300hpux.c index 9df222b..f51092a 100644 --- a/bfd/hp300hpux.c +++ b/bfd/hp300hpux.c @@ -146,7 +146,7 @@ routines in this file, we can not use the default aout free_cached_info routine which assumes that the relocs and symtabs were allocated using malloc. */ -#define MY_bfd_free_cached_info bfd_true +#define MY_bfd_free_cached_info _bfd_bool_bfd_true #define m68k_aout_hp300hpux_write_syms aout_32_write_syms diff --git a/bfd/hppabsd-core.c b/bfd/hppabsd-core.c index a14a57a..aea9d27 100644 --- a/bfd/hppabsd-core.c +++ b/bfd/hppabsd-core.c @@ -244,12 +244,16 @@ const bfd_target core_hppabsd_vec = hppabsd_core_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/hpux-core.c b/bfd/hpux-core.c index aab3d9a..4bf15d0 100644 --- a/bfd/hpux-core.c +++ b/bfd/hpux-core.c @@ -337,7 +337,7 @@ hpux_core_core_file_p (bfd *abfd) */ if ((unknown_sections > 0) && (good_sections > 0)) _bfd_error_handler - ("%B appears to be a core file,\nbut contains unknown sections." + ("%pB appears to be a core file,\nbut contains unknown sections." " It may have been created on an incompatible\nversion of HP-UX." " As a result, some information may be unavailable.\n", abfd); @@ -406,12 +406,16 @@ const bfd_target core_hpux_vec = hpux_core_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/i386linux.c b/bfd/i386linux.c index 74f208a..0887ecb 100644 --- a/bfd/i386linux.c +++ b/bfd/i386linux.c @@ -413,7 +413,7 @@ linux_tally_symbols (struct linux_link_hash_entry *h, void * data) alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1); if (p == NULL || alloc == NULL) - _bfd_error_handler (_("Output file requires shared library `%s'\n"), + _bfd_error_handler (_("output file requires shared library `%s'"), name); else { @@ -421,7 +421,7 @@ linux_tally_symbols (struct linux_link_hash_entry *h, void * data) p = strrchr (alloc, '_'); *p++ = '\0'; _bfd_error_handler - (_("Output file requires shared library `%s.so.%s'\n"), + (_("output file requires shared library `%s.so.%s'"), alloc, p); free (alloc); } @@ -608,7 +608,7 @@ linux_finish_dynamic_link (bfd *output_bfd, && f->h->root.root.type != bfd_link_hash_defweak) { _bfd_error_handler - (_("Symbol %s not defined for fixups\n"), + (_("symbol %s not defined for fixups"), f->h->root.root.root.string); continue; } @@ -658,7 +658,7 @@ linux_finish_dynamic_link (bfd *output_bfd, && f->h->root.root.type != bfd_link_hash_defweak) { _bfd_error_handler - (_("Symbol %s not defined for fixups\n"), + (_("symbol %s not defined for fixups"), f->h->root.root.root.string); continue; } @@ -682,7 +682,7 @@ linux_finish_dynamic_link (bfd *output_bfd, if (linux_hash_table (info)->fixup_count != fixups_written) { - _bfd_error_handler (_("Warning: fixup count mismatch\n")); + _bfd_error_handler (_("warning: fixup count mismatch")); while (linux_hash_table (info)->fixup_count > fixups_written) { bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c index c15707c..a47acf4 100644 --- a/bfd/i386msdos.c +++ b/bfd/i386msdos.c @@ -27,12 +27,94 @@ #include "bfd.h" #include "libbfd.h" #include "libaout.h" +#include "coff/msdos.h" -#define EXE_MAGIC 0x5a4d #define EXE_LOAD_HIGH 0x0000 #define EXE_LOAD_LOW 0xffff #define EXE_PAGE_SIZE 512 +static bfd_boolean +msdos_mkobject (bfd *abfd) +{ + bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_i386_i8086); + + return aout_32_mkobject (abfd); +} + +static const bfd_target * +msdos_object_p (bfd *abfd) +{ + struct external_DOS_hdr hdr; + bfd_byte buffer[2]; + asection *section; + unsigned int size; + + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 + || bfd_bread (&hdr, (bfd_size_type) sizeof (hdr), abfd) < DOS_HDR_SIZE) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + if (H_GET_16 (abfd, hdr.e_magic) != IMAGE_DOS_SIGNATURE) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Check that this isn't actually a PE, NE, or LE file. If it is, the + e_lfanew field will be valid and point to a header beginning with one of + the relevant signatures. If not, e_lfanew might point to anything, so + don't bail if we can't read there. */ + if (H_GET_16 (abfd, hdr.e_cparhdr) < 4 + || bfd_seek (abfd, (file_ptr) H_GET_32 (abfd, hdr.e_lfanew), SEEK_SET) != 0 + || bfd_bread (buffer, (bfd_size_type) 2, abfd) != 2) + { + if (bfd_get_error () == bfd_error_system_call) + return NULL; + } + else + { + if (H_GET_16 (abfd, buffer) == IMAGE_NT_SIGNATURE + || H_GET_16 (abfd, buffer) == IMAGE_OS2_SIGNATURE + || H_GET_16 (abfd, buffer) == IMAGE_OS2_SIGNATURE_LE + || H_GET_16 (abfd, buffer) == IMAGE_OS2_SIGNATURE_LX) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + } + + if (!msdos_mkobject (abfd)) + return NULL; + + abfd->flags = EXEC_P; + abfd->start_address = H_GET_16 (abfd, hdr.e_ip); + + section = bfd_make_section (abfd, ".text"); + if (section == NULL) + return NULL; + + section->flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS); + section->filepos = H_GET_16 (abfd, hdr.e_cparhdr) * 16; + size = (H_GET_16 (abfd, hdr.e_cp) - 1) * EXE_PAGE_SIZE - section->filepos; + size += H_GET_16 (abfd, hdr.e_cblp); + + /* Check that the size is valid. */ + if (bfd_seek (abfd, (file_ptr) (section->filepos + size), SEEK_SET) != 0) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + bfd_set_section_size (abfd, section, size); + section->alignment_power = 4; + + return abfd->xvec; +} + static int msdos_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_link_info *info ATTRIBUTE_UNUSED) @@ -77,7 +159,7 @@ msdos_write_object_contents (bfd *abfd) } /* Constants. */ - H_PUT_16 (abfd, EXE_MAGIC, &hdr[0]); + H_PUT_16 (abfd, IMAGE_DOS_SIGNATURE, &hdr[0]); H_PUT_16 (abfd, EXE_PAGE_SIZE / 16, &hdr[8]); H_PUT_16 (abfd, EXE_LOAD_LOW, &hdr[12]); H_PUT_16 (abfd, 0x3e, &hdr[24]); @@ -127,7 +209,6 @@ msdos_set_section_contents (bfd *abfd, -#define msdos_mkobject aout_32_mkobject #define msdos_make_empty_symbol aout_32_make_empty_symbol #define msdos_bfd_reloc_type_lookup aout_32_reloc_type_lookup #define msdos_bfd_reloc_name_lookup aout_32_reloc_name_lookup @@ -170,7 +251,7 @@ msdos_set_section_contents (bfd *abfd, #define msdos_find_line _bfd_nosymbols_find_line #define msdos_find_inliner_info _bfd_nosymbols_find_inliner_info #define msdos_get_lineno _bfd_nosymbols_get_lineno -#define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define msdos_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define msdos_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name #define msdos_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define msdos_read_minisymbols _bfd_nosymbols_read_minisymbols @@ -203,21 +284,21 @@ const bfd_target i386_msdos_vec = { _bfd_dummy_target, - _bfd_dummy_target, /* bfd_check_format */ + msdos_object_p, /* bfd_check_format */ _bfd_dummy_target, _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, msdos_mkobject, _bfd_generic_mkarchive, - bfd_false, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents */ - bfd_false, + _bfd_bool_bfd_false_error, msdos_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (msdos), diff --git a/bfd/i386os9k.c b/bfd/i386os9k.c index e401c7c..1c8ef84 100644 --- a/bfd/i386os9k.c +++ b/bfd/i386os9k.c @@ -207,12 +207,24 @@ const bfd_target i386_aout_os9k_vec = bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, os9k_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, bfd_false, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, bfd_false, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format */ + _bfd_dummy_target, + os9k_object_p, + bfd_generic_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (aout_32), BFD_JUMP_TABLE_COPY (_bfd_generic), diff --git a/bfd/ieee.c b/bfd/ieee.c index 174ab19..7285ee5 100644 --- a/bfd/ieee.c +++ b/bfd/ieee.c @@ -156,7 +156,7 @@ ieee_write_id (bfd *abfd, const char *id) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: string too long (%ld chars, max 65535)"), abfd, (long) length); + (_("%pB: string too long (%ld chars, max 65535)"), abfd, (long) length); bfd_set_error (bfd_error_invalid_operation); return FALSE; } @@ -299,7 +299,7 @@ ieee_write_expression (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unrecognized symbol `%s' flags 0x%x"), + (_("%pB: unrecognized symbol `%s' flags 0x%x"), abfd, bfd_asymbol_name (symbol), symbol->flags); bfd_set_error (bfd_error_invalid_operation); return FALSE; @@ -834,7 +834,7 @@ ieee_slurp_external_symbols (bfd *abfd) default: _bfd_error_handler /* xgettext:c-format */ - (_("%B: unimplemented ATI record %u for symbol %u"), + (_("%pB: unimplemented ATI record %u for symbol %u"), abfd, symbol_attribute_def, symbol_name_index); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -859,8 +859,8 @@ ieee_slurp_external_symbols (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unexpected ATN type %Ld in external part"), - abfd, value); + (_("%pB: unexpected ATN type %" PRId64 " in external part"), + abfd, (int64_t) value); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -881,7 +881,7 @@ ieee_slurp_external_symbols (bfd *abfd) default: _bfd_error_handler - (_("%B: unexpected type after ATN"), abfd); + (_("%pB: unexpected type after ATN"), abfd); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3853,26 +3853,20 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define ieee_close_and_cleanup _bfd_generic_close_and_cleanup #define ieee_bfd_free_cached_info _bfd_generic_bfd_free_cached_info -#define ieee_slurp_armap bfd_true -#define ieee_slurp_extended_name_table bfd_true +#define ieee_slurp_armap _bfd_bool_bfd_true +#define ieee_slurp_extended_name_table _bfd_bool_bfd_true #define ieee_construct_extended_name_table \ - ((bfd_boolean (*) \ - (bfd *, char **, bfd_size_type *, const char **)) \ - bfd_true) + _bfd_noarchive_construct_extended_name_table #define ieee_truncate_arname bfd_dont_truncate_arname -#define ieee_write_armap \ - ((bfd_boolean (*) \ - (bfd *, unsigned int, struct orl *, unsigned int, int)) \ - bfd_true) -#define ieee_read_ar_hdr bfd_nullvoidptr -#define ieee_write_ar_hdr ((bfd_boolean (*) (bfd *, bfd *)) bfd_false) -#define ieee_update_armap_timestamp bfd_true +#define ieee_write_armap _bfd_noarchive_write_armap +#define ieee_read_ar_hdr _bfd_ptr_bfd_null_error +#define ieee_write_ar_hdr _bfd_noarchive_write_ar_hdr +#define ieee_update_armap_timestamp _bfd_bool_bfd_true #define ieee_get_elt_at_index _bfd_generic_get_elt_at_index #define ieee_get_symbol_version_string \ _bfd_nosymbols_get_symbol_version_string -#define ieee_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define ieee_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name #define ieee_get_lineno _bfd_nosymbols_get_lineno #define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol @@ -3936,16 +3930,16 @@ const bfd_target ieee_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, ieee_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, { - bfd_false, + _bfd_bool_bfd_false_error, ieee_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, /* ieee_close_and_cleanup, ieee_bfd_free_cached_info, ieee_new_section_hook, diff --git a/bfd/ihex.c b/bfd/ihex.c index 247d1a8..096c19c 100644 --- a/bfd/ihex.c +++ b/bfd/ihex.c @@ -227,7 +227,7 @@ ihex_bad_byte (bfd *abfd, unsigned int lineno, int c, bfd_boolean error) } _bfd_error_handler /* xgettext:c-format */ - (_("%B:%d: unexpected character `%s' in Intel Hex file"), + (_("%pB:%d: unexpected character `%s' in Intel Hex file"), abfd, lineno, buf); bfd_set_error (bfd_error_bad_value); } @@ -335,7 +335,7 @@ ihex_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B:%u: bad checksum in Intel Hex file (expected %u, found %u)"), + (_("%pB:%u: bad checksum in Intel Hex file (expected %u, found %u)"), abfd, lineno, (- chksum) & 0xff, (unsigned int) HEX2 (buf + 2 * i)); bfd_set_error (bfd_error_bad_value); @@ -391,7 +391,7 @@ ihex_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B:%u: bad extended address record length in Intel Hex file"), + (_("%pB:%u: bad extended address record length in Intel Hex file"), abfd, lineno); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -409,7 +409,7 @@ ihex_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B:%u: bad extended start address length in Intel Hex file"), + (_("%pB:%u: bad extended start address length in Intel Hex file"), abfd, lineno); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -427,7 +427,7 @@ ihex_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B:%u: bad extended linear address record length in Intel Hex file"), + (_("%pB:%u: bad extended linear address record length in Intel Hex file"), abfd, lineno); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -445,7 +445,7 @@ ihex_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B:%u: bad extended linear start address length in Intel Hex file"), + (_("%pB:%u: bad extended linear start address length in Intel Hex file"), abfd, lineno); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -463,7 +463,7 @@ ihex_scan (bfd *abfd) default: _bfd_error_handler /* xgettext:c-format */ - (_("%B:%u: unrecognized ihex type %u in Intel Hex file"), + (_("%pB:%u: unrecognized ihex type %u in Intel Hex file"), abfd, lineno, type); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -582,7 +582,7 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents) if (type != 0) { _bfd_error_handler - (_("%B: internal error in ihex_read_section"), abfd); + (_("%pB: internal error in ihex_read_section"), abfd); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -616,7 +616,7 @@ ihex_read_section (bfd *abfd, asection *section, bfd_byte *contents) if ((bfd_size_type) (p - contents) < section->size) { _bfd_error_handler - (_("%B: bad section length in ihex_read_section"), abfd); + (_("%pB: bad section length in ihex_read_section"), abfd); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -827,8 +827,9 @@ ihex_write_object_contents (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: address %#Lx out of range for Intel Hex file"), - abfd, where); + (_("%pB: address %#" PRIx64 + " out of range for Intel Hex file"), + abfd, (uint64_t) where); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -918,13 +919,13 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define ihex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define ihex_new_section_hook _bfd_generic_new_section_hook #define ihex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window -#define ihex_get_symtab_upper_bound bfd_0l -#define ihex_canonicalize_symtab ((long (*) (bfd *, asymbol **)) bfd_0l) +#define ihex_get_symtab_upper_bound _bfd_long_bfd_0 +#define ihex_canonicalize_symtab _bfd_nosymbols_canonicalize_symtab #define ihex_make_empty_symbol _bfd_generic_make_empty_symbol #define ihex_print_symbol _bfd_nosymbols_print_symbol #define ihex_get_symbol_info _bfd_nosymbols_get_symbol_info #define ihex_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string -#define ihex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define ihex_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define ihex_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name #define ihex_get_lineno _bfd_nosymbols_get_lineno #define ihex_find_nearest_line _bfd_nosymbols_find_nearest_line @@ -979,16 +980,16 @@ const bfd_target ihex_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, ihex_mkobject, _bfd_generic_mkarchive, - bfd_false, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, + _bfd_bool_bfd_false_error, ihex_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (ihex), diff --git a/bfd/irix-core.c b/bfd/irix-core.c index 0bd7975..06f6a42 100644 --- a/bfd/irix-core.c +++ b/bfd/irix-core.c @@ -307,12 +307,16 @@ const bfd_target core_irix_vec = irix_core_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/libaout.h b/bfd/libaout.h index 274207d..c7d787d 100644 --- a/bfd/libaout.h +++ b/bfd/libaout.h @@ -617,8 +617,7 @@ extern bfd_boolean NAME (aout, bfd_free_cached_info) #endif #ifndef aout_32_bfd_is_target_special_symbol -#define aout_32_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define aout_32_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #endif #ifndef WRITE_HEADERS diff --git a/bfd/libbfd-in.h b/bfd/libbfd-in.h index b7b7905..e1eea28 100644 --- a/bfd/libbfd-in.h +++ b/bfd/libbfd-in.h @@ -109,7 +109,7 @@ extern void *bfd_realloc2 extern void *bfd_zmalloc2 (bfd_size_type, bfd_size_type); -extern void _bfd_error_handler (const char *s, ...); +extern void _bfd_error_handler (const char *s, ...) ATTRIBUTE_PRINTF_1; /* These routines allocate and free things on the BFD's objalloc. */ @@ -121,21 +121,21 @@ extern void bfd_release (bfd *, void *); bfd * _bfd_create_empty_archive_element_shell - (bfd *obfd); + (bfd *); bfd * _bfd_look_for_bfd_in_cache (bfd *, file_ptr); bfd_boolean _bfd_add_bfd_to_archive_cache (bfd *, file_ptr, bfd *); bfd_boolean _bfd_generic_mkarchive - (bfd *abfd); + (bfd *); char *_bfd_append_relative_path - (bfd *arch, char *elt_name); + (bfd *, char *); const bfd_target *bfd_generic_archive_p - (bfd *abfd); + (bfd *); bfd_boolean bfd_slurp_armap - (bfd *abfd); + (bfd *); bfd_boolean bfd_slurp_bsd_armap_f2 - (bfd *abfd); + (bfd *); #define bfd_slurp_bsd_armap bfd_slurp_armap #define bfd_slurp_coff_armap bfd_slurp_armap bfd_boolean _bfd_archive_64_bit_slurp_armap @@ -158,19 +158,18 @@ bfd_boolean _bfd_archive_64_bit_write_armap _bfd_generic_get_elt_at_index #define _bfd_archive_64_bit_generic_stat_arch_elt \ bfd_generic_stat_arch_elt -#define _bfd_archive_64_bit_update_armap_timestamp \ - bfd_true +#define _bfd_archive_64_bit_update_armap_timestamp _bfd_bool_bfd_true bfd_boolean _bfd_slurp_extended_name_table - (bfd *abfd); + (bfd *); extern bfd_boolean _bfd_construct_extended_name_table (bfd *, bfd_boolean, char **, bfd_size_type *); bfd_boolean _bfd_write_archive_contents - (bfd *abfd); + (bfd *); bfd_boolean _bfd_compute_and_write_armap - (bfd *, unsigned int elength); + (bfd *, unsigned int); bfd *_bfd_get_elt_at_filepos - (bfd *archive, file_ptr filepos); + (bfd *, file_ptr); extern bfd *_bfd_generic_get_elt_at_index (bfd *, symindex); bfd * _bfd_new_bfd @@ -178,42 +177,62 @@ bfd * _bfd_new_bfd bfd_boolean _bfd_free_cached_info (bfd *); -bfd_boolean bfd_false - (bfd *ignore); -bfd_boolean bfd_true - (bfd *ignore); -void *bfd_nullvoidptr - (bfd *ignore); -int bfd_0 - (bfd *ignore); -unsigned int bfd_0u - (bfd *ignore); -long bfd_0l - (bfd *ignore); -long _bfd_n1 - (bfd *ignore); -void bfd_void - (bfd *ignore); +extern bfd_boolean _bfd_bool_bfd_false + (bfd *); +extern bfd_boolean _bfd_bool_bfd_asymbol_false + (bfd *, asymbol *); +extern bfd_boolean _bfd_bool_bfd_false_error + (bfd *); +extern bfd_boolean _bfd_bool_bfd_link_false_error + (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_bool_bfd_true + (bfd *); +extern bfd_boolean _bfd_bool_bfd_link_true + (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_bool_bfd_bfd_true + (bfd *, bfd *); +extern bfd_boolean _bfd_bool_bfd_uint_true + (bfd *, unsigned int); +extern bfd_boolean _bfd_bool_bfd_asection_bfd_asection_true + (bfd *, asection *, bfd *, asection *); +extern bfd_boolean _bfd_bool_bfd_asymbol_bfd_asymbol_true + (bfd *, asymbol *, bfd *, asymbol *); +extern bfd_boolean _bfd_bool_bfd_ptr_true + (bfd *, void *); +extern void *_bfd_ptr_bfd_null_error + (bfd *); +extern int _bfd_int_bfd_0 + (bfd *); +extern unsigned int _bfd_uint_bfd_0 + (bfd *); +extern long _bfd_long_bfd_0 + (bfd *); +extern long _bfd_long_bfd_n1_error + (bfd *); +extern void _bfd_void_bfd + (bfd *); +extern void _bfd_void_bfd_link + (bfd *, struct bfd_link_info *); +extern void _bfd_void_bfd_asection + (bfd *, asection *); bfd *_bfd_new_bfd_contained_in (bfd *); const bfd_target *_bfd_dummy_target - (bfd *abfd); + (bfd *); void bfd_dont_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); void bfd_bsd_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); void bfd_gnu_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); bfd_boolean _bfd_bsd_write_armap - (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, - int stridx); + (bfd *, unsigned int, struct orl *, unsigned int, int); bfd_boolean _bfd_coff_write_armap - (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, - int stridx); + (bfd *, unsigned int, struct orl *, unsigned int, int); extern void *_bfd_generic_read_ar_hdr (bfd *); @@ -232,7 +251,7 @@ extern bfd_boolean _bfd_bsd44_write_ar_hdr (bfd *, bfd *); bfd * bfd_generic_openr_next_archived_file - (bfd *archive, bfd *last_file); + (bfd *, bfd *); int bfd_generic_stat_arch_elt (bfd *, struct stat *); @@ -248,7 +267,7 @@ int bfd_generic_stat_arch_elt #define _bfd_generic_close_and_cleanup _bfd_archive_close_and_cleanup extern bfd_boolean _bfd_archive_close_and_cleanup (bfd *); -#define _bfd_generic_bfd_free_cached_info bfd_true +#define _bfd_generic_bfd_free_cached_info _bfd_bool_bfd_true extern bfd_boolean _bfd_generic_new_section_hook (bfd *, asection *); extern bfd_boolean _bfd_generic_get_section_contents @@ -259,20 +278,16 @@ extern bfd_boolean _bfd_generic_get_section_contents_in_window /* Generic routines to use for BFD_JUMP_TABLE_COPY. Use BFD_JUMP_TABLE_COPY (_bfd_generic). */ -#define _bfd_generic_bfd_copy_private_bfd_data \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) +#define _bfd_generic_bfd_copy_private_bfd_data _bfd_bool_bfd_bfd_true #define _bfd_generic_bfd_merge_private_bfd_data \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true) -#define _bfd_generic_bfd_set_private_flags \ - ((bfd_boolean (*) (bfd *, flagword)) bfd_true) + _bfd_bool_bfd_link_true +#define _bfd_generic_bfd_set_private_flags _bfd_bool_bfd_uint_true #define _bfd_generic_bfd_copy_private_section_data \ - ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true) + _bfd_bool_bfd_asection_bfd_asection_true #define _bfd_generic_bfd_copy_private_symbol_data \ - ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true) -#define _bfd_generic_bfd_copy_private_header_data \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) -#define _bfd_generic_bfd_print_private_bfd_data \ - ((bfd_boolean (*) (bfd *, void *)) bfd_true) + _bfd_bool_bfd_asymbol_bfd_asymbol_true +#define _bfd_generic_bfd_copy_private_header_data _bfd_bool_bfd_bfd_true +#define _bfd_generic_bfd_print_private_bfd_data _bfd_bool_bfd_ptr_true extern bfd_boolean _bfd_generic_init_private_section_data (bfd *, asection *, bfd *, asection *, struct bfd_link_info *); @@ -292,25 +307,24 @@ extern int _bfd_nocore_core_file_pid /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive file support. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive). */ -#define _bfd_noarchive_slurp_armap bfd_false -#define _bfd_noarchive_slurp_extended_name_table bfd_false -#define _bfd_noarchive_construct_extended_name_table \ - ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \ - bfd_false) -#define _bfd_noarchive_truncate_arname \ - ((void (*) (bfd *, const char *, char *)) bfd_void) -#define _bfd_noarchive_write_armap \ - ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \ - bfd_false) -#define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr -#define _bfd_noarchive_write_ar_hdr \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_false) -#define _bfd_noarchive_openr_next_archived_file \ - ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr) -#define _bfd_noarchive_get_elt_at_index \ - ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr) +#define _bfd_noarchive_slurp_armap _bfd_bool_bfd_false_error +#define _bfd_noarchive_slurp_extended_name_table _bfd_bool_bfd_false_error +extern bfd_boolean _bfd_noarchive_construct_extended_name_table + (bfd *, char **, bfd_size_type *, const char **); +extern void _bfd_noarchive_truncate_arname + (bfd *, const char *, char *); +extern bfd_boolean _bfd_noarchive_write_armap + (bfd *, unsigned int, struct orl *, unsigned int, int); +#define _bfd_noarchive_read_ar_hdr _bfd_ptr_bfd_null_error +extern bfd_boolean _bfd_noarchive_write_ar_hdr + (bfd *, bfd *); +extern bfd * +_bfd_noarchive_openr_next_archived_file + (bfd *, bfd *); +extern bfd * _bfd_noarchive_get_elt_at_index + (bfd *, symindex); #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define _bfd_noarchive_update_armap_timestamp bfd_false +#define _bfd_noarchive_update_armap_timestamp _bfd_bool_bfd_false_error /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD style archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd). */ @@ -349,7 +363,7 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table #define _bfd_archive_coff_get_elt_at_index _bfd_generic_get_elt_at_index #define _bfd_archive_coff_generic_stat_arch_elt \ bfd_generic_stat_arch_elt -#define _bfd_archive_coff_update_armap_timestamp bfd_true +#define _bfd_archive_coff_update_armap_timestamp _bfd_bool_bfd_true /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD4.4 style archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd44). */ @@ -375,7 +389,7 @@ extern bfd_boolean _bfd_archive_bsd44_construct_extended_name_table archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_vms_lib). Some of them are irrelevant. */ -extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *arch); +extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *); #define _bfd_vms_lib_slurp_armap _bfd_noarchive_slurp_armap #define _bfd_vms_lib_slurp_extended_name_table \ _bfd_noarchive_slurp_extended_name_table @@ -388,55 +402,48 @@ extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *arch); extern bfd *_bfd_vms_lib_openr_next_archived_file (bfd *, bfd *); extern bfd *_bfd_vms_lib_get_elt_at_index (bfd *, symindex); extern int _bfd_vms_lib_generic_stat_arch_elt (bfd *, struct stat *); -#define _bfd_vms_lib_update_armap_timestamp bfd_true +#define _bfd_vms_lib_update_armap_timestamp _bfd_bool_bfd_true /* Extra routines for VMS style archives. */ extern symindex _bfd_vms_lib_find_symbol (bfd *, const char *); extern bfd *_bfd_vms_lib_get_imagelib_file (bfd *); -extern const bfd_target *_bfd_vms_lib_alpha_archive_p (bfd *abfd); -extern const bfd_target *_bfd_vms_lib_ia64_archive_p (bfd *abfd); -extern bfd_boolean _bfd_vms_lib_alpha_mkarchive (bfd *abfd); -extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd); +extern const bfd_target *_bfd_vms_lib_alpha_archive_p (bfd *); +extern const bfd_target *_bfd_vms_lib_ia64_archive_p (bfd *); +extern bfd_boolean _bfd_vms_lib_alpha_mkarchive (bfd *); +extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *); /* Routines to use for BFD_JUMP_TABLE_SYMBOLS where there is no symbol support. Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). */ -#define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1 -#define _bfd_nosymbols_canonicalize_symtab \ - ((long (*) (bfd *, asymbol **)) _bfd_n1) +#define _bfd_nosymbols_get_symtab_upper_bound _bfd_long_bfd_n1_error +extern long _bfd_nosymbols_canonicalize_symtab + (bfd *, asymbol **); #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol -#define _bfd_nosymbols_print_symbol \ - ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void) -#define _bfd_nosymbols_get_symbol_info \ - ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void) -#define _bfd_nosymbols_get_symbol_version_string \ - ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) bfd_nullvoidptr) -#define _bfd_nosymbols_bfd_is_local_label_name \ - ((bfd_boolean (*) (bfd *, const char *)) bfd_false) -#define _bfd_nosymbols_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) -#define _bfd_nosymbols_get_lineno \ - ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr) -#define _bfd_nosymbols_find_nearest_line \ - ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \ - const char **, const char **, unsigned int *, \ - unsigned int *)) \ - bfd_false) -#define _bfd_nosymbols_find_line \ - ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \ - const char **, unsigned int *)) \ - bfd_false) -#define _bfd_nosymbols_find_inliner_info \ - ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \ - bfd_false) -#define _bfd_nosymbols_bfd_make_debug_symbol \ - ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) -#define _bfd_nosymbols_read_minisymbols \ - ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1) -#define _bfd_nosymbols_minisymbol_to_symbol \ - ((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \ - bfd_nullvoidptr) +extern void _bfd_nosymbols_print_symbol + (bfd *, void *, asymbol *, bfd_print_symbol_type); +extern void _bfd_nosymbols_get_symbol_info + (bfd *, asymbol *, symbol_info *); +extern const char * _bfd_nosymbols_get_symbol_version_string + (bfd *, asymbol *, bfd_boolean *); +extern bfd_boolean _bfd_nosymbols_bfd_is_local_label_name + (bfd *, const char *); +#define _bfd_nosymbols_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false +extern alent *_bfd_nosymbols_get_lineno + (bfd *, asymbol *); +extern bfd_boolean _bfd_nosymbols_find_nearest_line + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); +extern bfd_boolean _bfd_nosymbols_find_line + (bfd *, asymbol **, asymbol *, const char **, unsigned int *); +extern bfd_boolean _bfd_nosymbols_find_inliner_info + (bfd *, const char **, const char **, unsigned int *); +extern asymbol *_bfd_nosymbols_bfd_make_debug_symbol + (bfd *, void *, unsigned long); +extern long _bfd_nosymbols_read_minisymbols + (bfd *, bfd_boolean, void **, unsigned int *); +extern asymbol *_bfd_nosymbols_minisymbol_to_symbol + (bfd *, bfd_boolean, const void *, asymbol *); /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ @@ -446,20 +453,18 @@ extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *, arelent **, asymbol **); extern void _bfd_norelocs_set_reloc (bfd *, asection *, arelent **, unsigned int); -#define _bfd_norelocs_bfd_reloc_type_lookup \ - ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) -#define _bfd_norelocs_bfd_reloc_name_lookup \ - ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) +extern reloc_howto_type *_bfd_norelocs_bfd_reloc_type_lookup + (bfd *, bfd_reloc_code_real_type); +extern reloc_howto_type *_bfd_norelocs_bfd_reloc_name_lookup + (bfd *, const char *); /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ -#define _bfd_nowrite_set_arch_mach \ - ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \ - bfd_false) -#define _bfd_nowrite_set_section_contents \ - ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \ - bfd_false) +extern bfd_boolean _bfd_nowrite_set_arch_mach + (bfd *, enum bfd_architecture, unsigned long); +extern bfd_boolean _bfd_nowrite_set_section_contents + (bfd *, asection *, const void *, file_ptr, bfd_size_type); /* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use BFD_JUMP_TABLE_WRITE (_bfd_generic). */ @@ -471,53 +476,37 @@ extern bfd_boolean _bfd_generic_set_section_contents /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ -#define _bfd_nolink_sizeof_headers \ - ((int (*) (bfd *, struct bfd_link_info *)) bfd_0) -#define _bfd_nolink_bfd_get_relocated_section_contents \ - ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ - bfd_byte *, bfd_boolean, asymbol **)) \ - bfd_nullvoidptr) -#define _bfd_nolink_bfd_relax_section \ - ((bfd_boolean (*) \ - (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \ - bfd_false) -#define _bfd_nolink_bfd_gc_sections \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ - bfd_false) -#define _bfd_nolink_bfd_lookup_section_flags \ - ((bfd_boolean (*) (struct bfd_link_info *, struct flag_info *, asection *)) \ - bfd_0) -#define _bfd_nolink_bfd_merge_sections \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ - bfd_false) -#define _bfd_nolink_bfd_is_group_section \ - ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \ - bfd_false) -#define _bfd_nolink_bfd_discard_group \ - ((bfd_boolean (*) (bfd *, struct bfd_section *)) \ - bfd_false) -#define _bfd_nolink_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr) -#define _bfd_nolink_bfd_link_add_symbols \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) -#define _bfd_nolink_bfd_link_just_syms \ - ((void (*) (asection *, struct bfd_link_info *)) bfd_void) -#define _bfd_nolink_bfd_copy_link_hash_symbol_type \ - ((void (*) (bfd *, struct bfd_link_hash_entry *, \ - struct bfd_link_hash_entry *)) bfd_void) -#define _bfd_nolink_bfd_final_link \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) -#define _bfd_nolink_bfd_link_split_section \ - ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) -#define _bfd_nolink_section_already_linked \ - ((bfd_boolean (*) (bfd *, asection *, \ - struct bfd_link_info *)) bfd_false) -#define _bfd_nolink_bfd_define_common_symbol \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, \ - struct bfd_link_hash_entry *)) bfd_false) -#define _bfd_nolink_bfd_define_start_stop \ - ((struct bfd_link_hash_entry * (*) (struct bfd_link_info *, \ - const char *, asection *)) bfd_nullvoidptr) +extern int _bfd_nolink_sizeof_headers + (bfd *, struct bfd_link_info *); +extern bfd_byte *_bfd_nolink_bfd_get_relocated_section_contents + (bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, bfd_boolean, asymbol **); +extern bfd_boolean _bfd_nolink_bfd_relax_section + (bfd *, asection *, struct bfd_link_info *, bfd_boolean *); +#define _bfd_nolink_bfd_gc_sections _bfd_bool_bfd_link_false_error +extern bfd_boolean _bfd_nolink_bfd_lookup_section_flags + (struct bfd_link_info *, struct flag_info *, asection *); +#define _bfd_nolink_bfd_merge_sections _bfd_bool_bfd_link_false_error +extern bfd_boolean _bfd_nolink_bfd_is_group_section + (bfd *, const asection *); +extern bfd_boolean _bfd_nolink_bfd_discard_group + (bfd *, asection *); +extern struct bfd_link_hash_table *_bfd_nolink_bfd_link_hash_table_create + (bfd *); +#define _bfd_nolink_bfd_link_add_symbols _bfd_bool_bfd_link_false_error +extern void _bfd_nolink_bfd_link_just_syms + (asection *, struct bfd_link_info *); +extern void _bfd_nolink_bfd_copy_link_hash_symbol_type + (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); +#define _bfd_nolink_bfd_final_link _bfd_bool_bfd_link_false_error +extern bfd_boolean _bfd_nolink_bfd_link_split_section + (bfd *, struct bfd_section *); +extern bfd_boolean _bfd_nolink_section_already_linked + (bfd *, asection *, struct bfd_link_info *); +extern bfd_boolean _bfd_nolink_bfd_define_common_symbol + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); +extern struct bfd_link_hash_entry *_bfd_nolink_bfd_define_start_stop + (struct bfd_link_info *, const char *, asection *); #define _bfd_nolink_bfd_link_check_relocs \ _bfd_generic_link_check_relocs @@ -525,14 +514,14 @@ extern bfd_boolean _bfd_generic_set_section_contents have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic). */ -#define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1 +#define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_long_bfd_n1_error #define _bfd_nodynamic_canonicalize_dynamic_symtab \ - ((long (*) (bfd *, asymbol **)) _bfd_n1) -#define _bfd_nodynamic_get_synthetic_symtab \ - ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) _bfd_n1) -#define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1 -#define _bfd_nodynamic_canonicalize_dynamic_reloc \ - ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1) + _bfd_nosymbols_canonicalize_symtab +extern long _bfd_nodynamic_get_synthetic_symtab + (bfd *, long, asymbol **, long, asymbol **, asymbol **); +#define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_long_bfd_n1_error +extern long _bfd_nodynamic_canonicalize_dynamic_reloc + (bfd *, arelent **, asymbol **); /* Generic routine to determine of the given symbol is a local label. */ @@ -557,8 +546,8 @@ extern bfd_boolean _bfd_dwarf1_find_nearest_line struct dwarf_debug_section { - const char *uncompressed_name; - const char *compressed_name; + const char * uncompressed_name; + const char * compressed_name; }; /* Map of uncompressed DWARF debug section name to compressed one. It diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 6f29fe7..c581238 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -40,21 +40,87 @@ DESCRIPTION completeness. */ +bfd_boolean +_bfd_bool_bfd_false (bfd *abfd ATTRIBUTE_UNUSED) +{ + return FALSE; +} + +bfd_boolean +_bfd_bool_bfd_asymbol_false (bfd *abfd ATTRIBUTE_UNUSED, + asymbol *sym ATTRIBUTE_UNUSED) +{ + return FALSE; +} + /* A routine which is used in target vectors for unsupported operations. */ bfd_boolean -bfd_false (bfd *ignore ATTRIBUTE_UNUSED) +_bfd_bool_bfd_false_error (bfd *ignore ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); return FALSE; } +bfd_boolean +_bfd_bool_bfd_link_false_error (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + /* A routine which is used in target vectors for supported operations which do not actually do anything. */ bfd_boolean -bfd_true (bfd *ignore ATTRIBUTE_UNUSED) +_bfd_bool_bfd_true (bfd *ignore ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +bfd_boolean +_bfd_bool_bfd_link_true (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +bfd_boolean +_bfd_bool_bfd_bfd_true (bfd *ibfd ATTRIBUTE_UNUSED, + bfd *obfd ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +bfd_boolean +_bfd_bool_bfd_uint_true (bfd *abfd ATTRIBUTE_UNUSED, + unsigned int flags ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +bfd_boolean +_bfd_bool_bfd_asection_bfd_asection_true (bfd *ibfd ATTRIBUTE_UNUSED, + asection *isec ATTRIBUTE_UNUSED, + bfd *obfd ATTRIBUTE_UNUSED, + asection *osec ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +bfd_boolean +_bfd_bool_bfd_asymbol_bfd_asymbol_true (bfd *ibfd ATTRIBUTE_UNUSED, + asymbol *isym ATTRIBUTE_UNUSED, + bfd *obfd ATTRIBUTE_UNUSED, + asymbol *osym ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +bfd_boolean +_bfd_bool_bfd_ptr_true (bfd *abfd ATTRIBUTE_UNUSED, + void *ptr ATTRIBUTE_UNUSED) { return TRUE; } @@ -63,26 +129,26 @@ bfd_true (bfd *ignore ATTRIBUTE_UNUSED) operations which return a pointer value. */ void * -bfd_nullvoidptr (bfd *ignore ATTRIBUTE_UNUSED) +_bfd_ptr_bfd_null_error (bfd *ignore ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); return NULL; } int -bfd_0 (bfd *ignore ATTRIBUTE_UNUSED) +_bfd_int_bfd_0 (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } unsigned int -bfd_0u (bfd *ignore ATTRIBUTE_UNUSED) +_bfd_uint_bfd_0 (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } long -bfd_0l (bfd *ignore ATTRIBUTE_UNUSED) +_bfd_long_bfd_0 (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } @@ -91,14 +157,26 @@ bfd_0l (bfd *ignore ATTRIBUTE_UNUSED) operations which return -1 on error. */ long -_bfd_n1 (bfd *ignore_abfd ATTRIBUTE_UNUSED) +_bfd_long_bfd_n1_error (bfd *ignore_abfd ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); return -1; } void -bfd_void (bfd *ignore ATTRIBUTE_UNUSED) +_bfd_void_bfd (bfd *ignore ATTRIBUTE_UNUSED) +{ +} + +void +_bfd_void_bfd_link (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ +} + +void +_bfd_void_bfd_asection (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED) { } @@ -796,7 +874,7 @@ _bfd_generic_get_section_contents (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: unable to get decompressed section %A"), + (_("%pB: unable to get decompressed section %pA"), abfd, section); bfd_set_error (bfd_error_invalid_operation); return FALSE; diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 2f5f16e..5c777d9 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -114,7 +114,7 @@ extern void *bfd_realloc2 extern void *bfd_zmalloc2 (bfd_size_type, bfd_size_type); -extern void _bfd_error_handler (const char *s, ...); +extern void _bfd_error_handler (const char *s, ...) ATTRIBUTE_PRINTF_1; /* These routines allocate and free things on the BFD's objalloc. */ @@ -126,21 +126,21 @@ extern void bfd_release (bfd *, void *); bfd * _bfd_create_empty_archive_element_shell - (bfd *obfd); + (bfd *); bfd * _bfd_look_for_bfd_in_cache (bfd *, file_ptr); bfd_boolean _bfd_add_bfd_to_archive_cache (bfd *, file_ptr, bfd *); bfd_boolean _bfd_generic_mkarchive - (bfd *abfd); + (bfd *); char *_bfd_append_relative_path - (bfd *arch, char *elt_name); + (bfd *, char *); const bfd_target *bfd_generic_archive_p - (bfd *abfd); + (bfd *); bfd_boolean bfd_slurp_armap - (bfd *abfd); + (bfd *); bfd_boolean bfd_slurp_bsd_armap_f2 - (bfd *abfd); + (bfd *); #define bfd_slurp_bsd_armap bfd_slurp_armap #define bfd_slurp_coff_armap bfd_slurp_armap bfd_boolean _bfd_archive_64_bit_slurp_armap @@ -163,19 +163,18 @@ bfd_boolean _bfd_archive_64_bit_write_armap _bfd_generic_get_elt_at_index #define _bfd_archive_64_bit_generic_stat_arch_elt \ bfd_generic_stat_arch_elt -#define _bfd_archive_64_bit_update_armap_timestamp \ - bfd_true +#define _bfd_archive_64_bit_update_armap_timestamp _bfd_bool_bfd_true bfd_boolean _bfd_slurp_extended_name_table - (bfd *abfd); + (bfd *); extern bfd_boolean _bfd_construct_extended_name_table (bfd *, bfd_boolean, char **, bfd_size_type *); bfd_boolean _bfd_write_archive_contents - (bfd *abfd); + (bfd *); bfd_boolean _bfd_compute_and_write_armap - (bfd *, unsigned int elength); + (bfd *, unsigned int); bfd *_bfd_get_elt_at_filepos - (bfd *archive, file_ptr filepos); + (bfd *, file_ptr); extern bfd *_bfd_generic_get_elt_at_index (bfd *, symindex); bfd * _bfd_new_bfd @@ -183,42 +182,62 @@ bfd * _bfd_new_bfd bfd_boolean _bfd_free_cached_info (bfd *); -bfd_boolean bfd_false - (bfd *ignore); -bfd_boolean bfd_true - (bfd *ignore); -void *bfd_nullvoidptr - (bfd *ignore); -int bfd_0 - (bfd *ignore); -unsigned int bfd_0u - (bfd *ignore); -long bfd_0l - (bfd *ignore); -long _bfd_n1 - (bfd *ignore); -void bfd_void - (bfd *ignore); +extern bfd_boolean _bfd_bool_bfd_false + (bfd *); +extern bfd_boolean _bfd_bool_bfd_asymbol_false + (bfd *, asymbol *); +extern bfd_boolean _bfd_bool_bfd_false_error + (bfd *); +extern bfd_boolean _bfd_bool_bfd_link_false_error + (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_bool_bfd_true + (bfd *); +extern bfd_boolean _bfd_bool_bfd_link_true + (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_bool_bfd_bfd_true + (bfd *, bfd *); +extern bfd_boolean _bfd_bool_bfd_uint_true + (bfd *, unsigned int); +extern bfd_boolean _bfd_bool_bfd_asection_bfd_asection_true + (bfd *, asection *, bfd *, asection *); +extern bfd_boolean _bfd_bool_bfd_asymbol_bfd_asymbol_true + (bfd *, asymbol *, bfd *, asymbol *); +extern bfd_boolean _bfd_bool_bfd_ptr_true + (bfd *, void *); +extern void *_bfd_ptr_bfd_null_error + (bfd *); +extern int _bfd_int_bfd_0 + (bfd *); +extern unsigned int _bfd_uint_bfd_0 + (bfd *); +extern long _bfd_long_bfd_0 + (bfd *); +extern long _bfd_long_bfd_n1_error + (bfd *); +extern void _bfd_void_bfd + (bfd *); +extern void _bfd_void_bfd_link + (bfd *, struct bfd_link_info *); +extern void _bfd_void_bfd_asection + (bfd *, asection *); bfd *_bfd_new_bfd_contained_in (bfd *); const bfd_target *_bfd_dummy_target - (bfd *abfd); + (bfd *); void bfd_dont_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); void bfd_bsd_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); void bfd_gnu_truncate_arname - (bfd *abfd, const char *filename, char *hdr); + (bfd *, const char *, char *); bfd_boolean _bfd_bsd_write_armap - (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, - int stridx); + (bfd *, unsigned int, struct orl *, unsigned int, int); bfd_boolean _bfd_coff_write_armap - (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, - int stridx); + (bfd *, unsigned int, struct orl *, unsigned int, int); extern void *_bfd_generic_read_ar_hdr (bfd *); @@ -237,7 +256,7 @@ extern bfd_boolean _bfd_bsd44_write_ar_hdr (bfd *, bfd *); bfd * bfd_generic_openr_next_archived_file - (bfd *archive, bfd *last_file); + (bfd *, bfd *); int bfd_generic_stat_arch_elt (bfd *, struct stat *); @@ -253,7 +272,7 @@ int bfd_generic_stat_arch_elt #define _bfd_generic_close_and_cleanup _bfd_archive_close_and_cleanup extern bfd_boolean _bfd_archive_close_and_cleanup (bfd *); -#define _bfd_generic_bfd_free_cached_info bfd_true +#define _bfd_generic_bfd_free_cached_info _bfd_bool_bfd_true extern bfd_boolean _bfd_generic_new_section_hook (bfd *, asection *); extern bfd_boolean _bfd_generic_get_section_contents @@ -264,20 +283,16 @@ extern bfd_boolean _bfd_generic_get_section_contents_in_window /* Generic routines to use for BFD_JUMP_TABLE_COPY. Use BFD_JUMP_TABLE_COPY (_bfd_generic). */ -#define _bfd_generic_bfd_copy_private_bfd_data \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) +#define _bfd_generic_bfd_copy_private_bfd_data _bfd_bool_bfd_bfd_true #define _bfd_generic_bfd_merge_private_bfd_data \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_true) -#define _bfd_generic_bfd_set_private_flags \ - ((bfd_boolean (*) (bfd *, flagword)) bfd_true) + _bfd_bool_bfd_link_true +#define _bfd_generic_bfd_set_private_flags _bfd_bool_bfd_uint_true #define _bfd_generic_bfd_copy_private_section_data \ - ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true) + _bfd_bool_bfd_asection_bfd_asection_true #define _bfd_generic_bfd_copy_private_symbol_data \ - ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true) -#define _bfd_generic_bfd_copy_private_header_data \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) -#define _bfd_generic_bfd_print_private_bfd_data \ - ((bfd_boolean (*) (bfd *, void *)) bfd_true) + _bfd_bool_bfd_asymbol_bfd_asymbol_true +#define _bfd_generic_bfd_copy_private_header_data _bfd_bool_bfd_bfd_true +#define _bfd_generic_bfd_print_private_bfd_data _bfd_bool_bfd_ptr_true extern bfd_boolean _bfd_generic_init_private_section_data (bfd *, asection *, bfd *, asection *, struct bfd_link_info *); @@ -297,25 +312,24 @@ extern int _bfd_nocore_core_file_pid /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive file support. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive). */ -#define _bfd_noarchive_slurp_armap bfd_false -#define _bfd_noarchive_slurp_extended_name_table bfd_false -#define _bfd_noarchive_construct_extended_name_table \ - ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \ - bfd_false) -#define _bfd_noarchive_truncate_arname \ - ((void (*) (bfd *, const char *, char *)) bfd_void) -#define _bfd_noarchive_write_armap \ - ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \ - bfd_false) -#define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr -#define _bfd_noarchive_write_ar_hdr \ - ((bfd_boolean (*) (bfd *, bfd *)) bfd_false) -#define _bfd_noarchive_openr_next_archived_file \ - ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr) -#define _bfd_noarchive_get_elt_at_index \ - ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr) +#define _bfd_noarchive_slurp_armap _bfd_bool_bfd_false_error +#define _bfd_noarchive_slurp_extended_name_table _bfd_bool_bfd_false_error +extern bfd_boolean _bfd_noarchive_construct_extended_name_table + (bfd *, char **, bfd_size_type *, const char **); +extern void _bfd_noarchive_truncate_arname + (bfd *, const char *, char *); +extern bfd_boolean _bfd_noarchive_write_armap + (bfd *, unsigned int, struct orl *, unsigned int, int); +#define _bfd_noarchive_read_ar_hdr _bfd_ptr_bfd_null_error +extern bfd_boolean _bfd_noarchive_write_ar_hdr + (bfd *, bfd *); +extern bfd * +_bfd_noarchive_openr_next_archived_file + (bfd *, bfd *); +extern bfd * _bfd_noarchive_get_elt_at_index + (bfd *, symindex); #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define _bfd_noarchive_update_armap_timestamp bfd_false +#define _bfd_noarchive_update_armap_timestamp _bfd_bool_bfd_false_error /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD style archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd). */ @@ -354,7 +368,7 @@ extern bfd_boolean _bfd_archive_coff_construct_extended_name_table #define _bfd_archive_coff_get_elt_at_index _bfd_generic_get_elt_at_index #define _bfd_archive_coff_generic_stat_arch_elt \ bfd_generic_stat_arch_elt -#define _bfd_archive_coff_update_armap_timestamp bfd_true +#define _bfd_archive_coff_update_armap_timestamp _bfd_bool_bfd_true /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get BSD4.4 style archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd44). */ @@ -380,7 +394,7 @@ extern bfd_boolean _bfd_archive_bsd44_construct_extended_name_table archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_vms_lib). Some of them are irrelevant. */ -extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *arch); +extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *); #define _bfd_vms_lib_slurp_armap _bfd_noarchive_slurp_armap #define _bfd_vms_lib_slurp_extended_name_table \ _bfd_noarchive_slurp_extended_name_table @@ -393,55 +407,48 @@ extern bfd_boolean _bfd_vms_lib_write_archive_contents (bfd *arch); extern bfd *_bfd_vms_lib_openr_next_archived_file (bfd *, bfd *); extern bfd *_bfd_vms_lib_get_elt_at_index (bfd *, symindex); extern int _bfd_vms_lib_generic_stat_arch_elt (bfd *, struct stat *); -#define _bfd_vms_lib_update_armap_timestamp bfd_true +#define _bfd_vms_lib_update_armap_timestamp _bfd_bool_bfd_true /* Extra routines for VMS style archives. */ extern symindex _bfd_vms_lib_find_symbol (bfd *, const char *); extern bfd *_bfd_vms_lib_get_imagelib_file (bfd *); -extern const bfd_target *_bfd_vms_lib_alpha_archive_p (bfd *abfd); -extern const bfd_target *_bfd_vms_lib_ia64_archive_p (bfd *abfd); -extern bfd_boolean _bfd_vms_lib_alpha_mkarchive (bfd *abfd); -extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *abfd); +extern const bfd_target *_bfd_vms_lib_alpha_archive_p (bfd *); +extern const bfd_target *_bfd_vms_lib_ia64_archive_p (bfd *); +extern bfd_boolean _bfd_vms_lib_alpha_mkarchive (bfd *); +extern bfd_boolean _bfd_vms_lib_ia64_mkarchive (bfd *); /* Routines to use for BFD_JUMP_TABLE_SYMBOLS where there is no symbol support. Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). */ -#define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1 -#define _bfd_nosymbols_canonicalize_symtab \ - ((long (*) (bfd *, asymbol **)) _bfd_n1) +#define _bfd_nosymbols_get_symtab_upper_bound _bfd_long_bfd_n1_error +extern long _bfd_nosymbols_canonicalize_symtab + (bfd *, asymbol **); #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol -#define _bfd_nosymbols_print_symbol \ - ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void) -#define _bfd_nosymbols_get_symbol_info \ - ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void) -#define _bfd_nosymbols_get_symbol_version_string \ - ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) bfd_nullvoidptr) -#define _bfd_nosymbols_bfd_is_local_label_name \ - ((bfd_boolean (*) (bfd *, const char *)) bfd_false) -#define _bfd_nosymbols_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) -#define _bfd_nosymbols_get_lineno \ - ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr) -#define _bfd_nosymbols_find_nearest_line \ - ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \ - const char **, const char **, unsigned int *, \ - unsigned int *)) \ - bfd_false) -#define _bfd_nosymbols_find_line \ - ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \ - const char **, unsigned int *)) \ - bfd_false) -#define _bfd_nosymbols_find_inliner_info \ - ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \ - bfd_false) -#define _bfd_nosymbols_bfd_make_debug_symbol \ - ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) -#define _bfd_nosymbols_read_minisymbols \ - ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1) -#define _bfd_nosymbols_minisymbol_to_symbol \ - ((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \ - bfd_nullvoidptr) +extern void _bfd_nosymbols_print_symbol + (bfd *, void *, asymbol *, bfd_print_symbol_type); +extern void _bfd_nosymbols_get_symbol_info + (bfd *, asymbol *, symbol_info *); +extern const char * _bfd_nosymbols_get_symbol_version_string + (bfd *, asymbol *, bfd_boolean *); +extern bfd_boolean _bfd_nosymbols_bfd_is_local_label_name + (bfd *, const char *); +#define _bfd_nosymbols_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false +extern alent *_bfd_nosymbols_get_lineno + (bfd *, asymbol *); +extern bfd_boolean _bfd_nosymbols_find_nearest_line + (bfd *, asymbol **, asection *, bfd_vma, + const char **, const char **, unsigned int *, unsigned int *); +extern bfd_boolean _bfd_nosymbols_find_line + (bfd *, asymbol **, asymbol *, const char **, unsigned int *); +extern bfd_boolean _bfd_nosymbols_find_inliner_info + (bfd *, const char **, const char **, unsigned int *); +extern asymbol *_bfd_nosymbols_bfd_make_debug_symbol + (bfd *, void *, unsigned long); +extern long _bfd_nosymbols_read_minisymbols + (bfd *, bfd_boolean, void **, unsigned int *); +extern asymbol *_bfd_nosymbols_minisymbol_to_symbol + (bfd *, bfd_boolean, const void *, asymbol *); /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ @@ -451,20 +458,18 @@ extern long _bfd_norelocs_canonicalize_reloc (bfd *, asection *, arelent **, asymbol **); extern void _bfd_norelocs_set_reloc (bfd *, asection *, arelent **, unsigned int); -#define _bfd_norelocs_bfd_reloc_type_lookup \ - ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) -#define _bfd_norelocs_bfd_reloc_name_lookup \ - ((reloc_howto_type *(*) (bfd *, const char *)) bfd_nullvoidptr) +extern reloc_howto_type *_bfd_norelocs_bfd_reloc_type_lookup + (bfd *, bfd_reloc_code_real_type); +extern reloc_howto_type *_bfd_norelocs_bfd_reloc_name_lookup + (bfd *, const char *); /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ -#define _bfd_nowrite_set_arch_mach \ - ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \ - bfd_false) -#define _bfd_nowrite_set_section_contents \ - ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \ - bfd_false) +extern bfd_boolean _bfd_nowrite_set_arch_mach + (bfd *, enum bfd_architecture, unsigned long); +extern bfd_boolean _bfd_nowrite_set_section_contents + (bfd *, asection *, const void *, file_ptr, bfd_size_type); /* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use BFD_JUMP_TABLE_WRITE (_bfd_generic). */ @@ -476,53 +481,37 @@ extern bfd_boolean _bfd_generic_set_section_contents /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ -#define _bfd_nolink_sizeof_headers \ - ((int (*) (bfd *, struct bfd_link_info *)) bfd_0) -#define _bfd_nolink_bfd_get_relocated_section_contents \ - ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ - bfd_byte *, bfd_boolean, asymbol **)) \ - bfd_nullvoidptr) -#define _bfd_nolink_bfd_relax_section \ - ((bfd_boolean (*) \ - (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \ - bfd_false) -#define _bfd_nolink_bfd_gc_sections \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ - bfd_false) -#define _bfd_nolink_bfd_lookup_section_flags \ - ((bfd_boolean (*) (struct bfd_link_info *, struct flag_info *, asection *)) \ - bfd_0) -#define _bfd_nolink_bfd_merge_sections \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ - bfd_false) -#define _bfd_nolink_bfd_is_group_section \ - ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \ - bfd_false) -#define _bfd_nolink_bfd_discard_group \ - ((bfd_boolean (*) (bfd *, struct bfd_section *)) \ - bfd_false) -#define _bfd_nolink_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr) -#define _bfd_nolink_bfd_link_add_symbols \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) -#define _bfd_nolink_bfd_link_just_syms \ - ((void (*) (asection *, struct bfd_link_info *)) bfd_void) -#define _bfd_nolink_bfd_copy_link_hash_symbol_type \ - ((void (*) (bfd *, struct bfd_link_hash_entry *, \ - struct bfd_link_hash_entry *)) bfd_void) -#define _bfd_nolink_bfd_final_link \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) -#define _bfd_nolink_bfd_link_split_section \ - ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) -#define _bfd_nolink_section_already_linked \ - ((bfd_boolean (*) (bfd *, asection *, \ - struct bfd_link_info *)) bfd_false) -#define _bfd_nolink_bfd_define_common_symbol \ - ((bfd_boolean (*) (bfd *, struct bfd_link_info *, \ - struct bfd_link_hash_entry *)) bfd_false) -#define _bfd_nolink_bfd_define_start_stop \ - ((struct bfd_link_hash_entry * (*) (struct bfd_link_info *, \ - const char *, asection *)) bfd_nullvoidptr) +extern int _bfd_nolink_sizeof_headers + (bfd *, struct bfd_link_info *); +extern bfd_byte *_bfd_nolink_bfd_get_relocated_section_contents + (bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, bfd_boolean, asymbol **); +extern bfd_boolean _bfd_nolink_bfd_relax_section + (bfd *, asection *, struct bfd_link_info *, bfd_boolean *); +#define _bfd_nolink_bfd_gc_sections _bfd_bool_bfd_link_false_error +extern bfd_boolean _bfd_nolink_bfd_lookup_section_flags + (struct bfd_link_info *, struct flag_info *, asection *); +#define _bfd_nolink_bfd_merge_sections _bfd_bool_bfd_link_false_error +extern bfd_boolean _bfd_nolink_bfd_is_group_section + (bfd *, const asection *); +extern bfd_boolean _bfd_nolink_bfd_discard_group + (bfd *, asection *); +extern struct bfd_link_hash_table *_bfd_nolink_bfd_link_hash_table_create + (bfd *); +#define _bfd_nolink_bfd_link_add_symbols _bfd_bool_bfd_link_false_error +extern void _bfd_nolink_bfd_link_just_syms + (asection *, struct bfd_link_info *); +extern void _bfd_nolink_bfd_copy_link_hash_symbol_type + (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *); +#define _bfd_nolink_bfd_final_link _bfd_bool_bfd_link_false_error +extern bfd_boolean _bfd_nolink_bfd_link_split_section + (bfd *, struct bfd_section *); +extern bfd_boolean _bfd_nolink_section_already_linked + (bfd *, asection *, struct bfd_link_info *); +extern bfd_boolean _bfd_nolink_bfd_define_common_symbol + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); +extern struct bfd_link_hash_entry *_bfd_nolink_bfd_define_start_stop + (struct bfd_link_info *, const char *, asection *); #define _bfd_nolink_bfd_link_check_relocs \ _bfd_generic_link_check_relocs @@ -530,14 +519,14 @@ extern bfd_boolean _bfd_generic_set_section_contents have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic). */ -#define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1 +#define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_long_bfd_n1_error #define _bfd_nodynamic_canonicalize_dynamic_symtab \ - ((long (*) (bfd *, asymbol **)) _bfd_n1) -#define _bfd_nodynamic_get_synthetic_symtab \ - ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) _bfd_n1) -#define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1 -#define _bfd_nodynamic_canonicalize_dynamic_reloc \ - ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1) + _bfd_nosymbols_canonicalize_symtab +extern long _bfd_nodynamic_get_synthetic_symtab + (bfd *, long, asymbol **, long, asymbol **, asymbol **); +#define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_long_bfd_n1_error +extern long _bfd_nodynamic_canonicalize_dynamic_reloc + (bfd *, arelent **, asymbol **); /* Generic routine to determine of the given symbol is a local label. */ @@ -562,8 +551,8 @@ extern bfd_boolean _bfd_dwarf1_find_nearest_line struct dwarf_debug_section { - const char *uncompressed_name; - const char *compressed_name; + const char * uncompressed_name; + const char * compressed_name; }; /* Map of uncompressed DWARF debug section name to compressed one. It @@ -1872,6 +1861,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_NDS32_SDA17S2", "BFD_RELOC_NDS32_SDA18S1", "BFD_RELOC_NDS32_SDA19S0", + "BFD_RELOC_NDS32_SECURITY_16", "BFD_RELOC_NDS32_GOT20", "BFD_RELOC_NDS32_9_PLTREL", "BFD_RELOC_NDS32_25_PLTREL", @@ -1955,18 +1945,39 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_NDS32_17IFC_PCREL", "BFD_RELOC_NDS32_10IFCU_PCREL", "BFD_RELOC_NDS32_TPOFF", + "BFD_RELOC_NDS32_GOTTPOFF", "BFD_RELOC_NDS32_TLS_LE_HI20", "BFD_RELOC_NDS32_TLS_LE_LO12", - "BFD_RELOC_NDS32_TLS_LE_ADD", - "BFD_RELOC_NDS32_TLS_LE_LS", - "BFD_RELOC_NDS32_GOTTPOFF", - "BFD_RELOC_NDS32_TLS_IE_HI20", - "BFD_RELOC_NDS32_TLS_IE_LO12S2", - "BFD_RELOC_NDS32_TLS_TPOFF", "BFD_RELOC_NDS32_TLS_LE_20", "BFD_RELOC_NDS32_TLS_LE_15S0", "BFD_RELOC_NDS32_TLS_LE_15S1", "BFD_RELOC_NDS32_TLS_LE_15S2", + "BFD_RELOC_NDS32_TLS_LE_ADD", + "BFD_RELOC_NDS32_TLS_LE_LS", + "BFD_RELOC_NDS32_TLS_IE_HI20", + "BFD_RELOC_NDS32_TLS_IE_LO12", + "BFD_RELOC_NDS32_TLS_IE_LO12S2", + "BFD_RELOC_NDS32_TLS_IEGP_HI20", + "BFD_RELOC_NDS32_TLS_IEGP_LO12", + "BFD_RELOC_NDS32_TLS_IEGP_LO12S2", + "BFD_RELOC_NDS32_TLS_IEGP_LW", + "BFD_RELOC_NDS32_TLS_DESC", + "BFD_RELOC_NDS32_TLS_DESC_HI20", + "BFD_RELOC_NDS32_TLS_DESC_LO12", + "BFD_RELOC_NDS32_TLS_DESC_20", + "BFD_RELOC_NDS32_TLS_DESC_SDA17S2", + "BFD_RELOC_NDS32_TLS_DESC_ADD", + "BFD_RELOC_NDS32_TLS_DESC_FUNC", + "BFD_RELOC_NDS32_TLS_DESC_CALL", + "BFD_RELOC_NDS32_TLS_DESC_MEM", + "BFD_RELOC_NDS32_REMOVE", + "BFD_RELOC_NDS32_GROUP", + "BFD_RELOC_NDS32_ICT", + "BFD_RELOC_NDS32_ICT_HI20", + "BFD_RELOC_NDS32_ICT_LO12", + "BFD_RELOC_NDS32_ICT_25PC", + "BFD_RELOC_NDS32_ICT_LO12S2", + "BFD_RELOC_NDS32_LSI", "BFD_RELOC_V850_9_PCREL", "BFD_RELOC_V850_22_PCREL", "BFD_RELOC_V850_SDA_16_16_OFFSET", @@ -2887,6 +2898,13 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_AARCH64_MOVW_G0_S", "BFD_RELOC_AARCH64_MOVW_G1_S", "BFD_RELOC_AARCH64_MOVW_G2_S", + "BFD_RELOC_AARCH64_MOVW_PREL_G0", + "BFD_RELOC_AARCH64_MOVW_PREL_G0_NC", + "BFD_RELOC_AARCH64_MOVW_PREL_G1", + "BFD_RELOC_AARCH64_MOVW_PREL_G1_NC", + "BFD_RELOC_AARCH64_MOVW_PREL_G2", + "BFD_RELOC_AARCH64_MOVW_PREL_G2_NC", + "BFD_RELOC_AARCH64_MOVW_PREL_G3", "BFD_RELOC_AARCH64_LD_LO19_PCREL", "BFD_RELOC_AARCH64_ADR_LO21_PCREL", "BFD_RELOC_AARCH64_ADR_HI21_PCREL", diff --git a/bfd/libecoff.h b/bfd/libecoff.h index 43f872f..0de4e96 100644 --- a/bfd/libecoff.h +++ b/bfd/libecoff.h @@ -275,9 +275,8 @@ extern bfd_boolean _bfd_ecoff_write_armap bfd_generic_openr_next_archived_file #define _bfd_ecoff_get_elt_at_index _bfd_generic_get_elt_at_index #define _bfd_ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt -#define _bfd_ecoff_update_armap_timestamp bfd_true -#define _bfd_ecoff_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define _bfd_ecoff_update_armap_timestamp _bfd_bool_bfd_true +#define _bfd_ecoff_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false extern long _bfd_ecoff_get_symtab_upper_bound (bfd *); extern long _bfd_ecoff_canonicalize_symtab (bfd *, asymbol **); @@ -302,7 +301,7 @@ extern bfd_boolean _bfd_ecoff_find_nearest_line #define _bfd_ecoff_get_reloc_upper_bound coff_get_reloc_upper_bound extern long _bfd_ecoff_canonicalize_reloc - (bfd *, asection *, arelent **, asymbol **symbols); + (bfd *, asection *, arelent **, asymbol **); /* ecoff_bfd_reloc_type_lookup defined by backend. */ extern bfd_boolean _bfd_ecoff_set_arch_mach @@ -326,8 +325,8 @@ extern bfd_boolean _bfd_ecoff_bfd_final_link /* Hook functions for the generic COFF section reading code. */ extern void * _bfd_ecoff_mkobject_hook (bfd *, void *, void *); -#define _bfd_ecoff_set_alignment_hook \ - ((void (*) (bfd *, asection *, void *)) bfd_void) +extern void _bfd_ecoff_set_alignment_hook + (bfd *, asection *, void *); extern bfd_boolean _bfd_ecoff_set_arch_mach_hook (bfd *, void *); extern bfd_boolean _bfd_ecoff_no_long_sections diff --git a/bfd/linker.c b/bfd/linker.c index dac21bd..c29a6e7 100644 --- a/bfd/linker.c +++ b/bfd/linker.c @@ -1407,7 +1407,7 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info, && name[1] == '_' && strcmp (name + (name[2] == '_'), "__gnu_lto_slim") == 0) _bfd_error_handler - (_("%B: plugin needed to handle lto object"), abfd); + (_("%pB: plugin needed to handle lto object"), abfd); } else row = DEF_ROW; @@ -1675,7 +1675,7 @@ _bfd_generic_link_add_one_symbol (struct bfd_link_info *info, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: indirect symbol `%s' to `%s' is a loop"), + (_("%pB: indirect symbol `%s' to `%s' is a loop"), abfd, name, string); bfd_set_error (bfd_error_invalid_operation); return FALSE; @@ -2545,7 +2545,7 @@ default_indirect_link_order (bfd *output_bfd, difficult, and sometimes impossible. */ _bfd_error_handler /* xgettext:c-format */ - (_("Attempt to do relocatable link with %s input and %s output"), + (_("attempt to do relocatable link with %s input and %s output"), bfd_get_target (input_bfd), bfd_get_target (output_bfd)); bfd_set_error (bfd_error_wrong_format); return FALSE; @@ -2831,7 +2831,7 @@ _bfd_handle_already_linked (asection *sec, case SEC_LINK_DUPLICATES_ONE_ONLY: info->callbacks->einfo /* xgettext:c-format */ - (_("%B: ignoring duplicate section `%A'\n"), + (_("%pB: ignoring duplicate section `%pA'\n"), sec->owner, sec); break; @@ -2841,7 +2841,7 @@ _bfd_handle_already_linked (asection *sec, else if (sec->size != l->sec->size) info->callbacks->einfo /* xgettext:c-format */ - (_("%B: duplicate section `%A' has different size\n"), + (_("%pB: duplicate section `%pA' has different size\n"), sec->owner, sec); break; @@ -2851,7 +2851,7 @@ _bfd_handle_already_linked (asection *sec, else if (sec->size != l->sec->size) info->callbacks->einfo /* xgettext:c-format */ - (_("%B: duplicate section `%A' has different size\n"), + (_("%pB: duplicate section `%pA' has different size\n"), sec->owner, sec); else if (sec->size != 0) { @@ -2860,18 +2860,18 @@ _bfd_handle_already_linked (asection *sec, if (!bfd_malloc_and_get_section (sec->owner, sec, &sec_contents)) info->callbacks->einfo /* xgettext:c-format */ - (_("%B: could not read contents of section `%A'\n"), + (_("%pB: could not read contents of section `%pA'\n"), sec->owner, sec); else if (!bfd_malloc_and_get_section (l->sec->owner, l->sec, &l_sec_contents)) info->callbacks->einfo /* xgettext:c-format */ - (_("%B: could not read contents of section `%A'\n"), + (_("%pB: could not read contents of section `%pA'\n"), l->sec->owner, l->sec); else if (memcmp (sec_contents, l_sec_contents, sec->size) != 0) info->callbacks->einfo /* xgettext:c-format */ - (_("%B: duplicate section `%A' has different contents\n"), + (_("%pB: duplicate section `%pA' has different contents\n"), sec->owner, sec); if (sec_contents) @@ -3359,10 +3359,10 @@ _bfd_generic_verify_endian_match (bfd *ibfd, struct bfd_link_info *info) && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) { if (bfd_big_endian (ibfd)) - _bfd_error_handler (_("%B: compiled for a big endian system " + _bfd_error_handler (_("%pB: compiled for a big endian system " "and target is little endian"), ibfd); else - _bfd_error_handler (_("%B: compiled for a little endian system " + _bfd_error_handler (_("%pB: compiled for a little endian system " "and target is big endian"), ibfd); bfd_set_error (bfd_error_wrong_format); return FALSE; @@ -3370,3 +3370,104 @@ _bfd_generic_verify_endian_match (bfd *ibfd, struct bfd_link_info *info) return TRUE; } + +int +_bfd_nolink_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + return 0; +} + +bfd_boolean +_bfd_nolink_bfd_relax_section (bfd *abfd, + asection *section ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + bfd_boolean *again ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +bfd_byte * +_bfd_nolink_bfd_get_relocated_section_contents + (bfd *abfd, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + struct bfd_link_order *link_order ATTRIBUTE_UNUSED, + bfd_byte *data ATTRIBUTE_UNUSED, + bfd_boolean relocatable ATTRIBUTE_UNUSED, + asymbol **symbols ATTRIBUTE_UNUSED) +{ + return (bfd_byte *) _bfd_ptr_bfd_null_error (abfd); +} + +bfd_boolean +_bfd_nolink_bfd_lookup_section_flags + (struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct flag_info *flaginfo ATTRIBUTE_UNUSED, + asection *section) +{ + return _bfd_bool_bfd_false_error (section->owner); +} + +bfd_boolean +_bfd_nolink_bfd_is_group_section (bfd *abfd, + const asection *sec ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +bfd_boolean +_bfd_nolink_bfd_discard_group (bfd *abfd, asection *sec ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +struct bfd_link_hash_table * +_bfd_nolink_bfd_link_hash_table_create (bfd *abfd) +{ + return (struct bfd_link_hash_table *) _bfd_ptr_bfd_null_error (abfd); +} + +void +_bfd_nolink_bfd_link_just_syms (asection *sec ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ +} + +void +_bfd_nolink_bfd_copy_link_hash_symbol_type + (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_hash_entry *from ATTRIBUTE_UNUSED, + struct bfd_link_hash_entry *to ATTRIBUTE_UNUSED) +{ +} + +bfd_boolean +_bfd_nolink_bfd_link_split_section (bfd *abfd, asection *sec ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +bfd_boolean +_bfd_nolink_section_already_linked (bfd *abfd, + asection *sec ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +bfd_boolean +_bfd_nolink_bfd_define_common_symbol + (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +struct bfd_link_hash_entry * +_bfd_nolink_bfd_define_start_stop (struct bfd_link_info *info ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + asection *sec) +{ + return (struct bfd_link_hash_entry *) _bfd_ptr_bfd_null_error (sec->owner); +} diff --git a/bfd/m68klinux.c b/bfd/m68klinux.c index a55432d..eb0401f 100644 --- a/bfd/m68klinux.c +++ b/bfd/m68klinux.c @@ -416,7 +416,7 @@ linux_tally_symbols (struct linux_link_hash_entry *h, alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1); if (p == NULL || alloc == NULL) - _bfd_error_handler (_("Output file requires shared library `%s'\n"), + _bfd_error_handler (_("output file requires shared library `%s'"), name); else { @@ -425,7 +425,7 @@ linux_tally_symbols (struct linux_link_hash_entry *h, *p++ = '\0'; _bfd_error_handler /* xgettext:c-format */ - (_("Output file requires shared library `%s.so.%s'\n"), + (_("output file requires shared library `%s.so.%s'"), alloc, p); free (alloc); } @@ -614,7 +614,7 @@ linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info) && f->h->root.root.type != bfd_link_hash_defweak) { _bfd_error_handler - (_("Symbol %s not defined for fixups\n"), + (_("symbol %s not defined for fixups"), f->h->root.root.root.string); continue; } @@ -662,7 +662,7 @@ linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info) && f->h->root.root.type != bfd_link_hash_defweak) { _bfd_error_handler - (_("Symbol %s not defined for fixups\n"), + (_("symbol %s not defined for fixups"), f->h->root.root.root.string); continue; } @@ -686,7 +686,7 @@ linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info) if (linux_hash_table (info)->fixup_count != fixups_written) { - _bfd_error_handler (_("Warning: fixup count mismatch\n")); + _bfd_error_handler (_("warning: fixup count mismatch")); while (linux_hash_table (info)->fixup_count > fixups_written) { bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); diff --git a/bfd/mach-o-target.c b/bfd/mach-o-target.c index 96a90a6..8859b23 100644 --- a/bfd/mach-o-target.c +++ b/bfd/mach-o-target.c @@ -27,7 +27,7 @@ #define bfd_mach_o_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_mach_o_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define bfd_mach_o_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data -#define bfd_mach_o_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_mach_o_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define bfd_mach_o_bfd_is_local_label_name bfd_generic_is_local_label_name #define bfd_mach_o_get_lineno _bfd_nosymbols_get_lineno #define bfd_mach_o_find_inliner_info _bfd_nosymbols_find_inliner_info @@ -165,13 +165,13 @@ const bfd_target TARGET_NAME = #endif }, { /* bfd_set_format. */ - bfd_false, + _bfd_bool_bfd_false_error, bfd_mach_o_mkobject, _bfd_generic_mkarchive, bfd_mach_o_mkobject, }, { /* bfd_write_contents. */ - bfd_false, + _bfd_bool_bfd_false_error, bfd_mach_o_write_contents, _bfd_write_archive_contents, bfd_mach_o_write_contents, diff --git a/bfd/mach-o.c b/bfd/mach-o.c index a6299d0..f26be0c 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -2817,8 +2817,9 @@ bfd_mach_o_build_exec_seg_command (bfd *abfd, bfd_mach_o_segment_command *seg) { _bfd_error_handler /* xgettext:c-format */ - (_("section address (%#Lx) below start of segment (%#Lx)"), - s->addr, vma); + (_("section address (%#" PRIx64 ") " + "below start of segment (%#" PRIx64 ")"), + (uint64_t) s->addr, (uint64_t) vma); return FALSE; } @@ -4759,7 +4760,7 @@ bfd_mach_o_read_command (bfd *abfd, bfd_mach_o_load_command *command) break; default: command->len = 0; - _bfd_error_handler (_("%B: unknown load command %#x"), + _bfd_error_handler (_("%pB: unknown load command %#x"), abfd, command->type); return FALSE; } @@ -5901,7 +5902,7 @@ bfd_boolean bfd_mach_o_free_cached_info (bfd *abfd) /* Not yet handled: creating an archive. */ #define bfd_mach_o_mkarchive _bfd_noarchive_mkarchive -#define bfd_mach_o_close_and_cleanup bfd_true +#define bfd_mach_o_close_and_cleanup _bfd_bool_bfd_true /* Not used. */ #define bfd_mach_o_generic_stat_arch_elt bfd_mach_o_fat_stat_arch_elt diff --git a/bfd/merge.c b/bfd/merge.c index 832cb16..7904552 100644 --- a/bfd/merge.c +++ b/bfd/merge.c @@ -865,8 +865,8 @@ _bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec, if (offset > sec->rawsize) _bfd_error_handler /* xgettext:c-format */ - (_("%B: access beyond end of merged section (%Ld)"), - sec->owner, offset); + (_("%pB: access beyond end of merged section (%" PRId64 ")"), + sec->owner, (int64_t) offset); return secinfo->first_str ? sec->size : 0; } diff --git a/bfd/mipsbsd.c b/bfd/mipsbsd.c index 6598eb3..1dc287a 100644 --- a/bfd/mipsbsd.c +++ b/bfd/mipsbsd.c @@ -401,17 +401,17 @@ static const struct aout_backend_data MY(backend_data) = extern const bfd_target mips_aout_be_vec; const bfd_target mips_aout_le_vec = -{ - "a.out-mips-little", /* name */ + { + "a.out-mips-little", /* name */ bfd_target_aout_flavour, BFD_ENDIAN_LITTLE, /* target byte order (little) */ BFD_ENDIAN_LITTLE, /* target headers byte order (little) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), MY_symbol_leading_char, - ' ', /* ar_pad_char */ + ' ', /* ar_pad_char */ 15, /* ar_max_namelen */ 0, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, @@ -420,12 +420,25 @@ const bfd_target mips_aout_le_vec = bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - {_bfd_dummy_target, MY_object_p, /* bfd_check_format */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + + { /* bfd_check_format */ + _bfd_dummy_target, + MY_object_p, + bfd_generic_archive_p, + MY_core_file_p + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + MY_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + MY_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (MY), BFD_JUMP_TABLE_COPY (MY), @@ -437,7 +450,7 @@ const bfd_target mips_aout_le_vec = BFD_JUMP_TABLE_LINK (MY), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & mips_aout_be_vec, + &mips_aout_be_vec, MY_backend_data }; @@ -448,12 +461,12 @@ const bfd_target mips_aout_be_vec = bfd_target_aout_flavour, BFD_ENDIAN_BIG, /* target byte order (big) */ BFD_ENDIAN_BIG, /* target headers byte order (big) */ - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* object flags */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), MY_symbol_leading_char, - ' ', /* ar_pad_char */ + ' ', /* ar_pad_char */ 15, /* ar_max_namelen */ 0, /* match priority. */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -462,12 +475,25 @@ const bfd_target mips_aout_be_vec = bfd_getb64, bfd_getb_signed_64, bfd_putb64, bfd_getb32, bfd_getb_signed_32, bfd_putb32, bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - {_bfd_dummy_target, MY_object_p, /* bfd_check_format */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents */ - _bfd_write_archive_contents, bfd_false}, + + { /* bfd_check_format */ + _bfd_dummy_target, + MY_object_p, + bfd_generic_archive_p, + MY_core_file_p + }, + { /* bfd_set_format */ + _bfd_bool_bfd_false_error, + MY_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents */ + _bfd_bool_bfd_false_error, + MY_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (MY), BFD_JUMP_TABLE_COPY (MY), @@ -479,7 +505,7 @@ const bfd_target mips_aout_be_vec = BFD_JUMP_TABLE_LINK (MY), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - & mips_aout_le_vec, + &mips_aout_le_vec, MY_backend_data }; diff --git a/bfd/mmo.c b/bfd/mmo.c index 66d1286..4b969c2 100644 --- a/bfd/mmo.c +++ b/bfd/mmo.c @@ -465,7 +465,7 @@ mmo_make_section (bfd *abfd, const char *secname) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: No core to allocate section name %s\n"), + (_("%pB: no core to allocate section name %s"), abfd, secname); bfd_set_error (bfd_error_system_call); return NULL; @@ -541,7 +541,7 @@ mmo_object_p (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: No core to allocate a symbol %d bytes long\n"), + (_("%pB: no core to allocate a symbol %d bytes long"), abfd, abfd->tdata.mmo_data->max_symbol_length); goto bad_final; } @@ -955,9 +955,9 @@ mmo_write_loc_chunk (bfd *abfd, bfd_vma vma, const bfd_byte *loc, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: attempt to emit contents at non-multiple-of-4" - " address %#Lx"), - abfd, vma); + (_("%pB: attempt to emit contents at non-multiple-of-4" + " address %#" PRIx64 ""), + abfd, (uint64_t) vma); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1252,7 +1252,7 @@ mmo_create_symbol (bfd *abfd, const char *symname, bfd_vma addr, enum && !mmo_ignore_symbol_consistency (abfd)) { _bfd_error_handler - (_("%B: invalid mmo file: initialization value for $255" + (_("%pB: invalid mmo file: initialization value for $255" " is not `Main'\n"), abfd); bfd_set_error (bfd_error_bad_value); @@ -1399,7 +1399,7 @@ SUBSECTION _bfd_error_handler /* xgettext:c-format */ - (_("%B: unsupported wide character sequence" + (_("%pB: unsupported wide character sequence" " 0x%02X 0x%02X after symbol name starting with `%s'\n"), abfd, c, c2, abfd->tdata.mmo_data->lop_stab_symbol); bfd_set_error (bfd_error_bad_value); @@ -1633,7 +1633,7 @@ mmo_scan (bfd *abfd) default: _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: unsupported lopcode `%d'\n"), + (_("%pB: invalid mmo file: unsupported lopcode `%d'\n"), abfd, buf[1]); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -1644,7 +1644,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: expected YZ = 1" + (_("%pB: invalid mmo file: expected YZ = 1" " got YZ = %d for lop_quote\n"), abfd, y*256+z); bfd_set_error (bfd_error_bad_value); @@ -1682,7 +1682,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: expected z = 1 or z = 2," + (_("%pB: invalid mmo file: expected z = 1 or z = 2," " got z = %d for lop_loc\n"), abfd, z); bfd_set_error (bfd_error_bad_value); @@ -1733,7 +1733,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: expected z = 1 or z = 2," + (_("%pB: invalid mmo file: expected z = 1 or z = 2," " got z = %d for lop_fixo\n"), abfd, z); bfd_set_error (bfd_error_bad_value); @@ -1774,7 +1774,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: expected y = 0," + (_("%pB: invalid mmo file: expected y = 0," " got y = %d for lop_fixrx\n"), abfd, y); bfd_set_error (bfd_error_bad_value); @@ -1785,7 +1785,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: expected z = 16 or z = 24," + (_("%pB: invalid mmo file: expected z = 16 or z = 24," " got z = %d for lop_fixrx\n"), abfd, z); bfd_set_error (bfd_error_bad_value); @@ -1810,7 +1810,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: leading byte of operand word" + (_("%pB: invalid mmo file: leading byte of operand word" " must be 0 or 1, got %d for lop_fixrx\n"), abfd, buf[0]); bfd_set_error (bfd_error_bad_value); @@ -1835,7 +1835,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: cannot allocate file name for file number %d," + (_("%pB: cannot allocate file name for file number %d," " %d bytes\n"), abfd, y, z * 4 + 1); bfd_set_error (bfd_error_system_call); @@ -1857,7 +1857,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: file number %d `%s'," + (_("%pB: invalid mmo file: file number %d `%s'," " was already entered as `%s'\n"), abfd, y, fname, file_names[y]); bfd_set_error (bfd_error_bad_value); @@ -1871,7 +1871,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: file name for number %d" + (_("%pB: invalid mmo file: file name for number %d" " was not specified before use\n"), abfd, y); bfd_set_error (bfd_error_bad_value); @@ -1978,7 +1978,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: fields y and z of lop_stab" + (_("%pB: invalid mmo file: fields y and z of lop_stab" " non-zero, y: %d, z: %d\n"), abfd, y, z); bfd_set_error (bfd_error_bad_value); @@ -2015,7 +2015,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: lop_end not last item in" + (_("%pB: invalid mmo file: lop_end not last item in" " file\n"), abfd); bfd_set_error (bfd_error_bad_value); @@ -2029,7 +2029,7 @@ mmo_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid mmo file: YZ of lop_end (%ld)" + (_("%pB: invalid mmo file: YZ of lop_end (%ld)" " not equal to the number of tetras to the preceding" " lop_stab (%ld)\n"), abfd, (long) (y * 256 + z), @@ -2740,7 +2740,7 @@ mmo_internal_add_3_sym (bfd *abfd, struct mmo_symbol_trie *rootp, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid symbol table: duplicate symbol `%s'\n"), + (_("%pB: invalid symbol table: duplicate symbol `%s'\n"), abfd, trie->sym.name); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -2983,7 +2983,7 @@ mmo_write_symbols_and_terminator (bfd *abfd) _bfd_error_handler /* xgettext:c-format */ - (_("%B: Bad symbol definition: `Main' set to %s rather" + (_("%pB: bad symbol definition: `Main' set to %s rather" " than the start address %s\n"), abfd, vmas_main, vmas_start); bfd_set_error (bfd_error_bad_value); @@ -3082,7 +3082,7 @@ mmo_write_symbols_and_terminator (bfd *abfd) _bfd_error_handler /* xgettext:c-format */ - (_("%B: warning: symbol table too large for mmo, larger than 65535" + (_("%pB: warning: symbol table too large for mmo, larger than 65535" " 32-bit words: %d. Only `Main' will be emitted.\n"), abfd, trie_len); @@ -3128,7 +3128,7 @@ mmo_write_symbols_and_terminator (bfd *abfd) diagnostic and fail "normally". */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: internal error, symbol table changed size from %d to %d" + (_("%pB: internal error, symbol table changed size from %d to %d" " words\n"), abfd, trie_len, (abfd->tdata.mmo_data->byte_no + 3)/4); @@ -3181,7 +3181,7 @@ mmo_write_section_unless_reg_contents (bfd *abfd, asection *sec, void *p) this. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: internal error, internal register section %A had" + (_("%pB: internal error, internal register section %pA had" " contents\n"), abfd, sec); bfd_set_error (bfd_error_bad_value); @@ -3232,21 +3232,21 @@ mmo_write_object_contents (bfd *abfd) if (sec->size == 0) /* There must always be at least one such register. */ _bfd_error_handler - (_("%B: no initialized registers; section length 0\n"), + (_("%pB: no initialized registers; section length 0\n"), abfd); else if (sec->vma > (256 - 32) * 8) /* Provide better error message for the case of too many global registers. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: too many initialized registers; section length %Ld"), - abfd, sec->size); + (_("%pB: too many initialized registers; section length %" PRId64), + abfd, (int64_t) sec->size); else _bfd_error_handler /* xgettext:c-format */ - (_("%B: invalid start address for initialized registers of" - " length %Ld: %#Lx"), - abfd, sec->size, sec->vma); + (_("%pB: invalid start address for initialized registers of" + " length %" PRId64 ": %#" PRIx64), + abfd, (int64_t) sec->size, (uint64_t) sec->vma); return FALSE; } @@ -3275,8 +3275,7 @@ mmo_write_object_contents (bfd *abfd) /* Perhaps we need to adjust this one; mmo labels (originally) without a leading ':' might more appropriately be called local. */ #define mmo_bfd_is_local_label_name bfd_generic_is_local_label_name -#define mmo_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define mmo_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define mmo_get_symbol_version_string \ _bfd_nosymbols_get_symbol_version_string @@ -3364,16 +3363,16 @@ const bfd_target mmix_mmo_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, mmo_mkobject, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents */ - bfd_false, + _bfd_bool_bfd_false_error, mmo_write_object_contents, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (mmo), diff --git a/bfd/netbsd-core.c b/bfd/netbsd-core.c index 7fdb5b6..da8a14c 100644 --- a/bfd/netbsd-core.c +++ b/bfd/netbsd-core.c @@ -294,12 +294,16 @@ const bfd_target core_netbsd_vec = netbsd_core_file_p /* A core file. */ }, { /* bfd_set_format. */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, { /* bfd_write_contents. */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/nlm-target.h b/bfd/nlm-target.h index b26f924..a299843 100644 --- a/bfd/nlm-target.h +++ b/bfd/nlm-target.h @@ -27,7 +27,7 @@ #define nlm_get_symbol_info nlmNAME (get_symbol_info) #define nlm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name -#define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define nlm_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define nlm_get_lineno _bfd_nosymbols_get_lineno #define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line #define nlm_find_line _bfd_nosymbols_find_line @@ -133,17 +133,17 @@ const bfd_target TARGET_BIG_SYM = }, /* bfd_set_format: set the format of a file being written. */ - { bfd_false, + { _bfd_bool_bfd_false_error, nlm_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, /* bfd_write_contents: write cached information into a file being written. */ - { bfd_false, + { _bfd_bool_bfd_false_error, nlmNAME (write_object_contents), _bfd_write_archive_contents, - bfd_false + _bfd_bool_bfd_false_error }, /* Initialize a jump table with the standard macro. @@ -227,17 +227,17 @@ const bfd_target TARGET_LITTLE_SYM = }, /* bfd_set_format: set the format of a file being written. */ - { bfd_false, + { _bfd_bool_bfd_false_error, nlm_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, /* bfd_write_contents: write cached information into a file being written. */ - { bfd_false, + { _bfd_bool_bfd_false_error, nlmNAME(write_object_contents), _bfd_write_archive_contents, - bfd_false + _bfd_bool_bfd_false_error }, /* Initialize a jump table with the standard macro. diff --git a/bfd/oasys.c b/bfd/oasys.c index d8e38a8..d76e712 100644 --- a/bfd/oasys.c +++ b/bfd/oasys.c @@ -878,7 +878,7 @@ oasys_write_sections (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: can not represent section `%A' in oasys"), abfd, s); + (_("%pB: can not represent section `%pA' in oasys"), abfd, s); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; } @@ -1157,24 +1157,25 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define oasys_close_and_cleanup _bfd_generic_close_and_cleanup #define oasys_bfd_free_cached_info _bfd_generic_bfd_free_cached_info -#define oasys_slurp_armap bfd_true -#define oasys_slurp_extended_name_table bfd_true -#define oasys_construct_extended_name_table ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_true) +#define oasys_slurp_armap _bfd_bool_bfd_true +#define oasys_slurp_extended_name_table _bfd_bool_bfd_true +#define oasys_construct_extended_name_table \ + _bfd_noarchive_construct_extended_name_table #define oasys_truncate_arname bfd_dont_truncate_arname -#define oasys_write_armap ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) bfd_true) -#define oasys_read_ar_hdr bfd_nullvoidptr -#define oasys_write_ar_hdr ((bfd_boolean (*) (bfd *, bfd *)) bfd_false) +#define oasys_write_armap _bfd_noarchive_write_armap +#define oasys_read_ar_hdr _bfd_ptr_bfd_null_error +#define oasys_write_ar_hdr _bfd_noarchive_write_ar_hdr #define oasys_get_elt_at_index _bfd_generic_get_elt_at_index -#define oasys_update_armap_timestamp bfd_true +#define oasys_update_armap_timestamp _bfd_bool_bfd_true #define oasys_bfd_is_local_label_name bfd_generic_is_local_label_name -#define oasys_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define oasys_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define oasys_get_lineno _bfd_nosymbols_get_lineno #define oasys_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define oasys_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define oasys_read_minisymbols _bfd_generic_read_minisymbols #define oasys_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define oasys_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup -#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup +#define oasys_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define oasys_set_arch_mach bfd_default_set_arch_mach #define oasys_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define oasys_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents @@ -1190,7 +1191,7 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUTE_UNUSED, #define oasys_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols #define oasys_bfd_link_just_syms _bfd_generic_link_just_syms -#define oasys_bfd_copy_link_hash_symbol_type \ +#define oasys_bfd_copy_link_hash_symbol_type \ _bfd_generic_copy_link_hash_symbol_type #define oasys_bfd_final_link _bfd_generic_final_link #define oasys_bfd_link_split_section _bfd_generic_link_split_section @@ -1225,16 +1226,16 @@ const bfd_target oasys_vec = _bfd_dummy_target, }, { /* bfd_set_format. */ - bfd_false, + _bfd_bool_bfd_false_error, oasys_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, { /* bfd_write_contents. */ - bfd_false, + _bfd_bool_bfd_false_error, oasys_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (oasys), diff --git a/bfd/opncls.c b/bfd/opncls.c index 458f06e..16b568c 100644 --- a/bfd/opncls.c +++ b/bfd/opncls.c @@ -1179,6 +1179,7 @@ bfd_get_debug_link_info_1 (bfd *abfd, void *crc32_out) bfd_byte *contents; unsigned int crc_offset; char *name; + bfd_size_type size; BFD_ASSERT (abfd); BFD_ASSERT (crc32_out); @@ -1188,6 +1189,12 @@ bfd_get_debug_link_info_1 (bfd *abfd, void *crc32_out) if (sect == NULL) return NULL; + size = bfd_get_section_size (sect); + + /* PR 22794: Make sure that the section has a reasonable size. */ + if (size < 8 || size >= bfd_get_size (abfd)) + return NULL; + if (!bfd_malloc_and_get_section (abfd, sect, &contents)) { if (contents != NULL) @@ -1197,10 +1204,10 @@ bfd_get_debug_link_info_1 (bfd *abfd, void *crc32_out) /* CRC value is stored after the filename, aligned up to 4 bytes. */ name = (char *) contents; - /* PR 17597: avoid reading off the end of the buffer. */ - crc_offset = strnlen (name, bfd_get_section_size (sect)) + 1; + /* PR 17597: Avoid reading off the end of the buffer. */ + crc_offset = strnlen (name, size) + 1; crc_offset = (crc_offset + 3) & ~3; - if (crc_offset + 4 > bfd_get_section_size (sect)) + if (crc_offset + 4 > size) return NULL; *crc32 = bfd_get_32 (abfd, contents + crc_offset); @@ -1261,6 +1268,7 @@ bfd_get_alt_debug_link_info (bfd * abfd, bfd_size_type *buildid_len, bfd_byte *contents; unsigned int buildid_offset; char *name; + bfd_size_type size; BFD_ASSERT (abfd); BFD_ASSERT (buildid_len); @@ -1271,6 +1279,10 @@ bfd_get_alt_debug_link_info (bfd * abfd, bfd_size_type *buildid_len, if (sect == NULL) return NULL; + size = bfd_get_section_size (sect); + if (size < 8 || size >= bfd_get_size (abfd)) + return NULL; + if (!bfd_malloc_and_get_section (abfd, sect, & contents)) { if (contents != NULL) @@ -1280,11 +1292,11 @@ bfd_get_alt_debug_link_info (bfd * abfd, bfd_size_type *buildid_len, /* BuildID value is stored after the filename. */ name = (char *) contents; - buildid_offset = strnlen (name, bfd_get_section_size (sect)) + 1; + buildid_offset = strnlen (name, size) + 1; if (buildid_offset >= bfd_get_section_size (sect)) return NULL; - *buildid_len = bfd_get_section_size (sect) - buildid_offset; + *buildid_len = size - buildid_offset; *buildid_out = bfd_malloc (*buildid_len); memcpy (*buildid_out, contents + buildid_offset, *buildid_len); diff --git a/bfd/osf-core.c b/bfd/osf-core.c index dee2cbe..83d729f 100644 --- a/bfd/osf-core.c +++ b/bfd/osf-core.c @@ -124,7 +124,7 @@ osf_core_core_file_p (bfd *abfd) flags = SEC_HAS_CONTENTS; break; default: - _bfd_error_handler (_("Unhandled OSF/1 core file section type %d\n"), + _bfd_error_handler (_("unhandled OSF/1 core file section type %d"), core_scnhdr.scntype); continue; } @@ -201,12 +201,16 @@ const bfd_target core_osf_vec = osf_core_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/pdp11.c b/bfd/pdp11.c index c9311dc..eae8e4a 100644 --- a/bfd/pdp11.c +++ b/bfd/pdp11.c @@ -1149,7 +1149,7 @@ NAME (aout, set_section_contents) (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: can not represent section `%A' in a.out object file format"), + (_("%pB: can not represent section `%pA' in a.out object file format"), abfd, section); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -1382,7 +1382,7 @@ translate_to_native_sym_flags (bfd *abfd, file. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: can not represent section for symbol `%s' in a.out object file format"), + (_("%pB: can not represent section for symbol `%s' in a.out object file format"), abfd, cache_ptr->name != NULL ? cache_ptr->name : "*unknown*"); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -1410,7 +1410,7 @@ translate_to_native_sym_flags (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: can not represent section `%A' in a.out object file format"), + (_("%pB: can not represent section `%pA' in a.out object file format"), abfd, sec); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -3705,7 +3705,7 @@ NAME (aout, final_link) (bfd *abfd, by the reloc size. */ _bfd_error_handler /* xgettext:c-format */ - (_("%B: relocatable link from %s to %s not supported"), + (_("%pB: relocatable link from %s to %s not supported"), abfd, sub->xvec->name, abfd->xvec->name); bfd_set_error (bfd_error_invalid_operation); goto error_return; @@ -4519,22 +4519,34 @@ const bfd_target MY (vec) = bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getp32, bfd_getp_signed_32, bfd_putp32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Headers. */ - {_bfd_dummy_target, MY_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, MY_core_file_p}, - {bfd_false, MY_mkobject, /* bfd_set_format. */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, MY_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (MY), - BFD_JUMP_TABLE_COPY (MY), - BFD_JUMP_TABLE_CORE (MY), - BFD_JUMP_TABLE_ARCHIVE (MY), - BFD_JUMP_TABLE_SYMBOLS (MY), - BFD_JUMP_TABLE_RELOCS (MY), - BFD_JUMP_TABLE_WRITE (MY), - BFD_JUMP_TABLE_LINK (MY), - BFD_JUMP_TABLE_DYNAMIC (MY), + { /* bfd_check_format. */ + _bfd_dummy_target, + MY_object_p, + bfd_generic_archive_p, + MY_core_file_p + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + MY_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + MY_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, + + BFD_JUMP_TABLE_GENERIC (MY), + BFD_JUMP_TABLE_COPY (MY), + BFD_JUMP_TABLE_CORE (MY), + BFD_JUMP_TABLE_ARCHIVE (MY), + BFD_JUMP_TABLE_SYMBOLS (MY), + BFD_JUMP_TABLE_RELOCS (MY), + BFD_JUMP_TABLE_WRITE (MY), + BFD_JUMP_TABLE_LINK (MY), + BFD_JUMP_TABLE_DYNAMIC (MY), /* Alternative_target. */ NULL, diff --git a/bfd/pe-mips.c b/bfd/pe-mips.c index b81f683..1a617a1 100644 --- a/bfd/pe-mips.c +++ b/bfd/pe-mips.c @@ -606,7 +606,7 @@ coff_pe_mips_relocate_section (bfd *output_bfd, if (bfd_link_relocatable (info)) { _bfd_error_handler - (_("%B: `ld -r' not supported with PE MIPS objects\n"), input_bfd); + (_("%pB: `ld -r' not supported with PE MIPS objects"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -717,7 +717,7 @@ coff_pe_mips_relocate_section (bfd *output_bfd, #define UI(x) \ /* xgettext:c-format */ \ - _bfd_error_handler (_("%B: unimplemented %s\n"), \ + _bfd_error_handler (_("%pB: unimplemented %s"), \ input_bfd, x); \ bfd_set_error (bfd_error_bad_value); @@ -743,7 +743,7 @@ coff_pe_mips_relocate_section (bfd *output_bfd, targ = val + (tmp & 0x03ffffff) * 4; if ((src & 0xf0000000) != (targ & 0xf0000000)) { - _bfd_error_handler (_("%B: jump too far away\n"), input_bfd); + _bfd_error_handler (_("%pB: jump too far away"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -769,7 +769,7 @@ coff_pe_mips_relocate_section (bfd *output_bfd, targ = val + low + ((tmp & 0xffff) << 16); break; default: - _bfd_error_handler (_("%B: bad pair/reflo after refhi\n"), + _bfd_error_handler (_("%pB: bad pair/reflo after refhi"), input_bfd); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -871,9 +871,9 @@ const bfd_target BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_LITTLE, /* Header byte order is little. */ - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + (HAS_RELOC | EXEC_P /* Object flags. */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), #ifndef COFF_WITH_PE (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags. */ @@ -901,12 +901,24 @@ const bfd_target bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Headers. */ /* Note that we allow an object file to be treated as a core file as well. */ - {_bfd_dummy_target, coff_object_p, /* bfd_check_format. */ - bfd_generic_archive_p, coff_object_p}, - {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format. */ - bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false}, + { /* bfd_check_format. */ + _bfd_dummy_target, + coff_object_p, + bfd_generic_archive_p, + coff_object_p + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), diff --git a/bfd/pe-x86_64.c b/bfd/pe-x86_64.c index 44543e8..1f4e982 100644 --- a/bfd/pe-x86_64.c +++ b/bfd/pe-x86_64.c @@ -76,9 +76,9 @@ x86_64_pe_be_vec = BFD_ENDIAN_LITTLE, /* Data byte order is little. */ BFD_ENDIAN_LITTLE, /* Header byte order is little. */ - (HAS_RELOC | EXEC_P | /* Object flags. */ - HAS_LINENO | HAS_DEBUG | - HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS), + (HAS_RELOC | EXEC_P /* Object flags. */ + | HAS_LINENO | HAS_DEBUG + | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED | BFD_COMPRESS | BFD_DECOMPRESS), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* Section flags. */ | SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_READONLY | SEC_DEBUGGING @@ -97,12 +97,24 @@ x86_64_pe_be_vec = bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Hdrs. */ /* Note that we allow an object file to be treated as a core file as well. */ - { _bfd_dummy_target, amd64coff_object_p, /* BFD_check_format. */ - bfd_generic_archive_p, amd64coff_object_p }, - { bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format. */ - bfd_false }, - { bfd_false, coff_write_object_contents, /* bfd_write_contents. */ - _bfd_write_archive_contents, bfd_false }, + { /* bfd_check_format. */ + _bfd_dummy_target, + amd64coff_object_p, + bfd_generic_archive_p, + amd64coff_object_p + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + coff_mkobject, + _bfd_generic_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + coff_write_object_contents, + _bfd_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c index 679dabf..bc97984 100644 --- a/bfd/peXXigen.c +++ b/bfd/peXXigen.c @@ -154,7 +154,7 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) name = _bfd_coff_internal_syment_name (abfd, in, namebuf); if (name == NULL) { - _bfd_error_handler (_("%B: unable to find name for empty section"), + _bfd_error_handler (_("%pB: unable to find name for empty section"), abfd); bfd_set_error (bfd_error_invalid_target); return; @@ -180,7 +180,7 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) name = (const char *) bfd_alloc (abfd, strlen (namebuf) + 1); if (name == NULL) { - _bfd_error_handler (_("%B: out of memory creating name for empty section"), + _bfd_error_handler (_("%pB: out of memory creating name for empty section"), abfd); return; } @@ -191,7 +191,7 @@ _bfd_XXi_swap_sym_in (bfd * abfd, void * ext1, void * in1) sec = bfd_make_section_anyway_with_flags (abfd, name, flags); if (sec == NULL) { - _bfd_error_handler (_("%B: unable to create fake empty section"), + _bfd_error_handler (_("%pB: unable to create fake empty section"), abfd); return; } @@ -529,7 +529,7 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, { /* xgettext:c-format */ _bfd_error_handler - (_("%B: aout header specifies an invalid number of data-directory entries: %ld"), + (_("%pB: aout header specifies an invalid number of data-directory entries: %ld"), abfd, a->NumberOfRvaAndSizes); bfd_set_error (bfd_error_bad_value); @@ -828,7 +828,7 @@ _bfd_XXi_only_swap_filehdr_out (bfd * abfd, void * in, void * out) if (pe_data (abfd)->dll) filehdr_in->f_flags |= F_DLL; - filehdr_in->pe.e_magic = DOSMAGIC; + filehdr_in->pe.e_magic = IMAGE_DOS_SIGNATURE; filehdr_in->pe.e_cblp = 0x90; filehdr_in->pe.e_cp = 0x3; filehdr_in->pe.e_crlc = 0x0; @@ -872,7 +872,7 @@ _bfd_XXi_only_swap_filehdr_out (bfd * abfd, void * in, void * out) filehdr_in->pe.dos_message[13] = 0x0a0d0d2e; filehdr_in->pe.dos_message[14] = 0x24; filehdr_in->pe.dos_message[15] = 0x0; - filehdr_in->pe.nt_signature = NT_SIGNATURE; + filehdr_in->pe.nt_signature = IMAGE_NT_SIGNATURE; H_PUT_16 (abfd, filehdr_in->f_magic, filehdr_out->f_magic); H_PUT_16 (abfd, filehdr_in->f_nscns, filehdr_out->f_nscns); @@ -1086,7 +1086,7 @@ _bfd_XXi_swap_scnhdr_out (bfd * abfd, void * in, void * out) else { /* xgettext:c-format */ - _bfd_error_handler (_("%B: line number overflow: 0x%lx > 0xffff"), + _bfd_error_handler (_("%pB: line number overflow: 0x%lx > 0xffff"), abfd, scnhdr_int->s_nlnno); bfd_set_error (bfd_error_file_truncated); H_PUT_16 (abfd, 0xffff, scnhdr_ext->s_nlnno); @@ -1903,7 +1903,7 @@ pe_print_pdata (bfd * abfd, void * vfile) if ((stop % onaline) != 0) fprintf (file, /* xgettext:c-format */ - _("Warning, .pdata section size (%ld) is not a multiple of %d\n"), + _("warning, .pdata section size (%ld) is not a multiple of %d\n"), (long) stop, onaline); fprintf (file, @@ -2100,7 +2100,7 @@ _bfd_XX_print_ce_compressed_pdata (bfd * abfd, void * vfile) if ((stop % onaline) != 0) fprintf (file, /* xgettext:c-format */ - _("Warning, .pdata section size (%ld) is not a multiple of %d\n"), + _("warning, .pdata section size (%ld) is not a multiple of %d\n"), (long) stop, onaline); fprintf (file, @@ -2986,9 +2986,11 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd) > bfd_get_section_size (section)) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: Data Directory size (%lx) exceeds space left in section (%Lx)"), - obfd, ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size, - bfd_get_section_size (section) - (addr - section->vma)); + _bfd_error_handler + (_("%pB: Data Directory size (%lx) " + "exceeds space left in section (%" PRIx64 ")"), + obfd, ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size, + (uint64_t) (section->size - (addr - section->vma))); return FALSE; } @@ -3016,13 +3018,13 @@ _bfd_XX_bfd_copy_private_bfd_data_common (bfd * ibfd, bfd * obfd) if (!bfd_set_section_contents (obfd, section, data, 0, section->size)) { - _bfd_error_handler (_("Failed to update file offsets in debug directory")); + _bfd_error_handler (_("failed to update file offsets in debug directory")); return FALSE; } } else if (section) { - _bfd_error_handler (_("%B: Failed to read debug data section"), obfd); + _bfd_error_handler (_("%pB: failed to read debug data section"), obfd); return FALSE; } } @@ -4101,14 +4103,14 @@ rsrc_merge (struct rsrc_entry * a, struct rsrc_entry * b) if (adir->characteristics != bdir->characteristics) { - _bfd_error_handler (_(".rsrc merge failure: dirs with differing characteristics\n")); + _bfd_error_handler (_(".rsrc merge failure: dirs with differing characteristics")); bfd_set_error (bfd_error_file_truncated); return; } if (adir->major != bdir->major || adir->minor != bdir->minor) { - _bfd_error_handler (_(".rsrc merge failure: differing directory versions\n")); + _bfd_error_handler (_(".rsrc merge failure: differing directory versions")); bfd_set_error (bfd_error_file_truncated); return; } @@ -4225,7 +4227,7 @@ rsrc_process_section (bfd * abfd, if (data > dataend) { /* Corrupted .rsrc section - cannot merge. */ - _bfd_error_handler (_("%B: .rsrc merge failure: corrupt .rsrc section"), + _bfd_error_handler (_("%pB: .rsrc merge failure: corrupt .rsrc section"), abfd); bfd_set_error (bfd_error_file_truncated); goto end; @@ -4233,7 +4235,7 @@ rsrc_process_section (bfd * abfd, if ((data - p) > rsrc_sizes [num_resource_sets]) { - _bfd_error_handler (_("%B: .rsrc merge failure: unexpected .rsrc size"), + _bfd_error_handler (_("%pB: .rsrc merge failure: unexpected .rsrc size"), abfd); bfd_set_error (bfd_error_file_truncated); goto end; @@ -4372,7 +4374,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) else { _bfd_error_handler - (_("%B: unable to fill in DataDictionary[1] because .idata$2 is missing"), + (_("%pB: unable to fill in DataDictionary[1] because .idata$2 is missing"), abfd); result = FALSE; } @@ -4392,7 +4394,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) else { _bfd_error_handler - (_("%B: unable to fill in DataDictionary[1] because .idata$4 is missing"), + (_("%pB: unable to fill in DataDictionary[1] because .idata$4 is missing"), abfd); result = FALSE; } @@ -4413,7 +4415,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) else { _bfd_error_handler - (_("%B: unable to fill in DataDictionary[12] because .idata$5 is missing"), + (_("%pB: unable to fill in DataDictionary[12] because .idata$5 is missing"), abfd); result = FALSE; } @@ -4433,7 +4435,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) else { _bfd_error_handler - (_("%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because .idata$6 is missing"), + (_("%pB: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE (12)] because .idata$6 is missing"), abfd); result = FALSE; } @@ -4475,7 +4477,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) else { _bfd_error_handler - (_("%B: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE(12)]" + (_("%pB: unable to fill in DataDictionary[PE_IMPORT_ADDRESS_TABLE(12)]" " because .idata$6 is missing"), abfd); result = FALSE; } @@ -4500,7 +4502,7 @@ _bfd_XXi_final_link_postscript (bfd * abfd, struct coff_final_link_info *pfinfo) else { _bfd_error_handler - (_("%B: unable to fill in DataDictionary[9] because __tls_used is missing"), + (_("%pB: unable to fill in DataDictionary[9] because __tls_used is missing"), abfd); result = FALSE; } diff --git a/bfd/pef.c b/bfd/pef.c index 039d49d..a55ca06 100644 --- a/bfd/pef.c +++ b/bfd/pef.c @@ -38,7 +38,7 @@ #define bfd_pef_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_pef_new_section_hook _bfd_generic_new_section_hook #define bfd_pef_bfd_is_local_label_name bfd_generic_is_local_label_name -#define bfd_pef_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_pef_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define bfd_pef_get_lineno _bfd_nosymbols_get_lineno #define bfd_pef_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_pef_find_line _bfd_nosymbols_find_line @@ -1030,16 +1030,16 @@ const bfd_target pef_vec = _bfd_dummy_target, }, { /* bfd_set_format. */ - bfd_false, + _bfd_bool_bfd_false_error, bfd_pef_mkobject, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, - bfd_true, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_true, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (bfd_pef), @@ -1174,16 +1174,16 @@ const bfd_target pef_xlib_vec = _bfd_dummy_target, }, { /* bfd_set_format. */ - bfd_false, + _bfd_bool_bfd_false_error, bfd_pef_mkobject, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, - bfd_true, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_true, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (bfd_pef_xlib), diff --git a/bfd/peicode.h b/bfd/peicode.h index 94dd861..3b6afb8 100644 --- a/bfd/peicode.h +++ b/bfd/peicode.h @@ -772,13 +772,13 @@ pe_ILF_build_a_bfd (bfd * abfd, case IMPORT_CONST: /* XXX code yet to be written. */ /* xgettext:c-format */ - _bfd_error_handler (_("%B: Unhandled import type; %x"), + _bfd_error_handler (_("%pB: unhandled import type; %x"), abfd, import_type); return FALSE; default: /* xgettext:c-format */ - _bfd_error_handler (_("%B: Unrecognised import type; %x"), + _bfd_error_handler (_("%pB: unrecognized import type; %x"), abfd, import_type); return FALSE; } @@ -793,7 +793,7 @@ pe_ILF_build_a_bfd (bfd * abfd, default: /* xgettext:c-format */ - _bfd_error_handler (_("%B: Unrecognised import name type; %x"), + _bfd_error_handler (_("%pB: unrecognized import name type; %x"), abfd, import_name_type); return FALSE; } @@ -1214,7 +1214,7 @@ pe_ILF_object_p (bfd * abfd) default: _bfd_error_handler /* xgettext:c-format */ - (_("%B: Unrecognised machine type (0x%x)" + (_("%pB: unrecognised machine type (0x%x)" " in Import Library Format archive"), abfd, machine); bfd_set_error (bfd_error_malformed_archive); @@ -1227,7 +1227,7 @@ pe_ILF_object_p (bfd * abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: Recognised but unhandled machine type (0x%x)" + (_("%pB: recognised but unhandled machine type (0x%x)" " in Import Library Format archive"), abfd, machine); bfd_set_error (bfd_error_wrong_format); @@ -1245,7 +1245,7 @@ pe_ILF_object_p (bfd * abfd) if (size == 0) { _bfd_error_handler - (_("%B: size field is zero in Import Library Format header"), abfd); + (_("%pB: size field is zero in Import Library Format header"), abfd); bfd_set_error (bfd_error_malformed_archive); return NULL; @@ -1277,7 +1277,7 @@ pe_ILF_object_p (bfd * abfd) || (bfd_size_type) ((bfd_byte *) source_dll - ptr) >= size) { _bfd_error_handler - (_("%B: string not null terminated in ILF object file."), abfd); + (_("%pB: string not null terminated in ILF object file"), abfd); bfd_set_error (bfd_error_malformed_archive); bfd_release (abfd, ptr); return NULL; @@ -1332,8 +1332,9 @@ pe_bfd_read_buildid (bfd *abfd) if (dataoff >= section->size || size > section->size - dataoff) { - _bfd_error_handler (_("%B: Error: Debug Data ends beyond end of debug directory."), - abfd); + _bfd_error_handler + (_("%pB: error: debug data ends beyond end of debug directory"), + abfd); return; } @@ -1386,7 +1387,7 @@ static const bfd_target * pe_bfd_object_p (bfd * abfd) { bfd_byte buffer[6]; - struct external_PEI_DOS_hdr dos_hdr; + struct external_DOS_hdr dos_hdr; struct external_PEI_IMAGE_hdr image_hdr; struct internal_filehdr internal_f; struct internal_aouthdr internal_a; @@ -1420,7 +1421,7 @@ pe_bfd_object_p (bfd * abfd) /* There are really two magic numbers involved; the magic number that says this is a NT executable (PEI) and the magic number that - determines the architecture. The former is DOSMAGIC, stored in + determines the architecture. The former is IMAGE_DOS_SIGNATURE, stored in the e_magic field. The latter is stored in the f_magic field. If the NT magic number isn't valid, the architecture magic number could be mimicked by some other field (specifically, the number @@ -1428,7 +1429,7 @@ pe_bfd_object_p (bfd * abfd) correctly for a PEI file, check the e_magic number here, and, if it doesn't match, clobber the f_magic number so that we don't get a false match. */ - if (H_GET_16 (abfd, dos_hdr.e_magic) != DOSMAGIC) + if (H_GET_16 (abfd, dos_hdr.e_magic) != IMAGE_DOS_SIGNATURE) { bfd_set_error (bfd_error_wrong_format); return NULL; diff --git a/bfd/plugin.c b/bfd/plugin.c index b088191..a2c1bd5 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -80,7 +80,7 @@ dlerror (void) #define bfd_plugin_bfd_set_private_flags _bfd_generic_bfd_set_private_flags #define bfd_plugin_core_file_matches_executable_p generic_core_file_matches_executable_p #define bfd_plugin_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name -#define bfd_plugin_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_plugin_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno #define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_plugin_find_line _bfd_nosymbols_find_line @@ -594,16 +594,16 @@ const bfd_target plugin_vec = _bfd_dummy_target }, { /* bfd_set_format. */ - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, _bfd_generic_mkarchive, - bfd_false, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (bfd_plugin), diff --git a/bfd/po/bfd.pot b/bfd/po/bfd.pot index 7a65f17..91c21b2 100644 --- a/bfd/po/bfd.pot +++ b/bfd/po/bfd.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: bug-binutils@gnu.org\n" -"POT-Creation-Date: 2018-01-27 14:58+0000\n" +"POT-Creation-Date: 2018-01-13 13:45+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -206,7 +206,7 @@ msgid "warning: writing section `%A' at huge (ie negative) file offset" msgstr "" #: bout.c:1142 elf-m10300.c:2647 elf32-avr.c:2484 elf32-frv.c:5633 -#: elf64-ia64-vms.c:353 elfxx-sparc.c:2812 reloc.c:8059 reloc16.c:156 +#: elf64-ia64-vms.c:353 elfxx-sparc.c:2817 reloc.c:8059 reloc16.c:156 #: elf32-ia64.c:351 elf64-ia64.c:351 msgid "%P%F: --relax and -r may not be used together\n" msgstr "" @@ -972,7 +972,7 @@ msgstr "" #: elf32-or1k.c:1238 elf32-score.c:2731 elf32-score7.c:2540 elf32-spu.c:5076 #: elf32-tilepro.c:3497 elf32-v850.c:2283 elf32-visium.c:677 #: elf32-xstormy16.c:923 elf64-mmix.c:1538 elfxx-tilegx.c:3857 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:2237 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:2237 msgid "internal error: out of range error" msgstr "" @@ -986,7 +986,7 @@ msgstr "" #: elf32-score7.c:2544 elf32-spu.c:5080 elf32-tilepro.c:3501 elf32-v850.c:2287 #: elf32-visium.c:681 elf32-xstormy16.c:927 elf64-mmix.c:1542 #: elfxx-mips.c:10265 elfxx-tilegx.c:3861 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:2241 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:2241 msgid "internal error: unsupported relocation error" msgstr "" @@ -1007,7 +1007,7 @@ msgstr "" #: elf32-nds32.c:5340 elf32-or1k.c:1250 elf32-score.c:2748 elf32-score7.c:2552 #: elf32-spu.c:5088 elf32-tilepro.c:3509 elf32-v850.c:2307 elf32-visium.c:689 #: elf32-xstormy16.c:935 elf64-mmix.c:1550 elfxx-tilegx.c:3869 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:2249 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:2249 msgid "internal error: unknown error" msgstr "" @@ -1029,10 +1029,10 @@ msgstr "" #: elf-m10300.c:2093 elf32-arm.c:12536 elf32-i386.c:3433 elf32-m32r.c:2526 #: elf32-m68k.c:3895 elf32-s390.c:3204 elf32-sh.c:4121 elf32-tilepro.c:3401 #: elf32-xtensa.c:2939 elf64-s390.c:3118 elf64-sh64.c:1636 elf64-x86-64.c:3790 -#: elfxx-sparc.c:3913 elfxx-tilegx.c:3781 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:5001 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6457 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:2206 +#: elfxx-sparc.c:3918 elfxx-tilegx.c:3781 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:5001 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6457 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:2206 #, c-format msgid "%B(%A+%#Lx): unresolvable %s relocation against symbol `%s'" msgstr "" @@ -1089,7 +1089,7 @@ msgstr "" msgid "%B: invalid string offset %u >= %Lu for section `%s'" msgstr "" -#: elf.c:497 /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:7535 +#: elf.c:497 /work/sources/binutils/current/bfd/elfnn-aarch64.c:7535 #, c-format msgid "%B symbol number %lu references nonexistent SHT_SYMTAB_SHNDX section" msgstr "" @@ -1342,7 +1342,7 @@ msgstr "" #: elf32-arc.c:433 elf32-frv.c:6623 elf32-iq2000.c:866 elf32-m32c.c:912 #: elf32-mt.c:560 elf32-rl78.c:1257 elf32-rx.c:3178 elf32-visium.c:837 -#: elf64-ppc.c:6082 +#: elf64-ppc.c:6067 #, c-format msgid "private flags = 0x%lx:" msgstr "" @@ -1381,7 +1381,7 @@ msgid "ERROR: Attempting to link %B with a binary %B of different architecture" msgstr "" #: elf32-arc.c:891 elf32-i370.c:359 elf32-iq2000.c:842 elf32-m32c.c:887 -#: elf32-m68hc1x.c:1384 elf32-ppc.c:4860 elf64-sparc.c:727 elfxx-mips.c:15082 +#: elf32-m68hc1x.c:1384 elf32-ppc.c:4846 elf64-sparc.c:727 elfxx-mips.c:15082 #, c-format msgid "%B: uses different e_flags (%#x) fields than previous modules (%#x)" msgstr "" @@ -1440,8 +1440,8 @@ msgid "%B(%A): internal error: unknown error" msgstr "" #: elf32-arc.c:1968 elf32-arm.c:14521 elf32-metag.c:2252 elfxx-mips.c:8889 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:7103 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:471 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:7103 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:471 #, c-format msgid "" "%B: relocation %s against `%s' can not be used when making a shared object; " @@ -1482,7 +1482,7 @@ msgstr "" #: elf32-arm.c:4490 elf32-arm.c:6627 elf32-hppa.c:577 elf32-m68hc1x.c:165 #: elf32-metag.c:1183 elf32-nios2.c:2207 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:2854 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:2854 #, c-format msgid "%B: cannot create stub entry %s" msgstr "" @@ -1685,29 +1685,29 @@ msgid "%B(%A+%#Lx): %s relocation against SEC_MERGE section" msgstr "" #: elf32-arm.c:12481 elf32-m68k.c:3931 elf32-xtensa.c:2681 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6185 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6185 #, c-format msgid "%B(%A+%#Lx): %s used with TLS symbol %s" msgstr "" #: elf32-arm.c:12483 elf32-m68k.c:3933 elf32-xtensa.c:2683 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6187 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6187 #, c-format msgid "%B(%A+%#Lx): %s used with non-TLS symbol %s" msgstr "" #: elf32-arm.c:12565 elf32-tic6x.c:2674 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6520 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6520 msgid "out of range" msgstr "" #: elf32-arm.c:12569 elf32-nios2.c:4492 elf32-pru.c:821 elf32-tic6x.c:2678 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6524 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6524 msgid "unsupported relocation" msgstr "" #: elf32-arm.c:12577 elf32-nios2.c:4502 elf32-pru.c:831 elf32-tic6x.c:2686 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6532 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6532 msgid "unknown error" msgstr "" @@ -1789,7 +1789,7 @@ msgstr "" #: elf32-arm.c:14136 elf32-bfin.c:4729 elf32-cris.c:3905 elf32-m68hc1x.c:1409 #: elf32-m68k.c:1199 elf32-score.c:3998 elf32-score7.c:3803 elf32-vax.c:536 #: elf32-xgate.c:669 elfxx-mips.c:15756 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6686 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6686 #, c-format msgid "private flags = %lx:" msgstr "" @@ -1904,8 +1904,7 @@ msgstr "" msgid " [relocatable executable]" msgstr "" -#: elf32-arm.c:14251 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6689 +#: elf32-arm.c:14251 /work/sources/binutils/current/bfd/elfnn-aarch64.c:6689 #, c-format msgid "" msgstr "" @@ -1913,19 +1912,18 @@ msgstr "" #: elf32-arm.c:14368 elf32-i386.c:1510 elf32-s390.c:956 elf32-tic6x.c:2749 #: elf32-tilepro.c:1471 elf32-xtensa.c:1018 elf64-s390.c:875 #: elf64-x86-64.c:1823 elfxx-sparc.c:1420 elfxx-tilegx.c:1688 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6978 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:513 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6978 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:513 #, c-format msgid "%B: bad symbol index: %d" msgstr "" #: elf32-arm.c:15636 elf32-hppa.c:2082 elf32-lm32.c:1989 elf32-m32r.c:2097 -#: elf32-metag.c:2792 elf32-nds32.c:3844 elf32-or1k.c:2281 elf32-ppc.c:6167 +#: elf32-metag.c:2792 elf32-nds32.c:3844 elf32-or1k.c:2281 elf32-ppc.c:6156 #: elf32-s390.c:1851 elf32-sh.c:3289 elf32-tic6x.c:3205 elf32-tilepro.c:2237 -#: elf64-ppc.c:9943 elf64-s390.c:1785 elfxx-sparc.c:2452 elfxx-tilegx.c:2479 -#: elfxx-x86.c:563 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:8319 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:1112 +#: elf64-ppc.c:9893 elf64-s390.c:1785 elfxx-sparc.c:2457 elfxx-tilegx.c:2479 +#: elfxx-x86.c:563 /work/sources/binutils/current/bfd/elfnn-aarch64.c:8319 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:1112 #, c-format msgid "%B: dynamic relocation against `%T' in read-only section `%A'\n" msgstr "" @@ -2012,12 +2010,11 @@ msgstr "" #: elf32-metag.c:1993 elf32-moxie.c:293 elf32-msp430.c:1361 elf32-mt.c:404 #: elf32-or1k.c:1246 elf32-tilepro.c:3505 elf32-v850.c:2291 elf32-visium.c:685 #: elf32-xstormy16.c:931 elf64-mmix.c:1546 elfxx-tilegx.c:3865 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:2245 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:2245 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-avr.c:3319 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:2882 +#: elf32-avr.c:3319 /work/sources/binutils/current/bfd/elfnn-aarch64.c:2882 #, c-format msgid "cannot create stub entry %s" msgstr "" @@ -2472,8 +2469,8 @@ msgid "%B: Relocation %s is not yet supported for symbol %s." msgstr "" #. Unknown relocation. -#: elf32-i386.c:384 elf32-m68k.c:352 elf32-ppc.c:2046 elf32-s390.c:346 -#: elf32-tic6x.c:2609 elf32-wasm32.c:106 elf64-ppc.c:2522 elf64-s390.c:373 +#: elf32-i386.c:384 elf32-m68k.c:352 elf32-ppc.c:2039 elf32-s390.c:346 +#: elf32-tic6x.c:2609 elf32-wasm32.c:106 elf64-ppc.c:2516 elf64-s390.c:373 #: elf64-x86-64.c:285 #, c-format msgid "%B: invalid relocation type %d" @@ -2494,7 +2491,7 @@ msgstr "" #: elf32-i386.c:1703 elf32-s390.c:1184 elf32-sh.c:6057 elf32-tilepro.c:1584 #: elf32-xtensa.c:1192 elf64-s390.c:1113 elfxx-sparc.c:1601 elfxx-tilegx.c:1793 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:427 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:427 #, c-format msgid "%B: `%s' accessed both as normal and thread local symbol" msgstr "" @@ -2836,7 +2833,7 @@ msgid "%B: unrecognised MicroBlaze reloc number: %d" msgstr "" #: elf32-microblaze.c:1482 elf32-or1k.c:1052 elf32-tilepro.c:3147 -#: elfxx-sparc.c:3532 elfxx-tilegx.c:3531 +#: elfxx-sparc.c:3537 elfxx-tilegx.c:3531 msgid "%B: probably compiled without -fPIC?" msgstr "" @@ -3105,110 +3102,110 @@ msgstr "" msgid "%B: unrecognised PicoJava reloc number: %d" msgstr "" -#: elf32-ppc.c:2034 +#: elf32-ppc.c:2027 #, c-format msgid "%B: unrecognised PPC reloc number: %d" msgstr "" -#: elf32-ppc.c:2119 +#: elf32-ppc.c:2112 #, c-format msgid "generic linker can't handle %s" msgstr "" -#: elf32-ppc.c:2739 +#: elf32-ppc.c:2732 #, c-format msgid "corrupt %s section in %B" msgstr "" -#: elf32-ppc.c:2759 +#: elf32-ppc.c:2752 #, c-format msgid "unable to read in %s section from %B" msgstr "" -#: elf32-ppc.c:2801 +#: elf32-ppc.c:2794 #, c-format msgid "warning: unable to set size of %s section in %B" msgstr "" -#: elf32-ppc.c:2851 +#: elf32-ppc.c:2844 msgid "failed to allocate space for new APUinfo section." msgstr "" -#: elf32-ppc.c:2870 +#: elf32-ppc.c:2863 msgid "failed to compute new APUinfo section." msgstr "" -#: elf32-ppc.c:2873 +#: elf32-ppc.c:2866 msgid "failed to install new APUinfo section." msgstr "" -#: elf32-ppc.c:3929 +#: elf32-ppc.c:3915 #, c-format msgid "%B: relocation %s cannot be used when making a shared object" msgstr "" -#: elf32-ppc.c:4280 elf64-ppc.c:5612 +#: elf32-ppc.c:4266 elf64-ppc.c:5597 #, c-format msgid "%H: %s reloc against local symbol\n" msgstr "" -#: elf32-ppc.c:4642 elf32-ppc.c:4646 +#: elf32-ppc.c:4628 elf32-ppc.c:4632 #, c-format msgid "Warning: %B uses hard float, %B uses soft float" msgstr "" -#: elf32-ppc.c:4650 elf32-ppc.c:4655 +#: elf32-ppc.c:4636 elf32-ppc.c:4641 #, c-format msgid "" "Warning: %B uses double-precision hard float, %B uses single-precision hard " "float" msgstr "" -#: elf32-ppc.c:4670 elf32-ppc.c:4675 +#: elf32-ppc.c:4656 elf32-ppc.c:4661 #, c-format msgid "Warning: %B uses 64-bit long double, %B uses 128-bit long double" msgstr "" -#: elf32-ppc.c:4680 elf32-ppc.c:4685 +#: elf32-ppc.c:4666 elf32-ppc.c:4671 #, c-format msgid "Warning: %B uses IBM long double, %B uses IEEE long double" msgstr "" -#: elf32-ppc.c:4736 elf32-ppc.c:4741 +#: elf32-ppc.c:4722 elf32-ppc.c:4727 #, c-format msgid "Warning: %B uses AltiVec vector ABI, %B uses SPE vector ABI" msgstr "" -#: elf32-ppc.c:4764 elf32-ppc.c:4769 +#: elf32-ppc.c:4750 elf32-ppc.c:4755 #, c-format msgid "Warning: %B uses r3/r4 for small structure returns, %B uses memory" msgstr "" -#: elf32-ppc.c:4824 +#: elf32-ppc.c:4810 msgid "" "%B: compiled with -mrelocatable and linked with modules compiled normally" msgstr "" -#: elf32-ppc.c:4832 +#: elf32-ppc.c:4818 msgid "" "%B: compiled normally and linked with modules compiled with -mrelocatable" msgstr "" -#: elf32-ppc.c:4901 +#: elf32-ppc.c:4887 #, c-format msgid "%B(%A+0x%lx): expected 16A style relocation on 0x%08x insn" msgstr "" -#: elf32-ppc.c:4920 +#: elf32-ppc.c:4906 #, c-format msgid "%B(%A+0x%lx): expected 16D style relocation on 0x%08x insn" msgstr "" -#: elf32-ppc.c:5011 +#: elf32-ppc.c:4997 msgid "%P: bss-plt forced due to %B\n" msgstr "" -#: elf32-ppc.c:5014 +#: elf32-ppc.c:5000 msgid "%P: bss-plt forced by profiling\n" msgstr "" @@ -3216,40 +3213,40 @@ msgstr "" #. could just mark this symbol to exclude it #. from tls optimization but it's safer to skip #. the entire optimization. -#: elf32-ppc.c:5336 elf64-ppc.c:8669 +#: elf32-ppc.c:5322 elf64-ppc.c:8654 #, c-format msgid "%H arg lost __tls_get_addr, TLS optimization disabled\n" msgstr "" -#: elf32-ppc.c:6275 elf32-sh.c:3392 elf32-tilepro.c:2331 elfxx-sparc.c:2551 +#: elf32-ppc.c:6264 elf32-sh.c:3392 elf32-tilepro.c:2331 elfxx-sparc.c:2556 #: elfxx-tilegx.c:2567 msgid "%B: dynamic relocation in read-only section `%A'\n" msgstr "" -#: elf32-ppc.c:8146 +#: elf32-ppc.c:8100 msgid "%H: fixup branch overflow\n" msgstr "" -#: elf32-ppc.c:8186 elf32-ppc.c:8221 +#: elf32-ppc.c:8140 elf32-ppc.c:8175 #, c-format msgid "%B(%A+%#Lx): error: %s with unexpected instruction %#x" msgstr "" -#: elf32-ppc.c:8277 +#: elf32-ppc.c:8231 #, c-format msgid "%X%H: unsupported bss-plt -fPIC ifunc %s\n" msgstr "" -#: elf32-ppc.c:8341 elf64-ppc.c:15142 +#: elf32-ppc.c:8294 elf64-ppc.c:15070 msgid "%H: warning: %s unexpected insn %#x.\n" msgstr "" -#: elf32-ppc.c:8366 +#: elf32-ppc.c:8319 #, c-format msgid "%P: %B: unknown relocation type %d for symbol %s\n" msgstr "" -#: elf32-ppc.c:8653 +#: elf32-ppc.c:8606 #, c-format msgid "%H: non-zero addend on %s reloc against `%s'\n" msgstr "" @@ -3262,62 +3259,62 @@ msgstr "" #. local won't have the +32k reloc addend trick marking #. -fPIC code, so the linker won't know whether r30 is #. _GLOBAL_OFFSET_TABLE_ or pointing into a .got2 section. -#: elf32-ppc.c:8685 +#: elf32-ppc.c:8638 #, c-format msgid "%X%H: @local call to ifunc %s\n" msgstr "" -#: elf32-ppc.c:8855 +#: elf32-ppc.c:8808 #, c-format msgid "%H: relocation %s for indirect function %s unsupported\n" msgstr "" -#: elf32-ppc.c:9126 elf32-ppc.c:9157 elf32-ppc.c:9248 +#: elf32-ppc.c:9077 elf32-ppc.c:9108 elf32-ppc.c:9199 #, c-format msgid "" "%P: %B: the target (%s) of a %s relocation is in the wrong output section " "(%s)\n" msgstr "" -#: elf32-ppc.c:9336 +#: elf32-ppc.c:9287 #, c-format msgid "" "%B: the target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:9444 +#: elf32-ppc.c:9395 #, c-format msgid "%P: %B: relocation %s is not yet supported for symbol %s\n" msgstr "" -#: elf32-ppc.c:9529 +#: elf32-ppc.c:9480 #, c-format msgid "%H: error: %s against `%s' not a multiple of %u\n" msgstr "" -#: elf32-ppc.c:9558 +#: elf32-ppc.c:9509 #, c-format msgid "%H: unresolvable %s relocation against symbol `%s'\n" msgstr "" -#: elf32-ppc.c:9639 +#: elf32-ppc.c:9590 #, c-format msgid "%H: %s reloc against `%s': error %d\n" msgstr "" -#: elf32-ppc.c:10383 elf64-ppc.c:15673 +#: elf32-ppc.c:10354 elf64-ppc.c:15601 msgid "" "%X%P: text relocations and GNU indirect functions will result in a segfault " "at runtime\n" msgstr "" -#: elf32-ppc.c:10387 elf64-ppc.c:15677 +#: elf32-ppc.c:10358 elf64-ppc.c:15605 msgid "" "%P: warning: text relocations and GNU indirect functions may result in a " "segfault at runtime\n" msgstr "" -#: elf32-ppc.c:10432 +#: elf32-ppc.c:10403 #, c-format msgid "%P: %s not defined in linker created %s\n" msgstr "" @@ -3819,9 +3816,9 @@ msgstr "" msgid "warning: %B and %B differ in whether code is compiled for DSBT" msgstr "" -#: elf32-tilepro.c:3752 elfxx-tilegx.c:4132 elfxx-x86.c:1345 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:9172 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:2492 +#: elf32-tilepro.c:3752 elfxx-tilegx.c:4132 elfxx-x86.c:1336 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:9172 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:2492 #, c-format msgid "discarded output section: `%A'" msgstr "" @@ -4459,137 +4456,137 @@ msgid "" " Please report this bug." msgstr "" -#: elf64-ppc.c:4655 +#: elf64-ppc.c:4640 #, c-format msgid "%P: %B: cannot create stub entry %s\n" msgstr "" -#: elf64-ppc.c:4986 +#: elf64-ppc.c:4971 msgid "%P: symbol '%s' has invalid st_other for ABI version 1\n" msgstr "" -#: elf64-ppc.c:5161 +#: elf64-ppc.c:5146 #, c-format msgid "%P: %B .opd not allowed in ABI version %d\n" msgstr "" -#: elf64-ppc.c:5660 +#: elf64-ppc.c:5645 #, c-format msgid "%H: %s reloc unsupported in shared libraries and PIEs.\n" msgstr "" -#: elf64-ppc.c:6050 +#: elf64-ppc.c:6035 #, c-format msgid "%B uses unknown e_flags 0x%lx" msgstr "" -#: elf64-ppc.c:6058 +#: elf64-ppc.c:6043 #, c-format msgid "%B: ABI version %ld is not compatible with ABI version %ld output" msgstr "" -#: elf64-ppc.c:6086 +#: elf64-ppc.c:6071 #, c-format msgid " [abiv%ld]" msgstr "" -#: elf64-ppc.c:7270 +#: elf64-ppc.c:7255 msgid "" "%P: copy reloc against `%T' requires lazy plt linking; avoid setting " "LD_BIND_NOW=1 or upgrade gcc\n" msgstr "" -#: elf64-ppc.c:7537 +#: elf64-ppc.c:7522 msgid "%B: undefined symbol on R_PPC64_TOCSAVE relocation" msgstr "" -#: elf64-ppc.c:7764 +#: elf64-ppc.c:7749 #, c-format msgid "%P: dynreloc miscount for %B, section %A\n" msgstr "" -#: elf64-ppc.c:7853 +#: elf64-ppc.c:7838 msgid "%B: .opd is not a regular array of opd entries" msgstr "" -#: elf64-ppc.c:7863 +#: elf64-ppc.c:7848 #, c-format msgid "%B: unexpected reloc type %u in .opd section" msgstr "" -#: elf64-ppc.c:7885 +#: elf64-ppc.c:7870 #, c-format msgid "%B: undefined sym `%s' in .opd section" msgstr "" -#: elf64-ppc.c:8222 +#: elf64-ppc.c:8207 msgid "" "%P: warning: --plt-localentry is especially dangerous without ld.so support " "to detect ABI violations.\n" msgstr "" -#: elf64-ppc.c:8471 +#: elf64-ppc.c:8456 msgid "%H __tls_get_addr lost arg, TLS optimization disabled\n" msgstr "" -#: elf64-ppc.c:8815 elf64-ppc.c:9452 +#: elf64-ppc.c:8800 elf64-ppc.c:9437 #, c-format msgid "%s defined on removed toc entry" msgstr "" -#: elf64-ppc.c:9180 +#: elf64-ppc.c:9165 #, c-format msgid "%H: toc optimization is not supported for %s instruction.\n" msgstr "" -#: elf64-ppc.c:9409 +#: elf64-ppc.c:9394 #, c-format msgid "%H: %s references optimized away TOC entry\n" msgstr "" -#: elf64-ppc.c:10205 +#: elf64-ppc.c:10157 #, c-format msgid "warning: discarding dynamic section %s" msgstr "" -#: elf64-ppc.c:10823 +#: elf64-ppc.c:10746 msgid "%P: cannot find opd entry toc for `%T'\n" msgstr "" -#: elf64-ppc.c:10911 +#: elf64-ppc.c:10837 msgid "%P: long branch stub `%s' offset overflow\n" msgstr "" -#: elf64-ppc.c:10970 +#: elf64-ppc.c:10896 msgid "%P: can't find branch stub `%s'\n" msgstr "" -#: elf64-ppc.c:11034 elf64-ppc.c:11179 elf64-ppc.c:13050 +#: elf64-ppc.c:10960 elf64-ppc.c:11112 elf64-ppc.c:12974 #, c-format msgid "%P: linkage table error against `%T'\n" msgstr "" -#: elf64-ppc.c:11397 +#: elf64-ppc.c:11331 msgid "%P: can't build branch stub `%s'\n" msgstr "" -#: elf64-ppc.c:12172 +#: elf64-ppc.c:12104 #, c-format msgid "%B section %A exceeds stub group size" msgstr "" -#: elf64-ppc.c:13314 +#: elf64-ppc.c:13242 msgid "%P: stubs don't match calculated size\n" msgstr "" -#: elf64-ppc.c:13328 +#: elf64-ppc.c:13256 #, c-format msgid "linker stubs in %u group\n" msgid_plural "linker stubs in %u groups\n" msgstr[0] "" msgstr[1] "" -#: elf64-ppc.c:13332 +#: elf64-ppc.c:13260 #, c-format msgid "" " branch %lu\n" @@ -4601,59 +4598,59 @@ msgid "" " global entry %lu" msgstr "" -#: elf64-ppc.c:13651 +#: elf64-ppc.c:13579 #, c-format msgid "%H: %s used with TLS symbol `%T'\n" msgstr "" -#: elf64-ppc.c:13653 +#: elf64-ppc.c:13581 #, c-format msgid "%H: %s used with non-TLS symbol `%T'\n" msgstr "" -#: elf64-ppc.c:14263 +#: elf64-ppc.c:14191 #, c-format msgid "%H: call to `%T' lacks nop, can't restore toc; recompile with -fPIC\n" msgstr "" -#: elf64-ppc.c:14269 +#: elf64-ppc.c:14197 #, c-format msgid "" "%H: call to `%T' lacks nop, can't restore toc; (-mcmodel=small toc adjust " "stub)\n" msgstr "" -#: elf64-ppc.c:14397 +#: elf64-ppc.c:14325 #, c-format msgid "%P: %B: unknown relocation type %d for `%T'\n" msgstr "" -#: elf64-ppc.c:14946 +#: elf64-ppc.c:14874 #, c-format msgid "%H: %s for indirect function `%T' unsupported\n" msgstr "" -#: elf64-ppc.c:15058 +#: elf64-ppc.c:14986 #, c-format msgid "%P: %B: %s is not supported for `%T'\n" msgstr "" -#: elf64-ppc.c:15241 +#: elf64-ppc.c:15169 #, c-format msgid "%H: error: %s not a multiple of %u\n" msgstr "" -#: elf64-ppc.c:15263 +#: elf64-ppc.c:15191 #, c-format msgid "%H: unresolvable %s against `%T'\n" msgstr "" -#: elf64-ppc.c:15360 +#: elf64-ppc.c:15288 #, c-format msgid "%H: %s against `%T': error %d\n" msgstr "" -#: elf64-ppc.c:15750 elf64-ppc.c:15769 +#: elf64-ppc.c:15678 elf64-ppc.c:15697 msgid "%P: %s offset too large for .eh_frame sdata4 encoding" msgstr "" @@ -4742,8 +4739,7 @@ msgstr "" msgid "%B: '%s' accessed both as normal and thread local symbol" msgstr "" -#: elf64-x86-64.c:2651 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:5040 +#: elf64-x86-64.c:2651 /work/sources/binutils/current/bfd/elfnn-aarch64.c:5040 #, c-format msgid "" "%B: relocation %s against STT_GNU_IFUNC symbol `%s' has non-zero addend: %Ld" @@ -5373,8 +5369,7 @@ msgstr "" msgid "invalid relocation type %d" msgstr "" -#: elfxx-sparc.c:3124 -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:5024 +#: elfxx-sparc.c:3129 /work/sources/binutils/current/bfd/elfnn-aarch64.c:5024 #, c-format msgid "%B: relocation %s against STT_GNU_IFUNC symbol `%s' isn't handled by %s" msgstr "" @@ -5389,69 +5384,69 @@ msgstr "" msgid "%P: %B: warning: relocation against `%s' in read-only section `%A'\n" msgstr "" -#: elfxx-x86.c:963 +#: elfxx-x86.c:954 msgid "%P: %B: warning: relocation in read-only section `%A'\n" msgstr "" -#: elfxx-x86.c:1296 +#: elfxx-x86.c:1287 msgid "" "%P%X: read-only segment has dynamic IFUNC relocations; recompile with -fPIC\n" msgstr "" -#: elfxx-x86.c:2250 +#: elfxx-x86.c:2241 msgid "error: %B: " msgstr "" -#: elfxx-x86.c:2252 +#: elfxx-x86.c:2243 msgid "error: %B: " msgstr "" -#: elfxx-x86.c:2253 +#: elfxx-x86.c:2244 msgid "error: %B: " msgstr "" -#: elfxx-x86.c:2425 +#: elfxx-x86.c:2416 msgid "%F%P: failed to create GNU property section\n" msgstr "" -#: elfxx-x86.c:2430 +#: elfxx-x86.c:2421 #, c-format msgid "%F%A: failed to align section\n" msgstr "" -#: elfxx-x86.c:2580 +#: elfxx-x86.c:2571 msgid "%F%P: failed to create VxWorks dynamic sections\n" msgstr "" -#: elfxx-x86.c:2589 +#: elfxx-x86.c:2580 msgid "%F%P: failed to create GOT sections\n" msgstr "" -#: elfxx-x86.c:2607 +#: elfxx-x86.c:2598 msgid "%F%P: failed to create ifunc sections\n" msgstr "" -#: elfxx-x86.c:2648 +#: elfxx-x86.c:2639 msgid "%F%P: failed to create GOT PLT section\n" msgstr "" -#: elfxx-x86.c:2669 +#: elfxx-x86.c:2660 msgid "%F%P: failed to create IBT-enabled PLT section\n" msgstr "" -#: elfxx-x86.c:2684 +#: elfxx-x86.c:2675 msgid "%F%P: failed to create BND PLT section\n" msgstr "" -#: elfxx-x86.c:2705 +#: elfxx-x86.c:2696 msgid "%F%P: failed to create PLT .eh_frame section\n" msgstr "" -#: elfxx-x86.c:2718 +#: elfxx-x86.c:2709 msgid "%F%P: failed to create GOT PLT .eh_frame section\n" msgstr "" -#: elfxx-x86.c:2732 +#: elfxx-x86.c:2723 msgid "%F%P: failed to create the second PLT .eh_frame section\n" msgstr "" @@ -8215,67 +8210,67 @@ msgstr "" msgid "TOC overflow: %#Lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:1890 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:1890 #, c-format msgid "Invalid AArch64 reloc number: %d" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:4779 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:4779 msgid "%B: error: Erratum 835769 stub out of range (input file too large)" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:4860 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:4860 msgid "%B: error: Erratum 843419 stub out of range (input file too large)" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:5366 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:5366 #, c-format msgid "" "%B: relocation %s against symbol `%s' which may bind externally can not be " "used when making a shared object; recompile with -fPIC" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:5457 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:5457 #, c-format msgid "" "%B: Local symbol descriptor table be NULL when applying relocation %s " "against local symbol" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6479 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6479 msgid "Too many GOT entries for -fpic, please recompile with -fPIC" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:6507 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:6507 msgid "" "One possible cause of this error is that the symbol is being referenced in " "the indicated code as if it had a larger alignment than was declared where " "it was defined." msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-aarch64.c:7084 +#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:7084 #, c-format msgid "" "%B: relocation %s against `%s' can not be used when making a shared object" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:2570 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:2570 msgid "" "%B: ABI is incompatible with that of the selected emulation:\n" " target emulation `%s' does not match `%s'" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:2590 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:2590 msgid "%B: can't link hard-float modules with soft-float modules" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:3070 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:3070 msgid "" "%B(%A+0x%lx): %d bytes required for alignment to %d-byte boundary, but only " "%d present" msgstr "" -#: /work/sources/binutils/branches/2.30/bfd/elfnn-riscv.c:3136 +#: /work/sources/binutils/current/bfd/elfnn-riscv.c:3136 msgid "" "%B(%A+0x%lx): Unable to clear RISCV_PCREL_HI20 relocfor cooresponding " "RISCV_PCREL_LO12 reloc" diff --git a/bfd/po/ru.po b/bfd/po/ru.po index 194011d..d1c6d68 100644 --- a/bfd/po/ru.po +++ b/bfd/po/ru.po @@ -911,7 +911,7 @@ msgstr "%P: из-за кодировки FDE в %B(%A) таблица .eh_frame_ #: elf-eh-frame.c:1544 msgid "%P: Further warnings about FDE encoding preventing .eh_frame_hdr generation dropped.\n" -msgstr "%P: в дальнейшем предупреждения о не создании таблицы .eh_frame_hdr из-за кодировки FDE в %B(%A) будут отбрасываться.\n" +msgstr "%P: в дальнейшем предупреждения о не создании таблицы .eh_frame_hdr из-за кодировки FDE будут отбрасываться.\n" #: elf-eh-frame.c:1866 #, c-format diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c index dd0b96f..bbb2cc7 100644 --- a/bfd/ppcboot.c +++ b/bfd/ppcboot.c @@ -328,8 +328,7 @@ ppcboot_get_symbol_info (bfd *ignore_abfd ATTRIBUTE_UNUSED, #define ppcboot_get_symbol_version_string \ _bfd_nosymbols_get_symbol_version_string -#define ppcboot_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define ppcboot_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name #define ppcboot_get_lineno _bfd_nosymbols_get_lineno #define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line @@ -507,16 +506,16 @@ const bfd_target powerpc_boot_vec = _bfd_dummy_target, }, { /* bfd_set_format */ - bfd_false, + _bfd_bool_bfd_false_error, ppcboot_mkobject, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents */ - bfd_false, - bfd_true, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_true, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (ppcboot), diff --git a/bfd/ptrace-core.c b/bfd/ptrace-core.c index 7a659a0..529093d 100644 --- a/bfd/ptrace-core.c +++ b/bfd/ptrace-core.c @@ -191,12 +191,12 @@ const bfd_target core_ptrace_vec = ptrace_unix_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, bfd_false, + _bfd_bool_bfd_false_error, bfd_false }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, bfd_false, + _bfd_bool_bfd_false_error, bfd_false }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/reloc.c b/bfd/reloc.c index a1353a2..d0b9491 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -4182,6 +4182,10 @@ ENUMDOC This is a 19-bit reloc containing the small data area 19-bit signed offset and shift left by 0 for use in lbi.gp, sbi.gp... ENUM + BFD_RELOC_NDS32_SECURITY_16 +ENUMDOC + This is a 24-bit reloc for security check sum. +ENUM BFD_RELOC_NDS32_GOT20 ENUMX BFD_RELOC_NDS32_9_PLTREL @@ -4375,33 +4379,62 @@ ENUMDOC ENUM BFD_RELOC_NDS32_TPOFF ENUMX + BFD_RELOC_NDS32_GOTTPOFF +ENUMX BFD_RELOC_NDS32_TLS_LE_HI20 ENUMX BFD_RELOC_NDS32_TLS_LE_LO12 ENUMX + BFD_RELOC_NDS32_TLS_LE_20 +ENUMX + BFD_RELOC_NDS32_TLS_LE_15S0 +ENUMX + BFD_RELOC_NDS32_TLS_LE_15S1 +ENUMX + BFD_RELOC_NDS32_TLS_LE_15S2 +ENUMX BFD_RELOC_NDS32_TLS_LE_ADD ENUMX BFD_RELOC_NDS32_TLS_LE_LS ENUMX - BFD_RELOC_NDS32_GOTTPOFF -ENUMX BFD_RELOC_NDS32_TLS_IE_HI20 ENUMX + BFD_RELOC_NDS32_TLS_IE_LO12 +ENUMX BFD_RELOC_NDS32_TLS_IE_LO12S2 ENUMX - BFD_RELOC_NDS32_TLS_TPOFF + BFD_RELOC_NDS32_TLS_IEGP_HI20 ENUMX - BFD_RELOC_NDS32_TLS_LE_20 + BFD_RELOC_NDS32_TLS_IEGP_LO12 ENUMX - BFD_RELOC_NDS32_TLS_LE_15S0 + BFD_RELOC_NDS32_TLS_IEGP_LO12S2 ENUMX - BFD_RELOC_NDS32_TLS_LE_15S1 + BFD_RELOC_NDS32_TLS_IEGP_LW ENUMX - BFD_RELOC_NDS32_TLS_LE_15S2 + BFD_RELOC_NDS32_TLS_DESC +ENUMX + BFD_RELOC_NDS32_TLS_DESC_HI20 +ENUMX + BFD_RELOC_NDS32_TLS_DESC_LO12 +ENUMX + BFD_RELOC_NDS32_TLS_DESC_20 +ENUMX + BFD_RELOC_NDS32_TLS_DESC_SDA17S2 +ENUMX + BFD_RELOC_NDS32_TLS_DESC_ADD +ENUMX + BFD_RELOC_NDS32_TLS_DESC_FUNC +ENUMX + BFD_RELOC_NDS32_TLS_DESC_CALL +ENUMX + BFD_RELOC_NDS32_TLS_DESC_MEM +ENUMX + BFD_RELOC_NDS32_REMOVE +ENUMX + BFD_RELOC_NDS32_GROUP ENUMDOC For TLS. - ENUM BFD_RELOC_V850_9_PCREL ENUMDOC @@ -7071,6 +7104,43 @@ ENUMDOC of a signed value. Changes instruction to MOVZ or MOVN depending on the value's sign. ENUM + BFD_RELOC_AARCH64_MOVW_PREL_G0 +ENUMDOC + AArch64 MOV[NZ] instruction with most significant bits 0 to 15 + of a signed value. Changes instruction to MOVZ or MOVN depending on the + value's sign. +ENUM + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC +ENUMDOC + AArch64 MOV[NZ] instruction with most significant bits 0 to 15 + of a signed value. Changes instruction to MOVZ or MOVN depending on the + value's sign. +ENUM + BFD_RELOC_AARCH64_MOVW_PREL_G1 +ENUMDOC + AArch64 MOVK instruction with most significant bits 16 to 31 + of a signed value. +ENUM + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC +ENUMDOC + AArch64 MOVK instruction with most significant bits 16 to 31 + of a signed value. +ENUM + BFD_RELOC_AARCH64_MOVW_PREL_G2 +ENUMDOC + AArch64 MOVK instruction with most significant bits 32 to 47 + of a signed value. +ENUM + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC +ENUMDOC + AArch64 MOVK instruction with most significant bits 32 to 47 + of a signed value. +ENUM + BFD_RELOC_AARCH64_MOVW_PREL_G3 +ENUMDOC + AArch64 MOVK instruction with most significant bits 47 to 63 + of a signed value. +ENUM BFD_RELOC_AARCH64_LD_LO19_PCREL ENUMDOC AArch64 Load Literal instruction, holding a 19 bit pc-relative word @@ -8103,7 +8173,7 @@ bfd_generic_lookup_section_flags (struct bfd_link_info *info ATTRIBUTE_UNUSED, { if (flaginfo != NULL) { - _bfd_error_handler (_("INPUT_SECTION_FLAGS are not supported.\n")); + _bfd_error_handler (_("INPUT_SECTION_FLAGS are not supported")); return FALSE; } return TRUE; @@ -8204,7 +8274,7 @@ bfd_generic_get_relocated_section_contents (bfd *abfd, { link_info->callbacks->einfo /* xgettext:c-format */ - (_("%X%P: %B(%A): error: relocation for offset %V has no value\n"), + (_("%X%P: %pB(%pA): error: relocation for offset %V has no value\n"), abfd, input_section, (* parent)->address); goto error_return; } @@ -8270,7 +8340,7 @@ bfd_generic_get_relocated_section_contents (bfd *abfd, message instead. */ link_info->callbacks->einfo /* xgettext:c-format */ - (_("%X%P: %B(%A): relocation \"%R\" goes out of range\n"), + (_("%X%P: %pB(%pA): relocation \"%pR\" goes out of range\n"), abfd, input_section, * parent); goto error_return; @@ -8280,7 +8350,7 @@ bfd_generic_get_relocated_section_contents (bfd *abfd, Do not abort. Issue an error message instead. */ link_info->callbacks->einfo /* xgettext:c-format */ - (_("%X%P: %B(%A): relocation \"%R\" is not supported\n"), + (_("%X%P: %pB(%pA): relocation \"%pR\" is not supported\n"), abfd, input_section, * parent); goto error_return; @@ -8289,7 +8359,7 @@ bfd_generic_get_relocated_section_contents (bfd *abfd, Report unexpected results, without aborting. */ link_info->callbacks->einfo /* xgettext:c-format */ - (_("%X%P: %B(%A): relocation \"%R\" returns an unrecognized value %x\n"), + (_("%X%P: %pB(%pA): relocation \"%pR\" returns an unrecognized value %x\n"), abfd, input_section, * parent, r); break; } @@ -8351,13 +8421,36 @@ bfd_boolean _bfd_unrecognized_reloc (bfd * abfd, sec_ptr section, unsigned int r_type) { /* xgettext:c-format */ - _bfd_error_handler (_("%B: unrecognized relocation (%#x) in section `%A'"), + _bfd_error_handler (_("%pB: unrecognized relocation type %#x in section `%pA'"), abfd, r_type, section); /* PR 21803: Suggest the most likely cause of this error. */ - _bfd_error_handler (_("Is this version of the linker - %s - out of date ?"), + _bfd_error_handler (_("is this version of the linker - %s - out of date ?"), BFD_VERSION_STRING); bfd_set_error (bfd_error_bad_value); return FALSE; } + +reloc_howto_type * +_bfd_norelocs_bfd_reloc_type_lookup + (bfd *abfd, + bfd_reloc_code_real_type code ATTRIBUTE_UNUSED) +{ + return (reloc_howto_type *) _bfd_ptr_bfd_null_error (abfd); +} + +reloc_howto_type * +_bfd_norelocs_bfd_reloc_name_lookup (bfd *abfd, + const char *reloc_name ATTRIBUTE_UNUSED) +{ + return (reloc_howto_type *) _bfd_ptr_bfd_null_error (abfd); +} + +long +_bfd_nodynamic_canonicalize_dynamic_reloc (bfd *abfd, + arelent **relp ATTRIBUTE_UNUSED, + asymbol **symp ATTRIBUTE_UNUSED) +{ + return _bfd_long_bfd_n1_error (abfd); +} diff --git a/bfd/rs6000-core.c b/bfd/rs6000-core.c index 8958c4a..a2f0d23 100644 --- a/bfd/rs6000-core.c +++ b/bfd/rs6000-core.c @@ -468,7 +468,7 @@ rs6000coff_core_p (bfd *abfd) /* Issue warning if the core file was truncated during writing. */ if (c_flag & CORE_TRUNC) - _bfd_error_handler (_("%B: warning core file truncated"), abfd); + _bfd_error_handler (_("%pB: warning core file truncated"), abfd); /* Allocate core file header. */ #ifndef BFD64 diff --git a/bfd/sco5-core.c b/bfd/sco5-core.c index abf0ee9..26df93d 100644 --- a/bfd/sco5-core.c +++ b/bfd/sco5-core.c @@ -372,12 +372,12 @@ const bfd_target core_sco5_vec = sco5_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, bfd_false, + _bfd_bool_bfd_false_error, bfd_false }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, bfd_false, + _bfd_bool_bfd_false_error, bfd_false }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/section.c b/bfd/section.c index 8e11c90..6aa18d5 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -221,13 +221,10 @@ CODE_FRAGMENT . {* The section contains thread local data. *} .#define SEC_THREAD_LOCAL 0x400 . -. {* The section has GOT references. This flag is only for the -. linker, and is currently only used by the elf32-hppa back end. -. It will be set if global offset table references were detected -. in this section, which indicate to the linker that the section -. contains PIC code, and must be handled specially when doing a -. static link. *} -.#define SEC_HAS_GOT_REF 0x800 +. {* The section's size is fixed. Generic linker code will not +. recalculate it and it is up to whoever has set this flag to +. get the size right. *} +.#define SEC_FIXED_SIZE 0x800 . . {* The section contains common symbols (symbols may be defined . multiple times, the value of a symbol is the amount of @@ -1698,3 +1695,13 @@ bfd_generic_discard_group (bfd *abfd ATTRIBUTE_UNUSED, { return TRUE; } + +bfd_boolean +_bfd_nowrite_set_section_contents (bfd *abfd, + sec_ptr section ATTRIBUTE_UNUSED, + const void *location ATTRIBUTE_UNUSED, + file_ptr offset ATTRIBUTE_UNUSED, + bfd_size_type count ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} diff --git a/bfd/som.c b/bfd/som.c index 101d271..6220df7 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -6737,8 +6737,8 @@ som_bfd_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) #define som_truncate_arname bfd_bsd_truncate_arname #define som_slurp_extended_name_table _bfd_slurp_extended_name_table #define som_construct_extended_name_table _bfd_archive_coff_construct_extended_name_table -#define som_update_armap_timestamp bfd_true -#define som_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define som_update_armap_timestamp _bfd_bool_bfd_true +#define som_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define som_get_lineno _bfd_nosymbols_get_lineno #define som_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define som_read_minisymbols _bfd_generic_read_minisymbols @@ -6797,16 +6797,16 @@ const bfd_target hppa_som_vec = _bfd_dummy_target }, { - bfd_false, + _bfd_bool_bfd_false_error, som_mkobject, _bfd_generic_mkarchive, - bfd_false + _bfd_bool_bfd_false_error }, { - bfd_false, + _bfd_bool_bfd_false_error, som_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, #undef som diff --git a/bfd/sparclinux.c b/bfd/sparclinux.c index 2e634b2..54f6a8e 100644 --- a/bfd/sparclinux.c +++ b/bfd/sparclinux.c @@ -409,7 +409,7 @@ linux_tally_symbols (struct linux_link_hash_entry *h, void * data) alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1); if (p == NULL || alloc == NULL) - _bfd_error_handler (_("Output file requires shared library `%s'\n"), + _bfd_error_handler (_("output file requires shared library `%s'"), name); else { @@ -418,7 +418,7 @@ linux_tally_symbols (struct linux_link_hash_entry *h, void * data) *p++ = '\0'; _bfd_error_handler /* xgettext:c-format */ - (_("Output file requires shared library `%s.so.%s'\n"), + (_("output file requires shared library `%s.so.%s'"), alloc, p); free (alloc); } @@ -605,7 +605,7 @@ linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info) && f->h->root.root.type != bfd_link_hash_defweak) { _bfd_error_handler - (_("Symbol %s not defined for fixups\n"), + (_("symbol %s not defined for fixups"), f->h->root.root.root.string); continue; } @@ -655,7 +655,7 @@ linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info) && f->h->root.root.type != bfd_link_hash_defweak) { _bfd_error_handler - (_("Symbol %s not defined for fixups\n"), + (_("symbol %s not defined for fixups"), f->h->root.root.root.string); continue; } @@ -679,7 +679,7 @@ linux_finish_dynamic_link (bfd *output_bfd, struct bfd_link_info *info) if (linux_hash_table (info)->fixup_count != fixups_written) { - _bfd_error_handler (_("Warning: fixup count mismatch\n")); + _bfd_error_handler (_("warning: fixup count mismatch")); while (linux_hash_table (info)->fixup_count > fixups_written) { bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); diff --git a/bfd/sparclynx.c b/bfd/sparclynx.c index b2856fd..9815afd 100644 --- a/bfd/sparclynx.c +++ b/bfd/sparclynx.c @@ -219,10 +219,9 @@ static const struct aout_backend_data sparclynx_aout_backend = }; -#define MY_bfd_debug_info_start bfd_void -#define MY_bfd_debug_info_end bfd_void -#define MY_bfd_debug_info_accumulate \ - (void (*) (bfd *, struct bfd_section *)) bfd_void +#define MY_bfd_debug_info_start _bfd_void_bfd +#define MY_bfd_debug_info_end _bfd_void_bfd +#define MY_bfd_debug_info_accumulate _bfd_void_bfd_asection #define MY_write_object_contents NAME(aout,sparclynx_write_object_contents) #define MY_backend_data &sparclynx_aout_backend diff --git a/bfd/srec.c b/bfd/srec.c index 705de51..4996109 100644 --- a/bfd/srec.c +++ b/bfd/srec.c @@ -257,7 +257,7 @@ srec_bad_byte (bfd *abfd, } _bfd_error_handler /* xgettext:c-format */ - (_("%B:%d: Unexpected character `%s' in S-record file\n"), + (_("%pB:%d: unexpected character `%s' in S-record file"), abfd, lineno, buf); bfd_set_error (bfd_error_bad_value); } @@ -485,7 +485,7 @@ srec_scan (bfd *abfd) if (bytes < min_bytes) { /* xgettext:c-format */ - _bfd_error_handler (_("%B:%d: byte count %d too small\n"), + _bfd_error_handler (_("%pB:%d: byte count %d too small"), abfd, lineno, bytes); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -578,7 +578,7 @@ srec_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B:%d: Bad checksum in S-record file\n"), + (_("%pB:%d: bad checksum in S-record file"), abfd, lineno); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -612,7 +612,7 @@ srec_scan (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("%B:%d: Bad checksum in S-record file\n"), + (_("%pB:%d: bad checksum in S-record file"), abfd, lineno); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -1257,7 +1257,7 @@ srec_print_symbol (bfd *abfd, #define srec_close_and_cleanup _bfd_generic_close_and_cleanup #define srec_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define srec_new_section_hook _bfd_generic_new_section_hook -#define srec_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define srec_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define srec_bfd_is_local_label_name bfd_generic_is_local_label_name #define srec_get_lineno _bfd_nosymbols_get_lineno #define srec_find_nearest_line _bfd_nosymbols_find_nearest_line @@ -1316,16 +1316,16 @@ const bfd_target srec_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, srec_mkobject, _bfd_generic_mkarchive, - bfd_false, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, + _bfd_bool_bfd_false_error, srec_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (srec), @@ -1372,16 +1372,16 @@ const bfd_target symbolsrec_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, srec_mkobject, _bfd_generic_mkarchive, - bfd_false, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, + _bfd_bool_bfd_false_error, symbolsrec_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (srec), diff --git a/bfd/stabs.c b/bfd/stabs.c index 7a1a6e5..bdb9f06 100644 --- a/bfd/stabs.c +++ b/bfd/stabs.c @@ -276,7 +276,7 @@ _bfd_link_section_stabs (bfd *abfd, { _bfd_error_handler /* xgettext:c-format */ - (_("%B(%A+%#lx): Stabs entry has invalid string index."), + (_("%pB(%pA+%#lx): stabs entry has invalid string index"), abfd, stabsec, (long) (sym - stabbuf)); bfd_set_error (bfd_error_bad_value); goto error_return; diff --git a/bfd/syms.c b/bfd/syms.c index 7eafb7d..187071f 100644 --- a/bfd/syms.c +++ b/bfd/syms.c @@ -1076,7 +1076,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd, || r->howto->dst_mask != 0xffffffff) { _bfd_error_handler - (_("Unsupported .stab relocation")); + (_("unsupported .stab relocation")); bfd_set_error (bfd_error_invalid_operation); if (reloc_vector != NULL) free (reloc_vector); @@ -1427,3 +1427,117 @@ _bfd_stab_section_find_nearest_line (bfd *abfd, return TRUE; } + +long +_bfd_nosymbols_canonicalize_symtab (bfd *abfd ATTRIBUTE_UNUSED, + asymbol **location ATTRIBUTE_UNUSED) +{ + return 0; +} + +void +_bfd_nosymbols_print_symbol (bfd *abfd ATTRIBUTE_UNUSED, + void *afile ATTRIBUTE_UNUSED, + asymbol *symbol ATTRIBUTE_UNUSED, + bfd_print_symbol_type how ATTRIBUTE_UNUSED) +{ +} + +void +_bfd_nosymbols_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED, + asymbol *sym ATTRIBUTE_UNUSED, + symbol_info *ret ATTRIBUTE_UNUSED) +{ +} + +const char * +_bfd_nosymbols_get_symbol_version_string (bfd *abfd, + asymbol *symbol ATTRIBUTE_UNUSED, + bfd_boolean *hidden ATTRIBUTE_UNUSED) +{ + return (const char *) _bfd_ptr_bfd_null_error (abfd); +} + +bfd_boolean +_bfd_nosymbols_bfd_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED) +{ + return FALSE; +} + +alent * +_bfd_nosymbols_get_lineno (bfd *abfd, asymbol *sym ATTRIBUTE_UNUSED) +{ + return (alent *) _bfd_ptr_bfd_null_error (abfd); +} + +bfd_boolean +_bfd_nosymbols_find_nearest_line + (bfd *abfd, + asymbol **symbols ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + bfd_vma offset ATTRIBUTE_UNUSED, + const char **filename_ptr ATTRIBUTE_UNUSED, + const char **functionname_ptr ATTRIBUTE_UNUSED, + unsigned int *line_ptr ATTRIBUTE_UNUSED, + unsigned int *discriminator_ptr ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +bfd_boolean +_bfd_nosymbols_find_line (bfd *abfd, + asymbol **symbols ATTRIBUTE_UNUSED, + asymbol *symbol ATTRIBUTE_UNUSED, + const char **filename_ptr ATTRIBUTE_UNUSED, + unsigned int *line_ptr ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +bfd_boolean +_bfd_nosymbols_find_inliner_info + (bfd *abfd, + const char **filename_ptr ATTRIBUTE_UNUSED, + const char **functionname_ptr ATTRIBUTE_UNUSED, + unsigned int *line_ptr ATTRIBUTE_UNUSED) +{ + return _bfd_bool_bfd_false_error (abfd); +} + +asymbol * +_bfd_nosymbols_bfd_make_debug_symbol (bfd *abfd, + void *ptr ATTRIBUTE_UNUSED, + unsigned long sz ATTRIBUTE_UNUSED) +{ + return (asymbol *) _bfd_ptr_bfd_null_error (abfd); +} + +long +_bfd_nosymbols_read_minisymbols (bfd *abfd, + bfd_boolean dynamic ATTRIBUTE_UNUSED, + void **minisymsp ATTRIBUTE_UNUSED, + unsigned int *sizep ATTRIBUTE_UNUSED) +{ + return _bfd_long_bfd_n1_error (abfd); +} + +asymbol * +_bfd_nosymbols_minisymbol_to_symbol (bfd *abfd, + bfd_boolean dynamic ATTRIBUTE_UNUSED, + const void *minisym ATTRIBUTE_UNUSED, + asymbol *sym ATTRIBUTE_UNUSED) +{ + return (asymbol *) _bfd_ptr_bfd_null_error (abfd); +} + +long +_bfd_nodynamic_get_synthetic_symtab (bfd *abfd, + long symcount ATTRIBUTE_UNUSED, + asymbol **syms ATTRIBUTE_UNUSED, + long dynsymcount ATTRIBUTE_UNUSED, + asymbol **dynsyms ATTRIBUTE_UNUSED, + asymbol **ret ATTRIBUTE_UNUSED) +{ + return _bfd_long_bfd_n1_error (abfd); +} diff --git a/bfd/tekhex.c b/bfd/tekhex.c index 601975a..6a00c9f 100644 --- a/bfd/tekhex.c +++ b/bfd/tekhex.c @@ -962,7 +962,7 @@ tekhex_print_symbol (bfd *abfd, #define tekhex_close_and_cleanup _bfd_generic_close_and_cleanup #define tekhex_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define tekhex_new_section_hook _bfd_generic_new_section_hook -#define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define tekhex_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define tekhex_bfd_is_local_label_name bfd_generic_is_local_label_name #define tekhex_get_lineno _bfd_nosymbols_get_lineno #define tekhex_find_nearest_line _bfd_nosymbols_find_nearest_line @@ -1020,16 +1020,16 @@ const bfd_target tekhex_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, tekhex_mkobject, _bfd_generic_mkarchive, - bfd_false, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, + _bfd_bool_bfd_false_error, tekhex_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (tekhex), diff --git a/bfd/trad-core.c b/bfd/trad-core.c index 4fe5b6b..7d17688 100644 --- a/bfd/trad-core.c +++ b/bfd/trad-core.c @@ -293,12 +293,16 @@ const bfd_target core_trad_vec = trad_unix_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/verilog.c b/bfd/verilog.c index 6d1e7d4..64a7869 100644 --- a/bfd/verilog.c +++ b/bfd/verilog.c @@ -293,7 +293,7 @@ verilog_mkobject (bfd *abfd) #define verilog_close_and_cleanup _bfd_generic_close_and_cleanup #define verilog_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define verilog_new_section_hook _bfd_generic_new_section_hook -#define verilog_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define verilog_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define verilog_bfd_is_local_label_name bfd_generic_is_local_label_name #define verilog_get_lineno _bfd_nosymbols_get_lineno #define verilog_find_nearest_line _bfd_nosymbols_find_nearest_line @@ -345,16 +345,16 @@ const bfd_target verilog_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, verilog_mkobject, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, + _bfd_bool_bfd_false_error, verilog_write_object_contents, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/versados.c b/bfd/versados.c index 369ec2f..cfaba72 100644 --- a/bfd/versados.c +++ b/bfd/versados.c @@ -848,7 +848,7 @@ versados_canonicalize_reloc (bfd *abfd, #define versados_close_and_cleanup _bfd_generic_close_and_cleanup #define versados_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define versados_new_section_hook _bfd_generic_new_section_hook -#define versados_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define versados_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define versados_bfd_is_local_label_name bfd_generic_is_local_label_name #define versados_get_lineno _bfd_nosymbols_get_lineno #define versados_find_nearest_line _bfd_nosymbols_find_nearest_line @@ -860,7 +860,7 @@ versados_canonicalize_reloc (bfd *abfd, #define versados_read_minisymbols _bfd_generic_read_minisymbols #define versados_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define versados_bfd_reloc_type_lookup _bfd_norelocs_bfd_reloc_type_lookup -#define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup +#define versados_bfd_reloc_name_lookup _bfd_norelocs_bfd_reloc_name_lookup #define versados_set_arch_mach bfd_default_set_arch_mach #define versados_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define versados_bfd_relax_section bfd_generic_relax_section @@ -911,16 +911,16 @@ const bfd_target m68k_versados_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, versados_mkobject, _bfd_generic_mkarchive, - bfd_false, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (versados), diff --git a/bfd/version.h b/bfd/version.h index 3d00b31..159dfba 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20180127 +#define BFD_VERSION_DATE 20180307 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/bfd/version.m4 b/bfd/version.m4 index e8d3152..1c3c3ed 100644 --- a/bfd/version.m4 +++ b/bfd/version.m4 @@ -1 +1 @@ -m4_define([BFD_VERSION], [2.30]) +m4_define([BFD_VERSION], [2.30.51]) diff --git a/bfd/vms-alpha.c b/bfd/vms-alpha.c index d93ac10..b52f580 100644 --- a/bfd/vms-alpha.c +++ b/bfd/vms-alpha.c @@ -476,7 +476,7 @@ _bfd_vms_slurp_eihd (bfd *abfd, unsigned int *eisd_offset, /* PR 21813: Check for an undersized record. */ if (PRIV (recrd.buf_size) < sizeof (* eihd)) { - _bfd_error_handler (_("Corrupt EIHD record - size is too small")); + _bfd_error_handler (_("corrupt EIHD record - size is too small")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -657,7 +657,8 @@ _bfd_vms_slurp_eihs (bfd *abfd, unsigned int offset) /* PR 21611: Check that offset is valid. */ if (offset > PRIV (recrd.rec_size) - (EIHS__L_DMTBYTES + 4)) { - _bfd_error_handler (_("Unable to read EIHS record at offset %#x"), offset); + _bfd_error_handler (_("unable to read EIHS record at offset %#x"), + offset); bfd_set_error (bfd_error_file_truncated); return FALSE; } @@ -1169,7 +1170,7 @@ _bfd_vms_slurp_egsd (bfd *abfd) if (PRIV (recrd.rec_size) < 8) { - _bfd_error_handler (_("Corrupt EGSD record: its size (%#x) is too small"), + _bfd_error_handler (_("corrupt EGSD record: its size (%#x) is too small"), PRIV (recrd.rec_size)); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1193,7 +1194,7 @@ _bfd_vms_slurp_egsd (bfd *abfd) /* PR 21615: Check for size overflow. */ if (PRIV (recrd.rec_size) < gsd_size) { - _bfd_error_handler (_("Corrupt EGSD record: size (%#x) is larger than remaining space (%#x)"), + _bfd_error_handler (_("corrupt EGSD record: size (%#x) is larger than remaining space (%#x)"), gsd_size, PRIV (recrd.rec_size)); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1201,7 +1202,7 @@ _bfd_vms_slurp_egsd (bfd *abfd) if (gsd_size < 4) { - _bfd_error_handler (_("Corrupt EGSD record: size (%#x) is too small"), + _bfd_error_handler (_("corrupt EGSD record: size (%#x) is too small"), gsd_size); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1330,7 +1331,7 @@ _bfd_vms_slurp_egsd (bfd *abfd) /* PR 21813: Check for an out of range index. */ if (psindx < 0 || psindx >= (int) PRIV (section_count)) { - _bfd_error_handler (_("Corrupt EGSD record: its psindx field is too big (%#lx)"), + _bfd_error_handler (_("corrupt EGSD record: its psindx field is too big (%#lx)"), psindx); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1346,7 +1347,7 @@ _bfd_vms_slurp_egsd (bfd *abfd) /* PR 21813: Check for an out of range index. */ if (psindx < 0 || psindx >= (int) PRIV (section_count)) { - _bfd_error_handler (_("Corrupt EGSD record: its psindx field is too big (%#lx)"), + _bfd_error_handler (_("corrupt EGSD record: its psindx field is too big (%#lx)"), psindx); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1386,7 +1387,7 @@ _bfd_vms_slurp_egsd (bfd *abfd) /* PR 21813: Check for an out of range index. */ if (psindx < 0 || psindx >= (int) PRIV (section_count)) { - _bfd_error_handler (_("Corrupt EGSD record: its psindx field is too big (%#lx)"), + _bfd_error_handler (_("corrupt EGSD record: its psindx field is too big (%#lx)"), psindx); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -1415,7 +1416,7 @@ _bfd_vms_slurp_egsd (bfd *abfd) case EGSD__C_SYMM: case EGSD__C_SYMV: default: - _bfd_error_handler (_("Unknown EGSD subtype %d"), gsd_type); + _bfd_error_handler (_("unknown EGSD subtype %d"), gsd_type); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -1448,7 +1449,7 @@ _bfd_vms_push (bfd *abfd, bfd_vma val, unsigned int reloc) if (PRIV (stackptr) >= STACKSIZE) { bfd_set_error (bfd_error_bad_value); - _bfd_error_handler (_("Stack overflow (%d) in _bfd_vms_push"), PRIV (stackptr)); + _bfd_error_handler (_("stack overflow (%d) in _bfd_vms_push"), PRIV (stackptr)); exit (1); } } @@ -1461,7 +1462,7 @@ _bfd_vms_pop (bfd *abfd, bfd_vma *val, unsigned int *rel) if (PRIV (stackptr) == 0) { bfd_set_error (bfd_error_bad_value); - _bfd_error_handler (_("Stack underflow in _bfd_vms_pop")); + _bfd_error_handler (_("stack underflow in _bfd_vms_pop")); exit (1); } PRIV (stackptr)--; @@ -1734,7 +1735,7 @@ _bfd_vms_get_value (bfd *abfd, len = *ascic; if (ascic + len >= max_ascic) { - _bfd_error_handler (_("Corrupt vms value")); + _bfd_error_handler (_("corrupt vms value")); *vma = 0; *hp = NULL; return; @@ -1862,7 +1863,7 @@ _bfd_vms_slurp_etir (bfd *abfd, struct bfd_link_info *info) if (cmd_length < 4 || (ptr + cmd_length > maxptr + 4)) { corrupt_etir: - _bfd_error_handler (_("Corrupt ETIR record encountered")); + _bfd_error_handler (_("corrupt ETIR record encountered")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2494,7 +2495,7 @@ _bfd_vms_slurp_eeom (bfd *abfd) /* PR 21813: Check for an undersized record. */ if (PRIV (recrd.buf_size) < sizeof (* eeom)) { - _bfd_error_handler (_("Corrupt EEOM record - size is too small")); + _bfd_error_handler (_("corrupt EEOM record - size is too small")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -2503,7 +2504,7 @@ _bfd_vms_slurp_eeom (bfd *abfd) PRIV (eom_data).eom_w_comcod = bfd_getl16 (eeom->comcod); if (PRIV (eom_data).eom_w_comcod > 1) { - _bfd_error_handler (_("Object module NOT error-free !\n")); + _bfd_error_handler (_("object module not error-free !")); bfd_set_error (bfd_error_bad_value); return FALSE; } @@ -3827,7 +3828,7 @@ _bfd_vms_write_etir (bfd * abfd, int objtype ATTRIBUTE_UNUSED) if (section->reloc_count == 0) _bfd_error_handler - (_("SEC_RELOC with no relocs in section %A"), section); + (_("SEC_RELOC with no relocs in section %pA"), section); #if VMS_DEBUG else @@ -3879,7 +3880,7 @@ _bfd_vms_write_etir (bfd * abfd, int objtype ATTRIBUTE_UNUSED) /* Regular relocs are intertwined with binary data. */ if (curr_addr > addr) - _bfd_error_handler (_("Size error in section %A"), + _bfd_error_handler (_("size error in section %pA"), section); size = addr - curr_addr; sto_imm (abfd, section, size, curr_data, curr_addr); @@ -4038,7 +4039,7 @@ _bfd_vms_write_etir (bfd * abfd, int objtype ATTRIBUTE_UNUSED) break; case ALPHA_R_BSR: - _bfd_error_handler (_("Spurious ALPHA_R_BSR reloc")); + _bfd_error_handler (_("spurious ALPHA_R_BSR reloc")); break; case ALPHA_R_LDA: @@ -4079,7 +4080,7 @@ _bfd_vms_write_etir (bfd * abfd, int objtype ATTRIBUTE_UNUSED) break; default: - _bfd_error_handler (_("Unhandled relocation %s"), + _bfd_error_handler (_("unhandled relocation %s"), rptr->howto->name); break; } @@ -4092,7 +4093,7 @@ _bfd_vms_write_etir (bfd * abfd, int objtype ATTRIBUTE_UNUSED) { /* Output rest of section. */ if (curr_addr > section->size) - _bfd_error_handler (_("Size error in section %A"), section); + _bfd_error_handler (_("size error in section %pA"), section); size = section->size - curr_addr; sto_imm (abfd, section, size, curr_data, curr_addr); curr_data += size; @@ -4433,31 +4434,31 @@ parse_module (bfd *abfd, struct module *module, unsigned char *ptr, case DST__K_SET_LINUM_INCR: _bfd_error_handler - (_("DST__K_SET_LINUM_INCR not implemented")); + (_("%s not implemented"), "DST__K_SET_LINUM_INCR"); cmd_length = 2; break; case DST__K_SET_LINUM_INCR_W: _bfd_error_handler - (_("DST__K_SET_LINUM_INCR_W not implemented")); + (_("%s not implemented"), "DST__K_SET_LINUM_INCR_W"); cmd_length = 3; break; case DST__K_RESET_LINUM_INCR: _bfd_error_handler - (_("DST__K_RESET_LINUM_INCR not implemented")); + (_("%s not implemented"), "DST__K_RESET_LINUM_INCR"); cmd_length = 1; break; case DST__K_BEG_STMT_MODE: _bfd_error_handler - (_("DST__K_BEG_STMT_MODE not implemented")); + (_("%s not implemented"), "DST__K_BEG_STMT_MODE"); cmd_length = 1; break; case DST__K_END_STMT_MODE: _bfd_error_handler - (_("DST__K_END_STMT_MODE not implemented")); + (_("%s not implemented"), "DST__K_END_STMT_MODE"); cmd_length = 1; break; @@ -4484,25 +4485,25 @@ parse_module (bfd *abfd, struct module *module, unsigned char *ptr, case DST__K_SET_PC: _bfd_error_handler - (_("DST__K_SET_PC not implemented")); + (_("%s not implemented"), "DST__K_SET_PC"); cmd_length = 2; break; case DST__K_SET_PC_W: _bfd_error_handler - (_("DST__K_SET_PC_W not implemented")); + (_("%s not implemented"), "DST__K_SET_PC_W"); cmd_length = 3; break; case DST__K_SET_PC_L: _bfd_error_handler - (_("DST__K_SET_PC_L not implemented")); + (_("%s not implemented"), "DST__K_SET_PC_L"); cmd_length = 5; break; case DST__K_SET_STMTNUM: _bfd_error_handler - (_("DST__K_SET_STMTNUM not implemented")); + (_("%s not implemented"), "DST__K_SET_STMTNUM"); cmd_length = 2; break; @@ -5005,7 +5006,7 @@ alpha_vms_slurp_relocs (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (prev_cmd), + (_("unknown reloc %s + %s"), _bfd_vms_etir_name (prev_cmd), _bfd_vms_etir_name (cmd)); return FALSE; } @@ -5023,7 +5024,7 @@ alpha_vms_slurp_relocs (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (cmd), + (_("unknown reloc %s + %s"), _bfd_vms_etir_name (cmd), _bfd_vms_etir_name (ETIR__C_STA_LW)); return FALSE; } @@ -5038,7 +5039,7 @@ alpha_vms_slurp_relocs (bfd *abfd) { _bfd_error_handler /* xgettext:c-format */ - (_("Unknown reloc %s + %s"), _bfd_vms_etir_name (cmd), + (_("unknown reloc %s + %s"), _bfd_vms_etir_name (cmd), _bfd_vms_etir_name (ETIR__C_STA_QW)); return FALSE; } @@ -5054,7 +5055,7 @@ alpha_vms_slurp_relocs (bfd *abfd) && prev_cmd != ETIR__C_STA_PQ) { /* xgettext:c-format */ - _bfd_error_handler (_("Unknown reloc %s + %s"), + _bfd_error_handler (_("unknown reloc %s + %s"), _bfd_vms_etir_name (prev_cmd), _bfd_vms_etir_name (ETIR__C_STO_LW)); return FALSE; @@ -5067,7 +5068,7 @@ alpha_vms_slurp_relocs (bfd *abfd) if (prev_cmd != ETIR__C_OPR_ADD && prev_cmd != ETIR__C_STA_QW) { /* xgettext:c-format */ - _bfd_error_handler (_("Unknown reloc %s + %s"), + _bfd_error_handler (_("unknown reloc %s + %s"), _bfd_vms_etir_name (prev_cmd), _bfd_vms_etir_name (ETIR__C_STO_QW)); return FALSE; @@ -5079,7 +5080,7 @@ alpha_vms_slurp_relocs (bfd *abfd) if (prev_cmd != ETIR__C_STA_PQ) { /* xgettext:c-format */ - _bfd_error_handler (_("Unknown reloc %s + %s"), + _bfd_error_handler (_("unknown reloc %s + %s"), _bfd_vms_etir_name (prev_cmd), _bfd_vms_etir_name (ETIR__C_STO_OFF)); return FALSE; @@ -5092,7 +5093,7 @@ alpha_vms_slurp_relocs (bfd *abfd) if (prev_cmd != ETIR__C_STA_LW && prev_cmd != ETIR__C_STA_QW) { /* xgettext:c-format */ - _bfd_error_handler (_("Unknown reloc %s + %s"), + _bfd_error_handler (_("unknown reloc %s + %s"), _bfd_vms_etir_name (prev_cmd), _bfd_vms_etir_name (ETIR__C_OPR_ADD)); return FALSE; @@ -5147,7 +5148,7 @@ alpha_vms_slurp_relocs (bfd *abfd) continue; default: - _bfd_error_handler (_("Unknown reloc %s"), + _bfd_error_handler (_("unknown reloc %s"), _bfd_vms_etir_name (cmd)); return FALSE; } @@ -5160,7 +5161,7 @@ alpha_vms_slurp_relocs (bfd *abfd) /* Get section to which the relocation applies. */ if (cur_psect < 0 || cur_psect > (int)PRIV (section_count)) { - _bfd_error_handler (_("Invalid section index in ETIR")); + _bfd_error_handler (_("invalid section index in ETIR")); return FALSE; } @@ -5169,7 +5170,7 @@ alpha_vms_slurp_relocs (bfd *abfd) sec = PRIV (sections)[cur_psect]; if (sec == bfd_abs_section_ptr) { - _bfd_error_handler (_("Relocation for non-REL psect")); + _bfd_error_handler (_("relocation for non-REL psect")); return FALSE; } @@ -5216,7 +5217,7 @@ alpha_vms_slurp_relocs (bfd *abfd) } if (sym == NULL) { - _bfd_error_handler (_("Unknown symbol in command %s"), + _bfd_error_handler (_("unknown symbol in command %s"), _bfd_vms_etir_name (cmd)); reloc->sym_ptr_ptr = NULL; } @@ -8969,7 +8970,7 @@ alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info) { (*info->callbacks->einfo) /* xgettext:c-format */ - (_("%P: multiple entry points: in modules %B and %B\n"), + (_("%P: multiple entry points: in modules %pB and %pB\n"), startbfd, sub); continue; } @@ -9489,7 +9490,7 @@ bfd_vms_get_data (bfd *abfd) return (struct vms_private_data_struct *)abfd->tdata.any; } -#define vms_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define vms_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define vms_bfd_link_just_syms _bfd_generic_link_just_syms #define vms_bfd_copy_link_hash_symbol_type \ _bfd_generic_copy_link_hash_symbol_type @@ -9497,7 +9498,7 @@ bfd_vms_get_data (bfd *abfd) #define vms_bfd_discard_group bfd_generic_discard_group #define vms_section_already_linked _bfd_generic_section_already_linked #define vms_bfd_define_common_symbol bfd_generic_define_common_symbol -#define vms_bfd_define_start_stop bfd_generic_define_start_stop +#define vms_bfd_define_start_stop bfd_generic_define_start_stop #define vms_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define vms_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data @@ -9509,8 +9510,7 @@ bfd_vms_get_data (bfd *abfd) /* Symbols table. */ #define alpha_vms_make_empty_symbol _bfd_generic_make_empty_symbol -#define alpha_vms_bfd_is_target_special_symbol \ - ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define alpha_vms_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define alpha_vms_print_symbol vms_print_symbol #define alpha_vms_get_symbol_info vms_get_symbol_info #define alpha_vms_get_symbol_version_string \ @@ -9585,12 +9585,24 @@ const bfd_target alpha_vms_vec = bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, - {_bfd_dummy_target, alpha_vms_object_p, /* bfd_check_format. */ - _bfd_vms_lib_alpha_archive_p, _bfd_dummy_target}, - {bfd_false, alpha_vms_mkobject, /* bfd_set_format. */ - _bfd_vms_lib_alpha_mkarchive, bfd_false}, - {bfd_false, alpha_vms_write_object_contents, /* bfd_write_contents. */ - _bfd_vms_lib_write_archive_contents, bfd_false}, + { /* bfd_check_format. */ + _bfd_dummy_target, + alpha_vms_object_p, + _bfd_vms_lib_alpha_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + alpha_vms_mkobject, + _bfd_vms_lib_alpha_mkarchive, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + alpha_vms_write_object_contents, + _bfd_vms_lib_write_archive_contents, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (alpha_vms), BFD_JUMP_TABLE_COPY (vms), diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c index d10e6d9..a31cadd 100644 --- a/bfd/vms-lib.c +++ b/bfd/vms-lib.c @@ -2330,12 +2330,24 @@ const bfd_target alpha_vms_lib_txt_vec = bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, - - {_bfd_dummy_target, _bfd_dummy_target, /* bfd_check_format. */ - _bfd_vms_lib_txt_archive_p, _bfd_dummy_target}, - {bfd_false, bfd_false, bfd_false, bfd_false}, /* bfd_set_format. */ - {bfd_false, bfd_false, bfd_false, bfd_false}, /* bfd_write_contents. */ - + { /* bfd_check_format. */ + _bfd_dummy_target, + _bfd_dummy_target, + _bfd_vms_lib_txt_archive_p, + _bfd_dummy_target + }, + { /* bfd_set_format. */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error + }, + { /* bfd_write_contents. */ + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error + }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), BFD_JUMP_TABLE_COPY (_bfd_generic), BFD_JUMP_TABLE_CORE (_bfd_nocore), diff --git a/bfd/wasm-module.c b/bfd/wasm-module.c index 7525e63..6806e0f 100644 --- a/bfd/wasm-module.c +++ b/bfd/wasm-module.c @@ -309,12 +309,12 @@ wasm_scan_name_function_section (bfd *abfd, sec_ptr asect) for (symcount = 0; p < end && symcount < tdata->symcount; symcount++) { - bfd_vma index; + bfd_vma idx; bfd_vma len; char *name; asymbol *sym; - READ_LEB128 (index, p, end); + READ_LEB128 (idx, p, end); READ_LEB128 (len, p, end); if (p + len < p || p + len > end) @@ -330,7 +330,7 @@ wasm_scan_name_function_section (bfd *abfd, sec_ptr asect) sym = &symbols[symcount]; sym->the_bfd = abfd; sym->name = name; - sym->value = index; + sym->value = idx; sym->flags = BSF_GLOBAL | BSF_FUNCTION; sym->section = space_function_index; sym->udata.p = NULL; @@ -491,12 +491,12 @@ wasm_register_section (bfd *abfd ATTRIBUTE_UNUSED, void *fsarg) { sec_ptr *numbered_sections = fsarg; - int index = wasm_section_name_to_code (asect->name); + int idx = wasm_section_name_to_code (asect->name); - if (index == 0) + if (idx == 0) return; - numbered_sections[index] = asect; + numbered_sections[idx] = asect; } struct compute_section_arg @@ -520,14 +520,14 @@ wasm_compute_custom_section_file_position (bfd *abfd, void *fsarg) { struct compute_section_arg *fs = fsarg; - int index; + int idx; if (fs->failed) return; - index = wasm_section_name_to_code (asect->name); + idx = wasm_section_name_to_code (asect->name); - if (index != 0) + if (idx != 0) return; if (CONST_STRNEQ (asect->name, WASM_SECTION_PREFIX)) @@ -773,7 +773,7 @@ wasm_object_p (bfd *abfd) /* BFD_JUMP_TABLE_SYMBOLS */ #define wasm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define wasm_bfd_is_local_label_name bfd_generic_is_local_label_name -#define wasm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define wasm_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define wasm_get_lineno _bfd_nosymbols_get_lineno #define wasm_find_nearest_line _bfd_nosymbols_find_nearest_line #define wasm_find_line _bfd_nosymbols_find_line @@ -811,16 +811,16 @@ const bfd_target wasm_vec = _bfd_dummy_target, }, { - bfd_false, + _bfd_bool_bfd_false_error, wasm_mkobject, _bfd_generic_mkarchive, - bfd_false, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, + _bfd_bool_bfd_false_error, wasm_write_object_contents, _bfd_write_archive_contents, - bfd_false, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 90067e3..ac95390 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -829,7 +829,7 @@ xcoff_link_add_dynamic_symbols (bfd *abfd, struct bfd_link_info *info) if (info->output_bfd->xvec != abfd->xvec) { _bfd_error_handler - (_("%B: XCOFF shared object when not producing XCOFF output"), + (_("%pB: XCOFF shared object when not producing XCOFF output"), abfd); bfd_set_error (bfd_error_invalid_operation); return FALSE; @@ -850,7 +850,7 @@ xcoff_link_add_dynamic_symbols (bfd *abfd, struct bfd_link_info *info) if (lsec == NULL) { _bfd_error_handler - (_("%B: dynamic object with no .loader section"), + (_("%pB: dynamic object with no .loader section"), abfd); bfd_set_error (bfd_error_no_symbols); return FALSE; @@ -1410,7 +1410,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' has line numbers but no enclosing section"), + (_("%pB: `%s' has line numbers but no enclosing section"), abfd, name); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -1463,7 +1463,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: class %d symbol `%s' has no aux entries"), + (_("%pB: class %d symbol `%s' has no aux entries"), abfd, sym.n_sclass, name); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -1486,7 +1486,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) default: _bfd_error_handler /* xgettext:c-format */ - (_("%B: symbol `%s' has unrecognized csect type %d"), + (_("%pB: symbol `%s' has unrecognized csect type %d"), abfd, name, smtyp); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -1499,9 +1499,10 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: bad XTY_ER symbol `%s': class %d scnum %d scnlen %Ld"), + (_("%pB: bad XTY_ER symbol `%s': class %d scnum %d " + "scnlen %" PRId64), abfd, name, sym.n_sclass, sym.n_scnum, - aux.x_csect.x_scnlen.l); + (int64_t) aux.x_csect.x_scnlen.l); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -1529,8 +1530,8 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: XMC_TC0 symbol `%s' is class %d scnlen %Ld"), - abfd, name, sym.n_sclass, aux.x_csect.x_scnlen.l); + (_("%pB: XMC_TC0 symbol `%s' is class %d scnlen %" PRId64), + abfd, name, sym.n_sclass, (int64_t) aux.x_csect.x_scnlen.l); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -1676,7 +1677,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: csect `%s' not in enclosing section"), + (_("%pB: csect `%s' not in enclosing section"), abfd, name); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -1784,7 +1785,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: misplaced XTY_LD `%s'"), + (_("%pB: misplaced XTY_LD `%s'"), abfd, name); bfd_set_error (bfd_error_bad_value); goto error_return; @@ -2105,8 +2106,8 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { _bfd_error_handler /* xgettext:c-format */ - (_("%B: reloc %s:%Ld not in csect"), - abfd, o->name, i); + (_("%pB: reloc %s:%" PRId64 " not in csect"), + abfd, o->name, (int64_t) i); bfd_set_error (bfd_error_bad_value); goto error_return; } @@ -4059,7 +4060,7 @@ xcoff_create_ldrel (bfd *output_bfd, struct xcoff_final_link_info *flinfo, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: loader reloc in unrecognized section `%s'"), + (_("%pB: loader reloc in unrecognized section `%s'"), reference_bfd, secname); bfd_set_error (bfd_error_nonrepresentable_section); return FALSE; @@ -4071,7 +4072,7 @@ xcoff_create_ldrel (bfd *output_bfd, struct xcoff_final_link_info *flinfo, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: `%s' in loader reloc but not loader sym"), + (_("%pB: `%s' in loader reloc but not loader sym"), reference_bfd, h->root.root.string); bfd_set_error (bfd_error_bad_value); return FALSE; @@ -4088,7 +4089,7 @@ xcoff_create_ldrel (bfd *output_bfd, struct xcoff_final_link_info *flinfo, { _bfd_error_handler /* xgettext:c-format */ - (_("%B: loader reloc in read-only section %A"), + (_("%pB: loader reloc in read-only section %pA"), reference_bfd, output_section); bfd_set_error (bfd_error_invalid_operation); return FALSE; @@ -5112,9 +5113,9 @@ xcoff_find_tc0 (bfd *output_bfd, struct xcoff_final_link_info *flinfo) if (best_address > toc_start + 0x8000) { _bfd_error_handler - (_("TOC overflow: %#Lx > 0x10000; try -mminimal-toc " + (_("TOC overflow: %#" PRIx64 " > 0x10000; try -mminimal-toc " "when compiling"), - toc_end - toc_start); + (uint64_t) (toc_end - toc_start)); bfd_set_error (bfd_error_file_too_big); return FALSE; } diff --git a/bfd/xsym.c b/bfd/xsym.c index f7b70b0..8ea0e7e 100644 --- a/bfd/xsym.c +++ b/bfd/xsym.c @@ -30,7 +30,7 @@ #define bfd_sym_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_sym_new_section_hook _bfd_generic_new_section_hook #define bfd_sym_bfd_is_local_label_name bfd_generic_is_local_label_name -#define bfd_sym_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false) +#define bfd_sym_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define bfd_sym_get_lineno _bfd_nosymbols_get_lineno #define bfd_sym_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_sym_find_line _bfd_nosymbols_find_line @@ -2332,16 +2332,16 @@ const bfd_target sym_vec = _bfd_dummy_target, }, { /* bfd_set_format. */ - bfd_false, + _bfd_bool_bfd_false_error, bfd_sym_mkobject, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ - bfd_false, - bfd_true, - bfd_false, - bfd_false, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_true, + _bfd_bool_bfd_false_error, + _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (bfd_sym), diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 03f4fd3..8af7344 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,13 +1,141 @@ -2018-01-27 Nick Clifton +2018-03-05 H.J. Lu + + PR binutils/22911 + * objdump.c (is_significant_symbol_name): Return TRUE for all + .plt* sections. + (find_symbol_for_address): Replace linear search with binary + search on dynamic relocations. + +2018-03-01 Nick Clifton - This is the 2.30 release: + PR 22905 + * dwarf.c (display_debug_ranges): Check that the offset loaded + from the range_entry structure is valid. +2018-03-01 Alan Modra + + * configure.ac (ALL_LINGUAS): Add sr. Sort. * configure: Regenerate. -2018-01-23 Nick Clifton +2018-02-27 Nick Clifton + * po/pt.po: New Portuguese translation. + * configure.ac (ALL_LINGUAS): Add pt. * configure: Regenerate. +2018-02-27 Nick Clifton + + PR 22875 + * objcopy.c (copy_object): Check the error status after marking + symbols used in relocations. + * testsuite/binutils-all/strip-13.s: New test source file. + * testsuite/binutils-all/strip-13.s: New test driver file. + * testsuite/binutils-all/objcopy.exp: Run the new test. + +2018-02-26 Alan Modra + + * testsuite/binutils-all/mips/mips-reginfo-n32.d, + * testsuite/binutils-all/mips/mips-reginfo.d: Update. + +2018-02-23 Alan Modra + + * testsuite/binutils-all/mips/mips-reginfo-n32.d, + * testsuite/binutils-all/mips/mips-reginfo.d: Update. + +2018-02-20 Ronald Hoogenboom + + * doc/binutils.texi (objcopy): Add missing closing square + parenthesis to listing of objcopy's command line options. + +2018-02-19 Matthias Klose + + * strings.c (long_options): Include-all-whitespace does not take + an extra agument. + +2018-02-13 Alan Modra + + PR 22836 + * testsuite/binutils-all/group-7.s, + * testsuite/binutils-all/group-7a.d, + * testsuite/binutils-all/group-7b.d, + * testsuite/binutils-all/group-7c.d: New tests. + * testsuite/binutils-all/objcopy.exp: Run them. + +2018-02-08 Nick Clifton + + PR 22802 + * dwarf.c (load_separate_debug_file): Return early if the user is + not interested in debug links. + +2018-02-06 Nick Clifton + + PR 22793 + * readelf.c (find_section): Replace assertion with test and return + of NULL. + (find_section_by_address): Add test of section header table + existance. + (find_section_by_type): Likewise. + (find_section_in_set): Likewise. + +2018-02-05 Maciej W. Rozycki + + * testsuite/binutils-all/mips/mips-reginfo.d: New test. + * testsuite/binutils-all/mips/mips-reginfo-n32.d: New test. + * testsuite/binutils-all/mips/mips-reginfo.s: New test source. + * testsuite/binutils-all/mips/mips.exp: Run the new tests. + +2018-02-05 Maciej W. Rozycki + + * testsuite/config/default.exp (binutils_run): Document + `binutils_run_status'. + * testsuite/lib/utils-lib.exp (default_binutils_run): Likewise, + and set it. + (run_dump_test): Add `error', `error_output', `warning' and + `warning_output' options. Update documentation accordingly. + +2018-02-02 Andrew Burgess + + * dwarf.c (dwarf_regnames_riscv): New register name table. + (init_dwarf_regnames_riscv): New function. + (init_dwarf_regnames): Add call to initialise RiscV register + names. + * dwarf.h (init_dwarf_regnames_riscv): Declare. + * objdump.c (dump_dwarf): Add call to initialise RiscV register + names. + +2018-02-01 Alan Modra + + PR 22769 + * objdump.c (load_specific_debug_section): Check for overflow + when adding one to section size for a string section terminator. + +2018-01-30 Nick Clifton + + PR 22734 + * doc/binutils.texi (nm): Update description to point out that + zero-initialized values can also be shown as type B, b, S or s + since they can be stored in the BSS section. + +2018-01-30 Alan Modra + + * objcopy.c (merge_gnu_build_notes): Use (bfd_vma) -1 as + "artificially large" end address. + +2018-01-28 Nick Clifton + + * README-how-to-make-a-release: Add note about checking gpg key + and the results of gnupload. + +2018-01-27 Nick Clifton + + * README-how-to-make-a-release: Add details on how to actually + make the release. + +2018-01-26 Nick Clifton + + * README-how-to-make-a-release: Add more details on updating + version numbers. + 2018-01-22 Maciej W. Rozycki * doc/binutils.texi (objcopy): Fix a typo in `--rename-section' @@ -25,6 +153,15 @@ * po/bg.po: Updated Bulgarian translation. +2018-01-16 Joel Brobecker + + * README-how-to-make-a-release: Add reminder to update the + branch name in gdbadmin's crontab on sourceware. + +2018-01-16 Joel Brobecker + + * README-how-to-make-a-release: Remove trailing spaces. + 2018-01-16 Nick Clifton * po/fr.po: Updated French translation. @@ -35,7 +172,11 @@ 2018-01-13 Nick Clifton - * po/binutils.pot: Regenerate. + * README-how-to-make-a-release: Update notes. + * po/binutils.pot: Regenerated. + +2018-01-13 Nick Clifton + * configure: Regenerate. 2018-01-13 Nick Clifton diff --git a/binutils/README-how-to-make-a-release b/binutils/README-how-to-make-a-release index 4e6d1e7..c46ba7c 100644 --- a/binutils/README-how-to-make-a-release +++ b/binutils/README-how-to-make-a-release @@ -1,5 +1,5 @@ README for MAKING BINUTILS RELEASES - + This is a collection of notes on how to perform a binutils release. A lot of this information can also be found in the maintain.texi file in the gnulib project: @@ -22,72 +22,225 @@ How to perform a release. 1. Send an email out warning contributors about the forthcoming branch. Set a date for the branch (weekends are better because they are less busy). - - 2. Update the libiberty and config directories and the top level - configure files. + + 2. When the branch date is near: Update the libiberty and config + directories and the top level configure files. 3. When branch day arrives add markers for the upcoming release to gas, ld, gold and binutils NEWS files. + [If using the make-prerelease.sh script, check that + common.sh has the right values]. [make-prelease.sh command i] [make-prelease.sh command C] Likewise for all of the ChangeLog files. Add a note of the name of the new branch to binutils/BRANCHES. Commit these changes. [make-prerelease.sh command C] - + 4. Create the release branch using: - git tag -a binutils-2_30-branch [eg for the 2.30 branch...] + git tag -a binutils-2_30-branch [e.g. for the 2.30 branch...] git push --tags origin binutils-2_30-branch - 5. Update bfd/configure and bfd/configure.ac on HEAD to indicate + 5. Update "BINUTILS_BRANCH" in gdbadmin's crontab: + + Log in as gdbadmin on sourceware.org, and then: + + $ cd crontab + $ vi crontab + [change BINUTILS_BRANCH] + $ cvs ci crontab + $ crontab crontab + + If you do not have access to this account, please feel free to + ask Joel Brobecker . + + 6. Update bfd/configure and bfd/configure.ac on HEAD to indicate snapshot of the following release. + [make-prerelease.sh command hv + C] - 6. Rename the current HEAD version entry in Bugzilla, and create a + 7. Rename the current HEAD version entry in Bugzilla, and create a new one. E.g. rename "2.30 (HEAD)" to 2.30, and create "2.31 - (HEAD)". Go to "Edit products" from the bottom toolbar, click on - "binutils", then on "Edit versions". If you don't have - permissions to do this, either ask Daniel Berlin to fix your - account or ask Daniel Jacobowitz to do it. + (HEAD)": + + https://sourceware.org/bugzilla/editversions.cgi?product=binutils - 7. Regenerate various files on both branch and HEAD by configuring - with --enable-maintainer-mode. No need to check in changes to - the autoconf/automake/etc files, but be sure the .pot files are - up to date. + 8. Update the release number in bfd/version.m4 for the mainline and + the branch. The mainline should have the minor number + incremented, but the branch only needs the point value set to 90 + as the release has not actually happened yet. - 8. Create an initial prerelease: + Regenerate various files on both branch and HEAD by configuring + with --enable-maintainer-mode. NB/ Remember to build gold and + gprof. Commit the changes. Make sure that this includes the + .pot files as well as the configure and makefiles. - a. Bump the version on the branch, and check this in. + 9. Create an initial prerelease: + + a. Change the version on the branch (bfd/version.m4), regenerate + the files, and check this in. + + b. Create a source tarball of the branch sources: + + ./src-release -x binutils - b. Create a source tarball: - - git clean -f -d -x - CFLAGS="-O -g0" ./src-release.sh -b binutils - rm -rf $release_dir/proto-toplev - rm $release_dir/binutils-$version - rm $release_dir/binutils-$version.tar - mv $release_dir/binutils-$version.tar.lzip .. - c. Build a test target using this tarball. d. Upload the prerelease snapshot to the FTP: - scp ../binutils-$version.tar.bz2 sourceware.org:~ftp/pub/binutils/snapshots - ssh sourceware.org md5sum \~ftp/pub/binutils/snapshots/binutils-$version.tar.bz2 - md5sum ../binutils-$version.tar.bz2 + scp ../binutils-$version.tar.xz sourceware.org:~ftp/pub/binutils/snapshots + ssh sourceware.org md5sum ~ftp/pub/binutils/snapshots/binutils-$version.tar.xz + + 10. Send it to the Translation Project: - 9. Send it to the Translation Project: - http://translationproject.org/html/maintainers.html - + Sending mail for one of the POT files is sufficient. - 10. Announce the availability of the snapshot and the branch on the + 11. Announce the availability of the snapshot and the branch on the binutils mailing list. Set a date for when the release will - actually happen. Nag maintainers to fix any testsuite failures - for their architectures... + actually happen. Something like: + ------------------------------------------------------------------------ + Hi Everyone, + + The 2.XX branch has now been created: + + git clone git://sourceware.org/git/binutils-gdb.git -b binutils-2_XX-branch 2.XX + + A snapshot of the sources is also available here: + + ftp://sourceware.org/pub/binutils/snapshots/binutils-2.XX.0.tar.xz + + Please could all patches for the branch be run by me. + The rules for the branch are: + + * No new features. + * Target specific bug fixes are OK. + * Generic bug fixes are OK if they are important and widely tested. + * Documentation updates/fixes are OK. + * Translation updates are OK. + * Fixes for testsuite failures are OK. + + Ideally I would like to make the release happen in two weeks time, + i.e. Saturday 27th Jan. Which I hope will be enough time for everyone + to get their final fixes in. + ------------------------------------------------------------------------ + + 12. Build various different toolchains, test them and nag + maintainers to fix any testsuite failures for their + architectures... + + +When the time comes to actually make the release.... + + + 20. Make sure that the branch sources still build, test and install + correctly. + + 21. Update the release number in bfd/version.m4 on the release + branch to a whole new minor version number, without a point + value. Eg "2.29.90" becomes "2.30". Change bfd/development.sh + to set the value to "false". Regenerate the configure and + makefiles. Add changelog entries for the updates and add a + "this-is-the-2.XX-release" commit and commit. Make sure to + include the .gmo files. + + 22. Check that your file creation mask will create the + correct file permissions. Eg: + + umask 022 + + 23. Create the release tarballs: + + ./src-release -b -g -l -x binutils + + 24. Check that the files in the tarballs have the correct + permissions. FIXME: The tarballs will contain spurious + autom4te.cache directories which could be removed to reduce + their size. + + 25. Sanity check the release on x86_64-pc-linux-gnu by building and + running the testsuite. Make the source directory read-only + before building. Also test "make install". If necessary fix + any problems. + + 26. Tag the branch with the new release number: + + git tag -a binutils-2_XX + [optional: add "-u XXXXX" to sign with a gpg key] + git push origin binutils-2_XX -xxx -- fill in stuff here -- xxx + NB/ If you do sign the binaries make sure to use a key + that has been published with the FSF. + + 27. Clean up the source tree. (Use "git status" to find new + files, and remove them). + + 28. Edit bfd/development.sh on the branch and set + "development=true". Also bump the version by adding a trailing + .0, so that the date suffix keeps the version lower than the + trunk version. Regenerate files. Commit these changes. + + 29. Upload the tarballs to ftp.gnu.org. + + gnupload --to ftp.gnu.org:binutils binutils-X.XX.tar.* + + The gnupload script is in the gnulib/build-aux directory. + + Check for an email response from the upload. If necessary + fix any problems. + + 30. Upload the tarballs (and signatures) to sourceware.org: + + sftp sourceware.org + cd /sourceware/ftp/pub/binutils/releases + put binutils-X.XX.tar.* + chmod 644 binutils-X.XX.tar.* + quit + + FIXME: Should the signatures (created by the gnupload script in + step 29) be uploaded as well ? + + 31. Update web pages. For sourceware.org: + + Create a new documentation folder on the sourceware.org web + pages as /sourceware/www/sourceware/htdocs/binutils/docs-X.XX. + Make the html documentation locally with the "make html" command + and then upload and rename the directories as needed. Create an + index.html file and then edit the docs link to point to the new + docs-X.XX directory. + + Update the sourceware.org site to point to the new documentation + and mention the new version. + + For the www.gnu.org site you have to email webmasters@gnu.org + and ask them to make the change(s). + + 32. Send emails to binutils@sourceware.org, info-gnu@gnu.org and + David Edelsohn announcing the new release. + Sign the email and include the checksum. + (The email to Davis is so that he can update the GNU Toolchain + social media). Something like this: + ------------------------------------------------------------------------ + Hi Everyone, + + We are pleased to announce that version 2.XX of the Binutils project + sources have been released and are now available for download at: + + https://ftp.gnu.org/gnu/binutils + https://sourceware.org/pub/binutils/releases/ + + checksums: xxxx + + This release contains numerous bug fixes, and also the + following new features: + + + + Our thanks go out to all of the binutils contributors, past and + present, for helping to make this release possible. + + -------------------------------------------------------------------------- ------------------------------------------------- How to perform a point release. @@ -115,9 +268,9 @@ looks like this: 2.5 Prepare a list of the bugs which have been fixed. This will be needed for step 8. - + 3. In the branch sources: - + a. Update the minor release number in bfd/version.m4. b. Edit bfd/development.sh and set "development=false". c. Regenerate the configure files. @@ -133,13 +286,13 @@ looks like this: correct file permissions. Eg: umask 022 - + g. Create the release tarballs: ./src-release -b -g -l -x binutils h. Check that the files in the tarballs have the correct permissions. - + i. Edit bfd/development.sh and set "development=true". j. Commit this change into the git repository. k. Clean up the source tree. (Use "git status" to find new @@ -150,7 +303,7 @@ looks like this: 4. [If paranoid - upload the tarballs to one of the FTP servers and ask people to test it before going on to step 5]. - + 5. Upload the tarballs to ftp.gnu.org. gnupload --to ftp.gnu.org:binutils binutils-X.XX.X.tar.* @@ -186,7 +339,7 @@ Hi Everyone, We are pleased to announce that version 2.XX.X of the Binutils project sources have been released and are now available for download at: - + https://ftp.gnu.org/gnu/binutils https://sourceware.org/pub/binutils/releases/ diff --git a/binutils/configure b/binutils/configure index f24c01d..9ce9f3f 100755 --- a/binutils/configure +++ b/binutils/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for binutils 2.30. +# Generated by GNU Autoconf 2.64 for binutils 2.30.51. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='binutils' PACKAGE_TARNAME='binutils' -PACKAGE_VERSION='2.30' -PACKAGE_STRING='binutils 2.30' +PACKAGE_VERSION='2.30.51' +PACKAGE_STRING='binutils 2.30.51' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1338,7 +1338,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures binutils 2.30 to adapt to many kinds of systems. +\`configure' configures binutils 2.30.51 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1409,7 +1409,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of binutils 2.30:";; + short | recursive ) echo "Configuration of binutils 2.30.51:";; esac cat <<\_ACEOF @@ -1530,7 +1530,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -binutils configure 2.30 +binutils configure 2.30.51 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2172,7 +2172,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by binutils $as_me 2.30, which was +It was created by binutils $as_me 2.30.51, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -3981,7 +3981,7 @@ fi # Define the identity of the package. PACKAGE='binutils' - VERSION='2.30' + VERSION='2.30.51' cat >>confdefs.h <<_ACEOF @@ -12312,7 +12312,7 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi -ALL_LINGUAS="bg da es fi fr id it ja ro ru rw sk sv tr uk vi zh_CN zh_TW hr ca" +ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW" # If we haven't got the data from the intl directory, # assume NLS is disabled. USE_NLS=no @@ -15233,7 +15233,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by binutils $as_me 2.30, which was +This file was extended by binutils $as_me 2.30.51, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15297,7 +15297,7 @@ Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -binutils config.status 2.30 +binutils config.status 2.30.51 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/binutils/configure.ac b/binutils/configure.ac index 6d3eaa3..30898ae 100644 --- a/binutils/configure.ac +++ b/binutils/configure.ac @@ -89,7 +89,7 @@ fi AC_PROG_YACC AM_PROG_LEX -ALL_LINGUAS="bg da es fi fr id it ja ro ru rw sk sv tr uk vi zh_CN zh_TW hr ca" +ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW" ZW_GNU_GETTEXT_SISTER_DIR AM_PO_SUBDIRS diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi index b862a79..caf7f9d 100644 --- a/binutils/doc/binutils.texi +++ b/binutils/doc/binutils.texi @@ -802,7 +802,9 @@ linking. @item B @itemx b -The symbol is in the uninitialized data section (known as BSS). +The symbol is in the BSS data section. This section typically +contains zero-initialized or uninitialized data, although the exact +behavior is system dependent. @item C The symbol is common. Common symbols are uninitialized data. When @@ -848,7 +850,8 @@ The symbol is in a read only data section. @item S @itemx s -The symbol is in an uninitialized data section for small objects. +The symbol is in an uninitialized or zero-initialized data section +for small objects. @item T @itemx t @@ -1167,7 +1170,7 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{--localize-symbols=}@var{filename}] [@option{--globalize-symbols=}@var{filename}] [@option{--weaken-symbols=}@var{filename}] - [@option{--add-symbol} @var{name}=[@var{section}:]@var{value}[,@var{flags}] + [@option{--add-symbol} @var{name}=[@var{section}:]@var{value}[,@var{flags}]] [@option{--alt-machine-code=}@var{index}] [@option{--prefix-symbols=}@var{string}] [@option{--prefix-sections=}@var{string}] diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 6dee8aa..17896e6 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -387,6 +387,9 @@ read_uleb128 (unsigned char * data, } \ while (0) +/* Read AMOUNT bytes from PTR and store them in VAL as an unsigned value. + Checks to make sure that the read will not reach or pass END + and that VAL is big enough to hold AMOUNT bytes. */ #define SAFE_BYTE_GET(VAL, PTR, AMOUNT, END) \ do \ { \ @@ -415,6 +418,7 @@ read_uleb128 (unsigned char * data, } \ while (0) +/* Like SAFE_BYTE_GET, but also increments PTR by AMOUNT. */ #define SAFE_BYTE_GET_AND_INC(VAL, PTR, AMOUNT, END) \ do \ { \ @@ -423,6 +427,7 @@ read_uleb128 (unsigned char * data, } \ while (0) +/* Like SAFE_BYTE_GET, but reads a signed value. */ #define SAFE_SIGNED_BYTE_GET(VAL, PTR, AMOUNT, END) \ do \ { \ @@ -441,6 +446,7 @@ read_uleb128 (unsigned char * data, } \ while (0) +/* Like SAFE_SIGNED_BYTE_GET, but also increments PTR by AMOUNT. */ #define SAFE_SIGNED_BYTE_GET_AND_INC(VAL, PTR, AMOUNT, END) \ do \ { \ @@ -6543,6 +6549,7 @@ display_debug_ranges_list (unsigned char *start, unsigned char *finish, break; SAFE_SIGNED_BYTE_GET_AND_INC (end, start, pointer_size, finish); + printf (" %8.8lx ", offset); if (begin == 0 && end == 0) @@ -6810,6 +6817,13 @@ display_debug_ranges (struct dwarf_section *section, continue; } + if (next < section_begin || next >= finish) + { + warn (_("Corrupt offset (%#8.8lx) in range entry %u\n"), + (unsigned long) offset, i); + continue; + } + if (dwarf_check != 0 && i > 0) { if (start < next) @@ -6825,6 +6839,7 @@ display_debug_ranges (struct dwarf_section *section, (unsigned long) (next - section_begin), section->name); } } + start = next; last_start = next; @@ -7065,6 +7080,27 @@ init_dwarf_regnames_s390 (void) dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_s390); } +static const char *const dwarf_regnames_riscv[] = +{ + "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2", /* 0 - 7 */ + "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5", /* 8 - 15 */ + "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7", /* 16 - 23 */ + "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6", /* 24 - 31 */ + "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7", /* 32 - 39 */ + "fs0", "fs1", /* 40 - 41 */ + "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6", "fa7", /* 42 - 49 */ + "fs2", "fs3", "fs4", "fs5", "fs6", "fs7", "fs8", "fs9", /* 50 - 57 */ + "fs10", "fs11", /* 58 - 59 */ + "ft8", "ft9", "ft10", "ft11" /* 60 - 63 */ +}; + +void +init_dwarf_regnames_riscv (void) +{ + dwarf_regnames = dwarf_regnames_riscv; + dwarf_regnames_count = ARRAY_SIZE (dwarf_regnames_riscv); +} + void init_dwarf_regnames (unsigned int e_machine) { @@ -7092,6 +7128,10 @@ init_dwarf_regnames (unsigned int e_machine) init_dwarf_regnames_s390 (); break; + case EM_RISCV: + init_dwarf_regnames_riscv (); + break; + default: break; } @@ -9851,6 +9891,10 @@ load_dwo_file (const char * main_filename) void * load_separate_debug_file (void * file, const char * filename) { + /* Skip this operation if we are not interested in debug links. */ + if (! do_follow_links && ! do_debug_links) + return NULL; + /* See if there is a dwo link. */ if (load_debug_section (str, file) && load_debug_section (abbrev, file) @@ -9885,6 +9929,8 @@ load_separate_debug_file (void * file, const char * filename) } if (! do_follow_links) + /* The other debug links will be displayed by display_debug_links() + so we do not need to do any further processing here. */ return NULL; /* FIXME: We do not check for the presence of both link sections in the same file. */ diff --git a/binutils/dwarf.h b/binutils/dwarf.h index 7f7c79d..34c2f5f 100644 --- a/binutils/dwarf.h +++ b/binutils/dwarf.h @@ -221,6 +221,7 @@ extern void init_dwarf_regnames_iamcu (void); extern void init_dwarf_regnames_x86_64 (void); extern void init_dwarf_regnames_aarch64 (void); extern void init_dwarf_regnames_s390 (void); +extern void init_dwarf_regnames_riscv (void); extern bfd_boolean load_debug_section (enum dwarf_section_display_enum, void *); extern void free_debug_section (enum dwarf_section_display_enum); diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 1e39f6d..d0a152c 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -2064,7 +2064,7 @@ merge_gnu_build_notes (bfd * abfd, asection * sec, bfd_size_type size, bfd_byte For now though, since v1 and v2 was not intended to handle gaps, we chose an artificially large end address. */ - end = (bfd_vma) 0x7ffffffffffffffUL; + end = (bfd_vma) -1; break; case 8: @@ -2083,7 +2083,7 @@ merge_gnu_build_notes (bfd * abfd, asection * sec, bfd_size_type size, bfd_byte For now though, since v1 and v2 was not intended to handle gaps, we chose an artificially large end address. */ - end = (bfd_vma) 0x7ffffffffffffffUL; + end = (bfd_vma) -1; } break; @@ -3023,9 +3023,18 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch) ignore input sections which have no corresponding output section. */ if (strip_symbols != STRIP_ALL) - bfd_map_over_sections (ibfd, - mark_symbols_used_in_relocations, - isympp); + { + bfd_set_error (bfd_error_no_error); + bfd_map_over_sections (ibfd, + mark_symbols_used_in_relocations, + isympp); + if (bfd_get_error () != bfd_error_no_error) + { + status = 1; + return FALSE; + } + } + osympp = (asymbol **) xmalloc ((symcount + add_symbols + 1) * sizeof (asymbol *)); symcount = filter_symbols (ibfd, obfd, osympp, isympp, symcount); } diff --git a/binutils/objdump.c b/binutils/objdump.c index 6c4d936..f4d05bb 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -664,9 +664,7 @@ slurp_dynamic_symtab (bfd *abfd) static bfd_boolean is_significant_symbol_name (const char * name) { - return strcmp (name, ".plt") == 0 - || strcmp (name, ".got") == 0 - || strcmp (name, ".plt.got") == 0; + return strncmp (name, ".plt", 4) == 0 || strcmp (name, ".got") == 0; } /* Filter out (in place) symbols that are useless for disassembly. @@ -937,6 +935,7 @@ find_symbol_for_address (bfd_vma vma, asection *sec; unsigned int opb; bfd_boolean want_section; + long rel_count; if (sorted_symcount < 1) return NULL; @@ -1065,33 +1064,57 @@ find_symbol_for_address (bfd_vma vma, and we have dynamic relocations available, then we can produce a better result by matching a relocation to the address and using the symbol associated with that relocation. */ + rel_count = aux->dynrelcount; if (!want_section - && aux->dynrelbuf != NULL && sorted_syms[thisplace]->value != vma + && rel_count > 0 + && aux->dynrelbuf != NULL + && aux->dynrelbuf[0]->address <= vma + && aux->dynrelbuf[rel_count - 1]->address >= vma /* If we have matched a synthetic symbol, then stick with that. */ && (sorted_syms[thisplace]->flags & BSF_SYNTHETIC) == 0) { - long rel_count; - arelent ** rel_pp; + arelent ** rel_low; + arelent ** rel_high; - for (rel_count = aux->dynrelcount, rel_pp = aux->dynrelbuf; - rel_count--;) + rel_low = aux->dynrelbuf; + rel_high = rel_low + rel_count - 1; + while (rel_low <= rel_high) { - arelent * rel = rel_pp[rel_count]; + arelent **rel_mid = &rel_low[(rel_high - rel_low) / 2]; + arelent * rel = *rel_mid; - if (rel->address == vma - && rel->sym_ptr_ptr != NULL - /* Absolute relocations do not provide a more helpful symbolic address. */ - && ! bfd_is_abs_section ((* rel->sym_ptr_ptr)->section)) + if (rel->address == vma) { - if (place != NULL) - * place = thisplace; - return * rel->sym_ptr_ptr; + /* Absolute relocations do not provide a more helpful + symbolic address. Find a non-absolute relocation + with the same address. */ + arelent **rel_vma = rel_mid; + for (rel_mid--; + rel_mid >= rel_low && rel_mid[0]->address == vma; + rel_mid--) + rel_vma = rel_mid; + + for (; rel_vma <= rel_high && rel_vma[0]->address == vma; + rel_vma++) + { + rel = *rel_vma; + if (rel->sym_ptr_ptr != NULL + && ! bfd_is_abs_section ((* rel->sym_ptr_ptr)->section)) + { + if (place != NULL) + * place = thisplace; + return * rel->sym_ptr_ptr; + } + } + break; } - /* We are scanning backwards, so if we go below the target address - we have failed. */ - if (rel_pp[rel_count]->address < vma) + if (vma < rel->address) + rel_high = rel_mid; + else if (vma >= rel_mid[1]->address) + rel_low = rel_mid + 1; + else break; } } @@ -2466,6 +2489,7 @@ load_specific_debug_section (enum dwarf_section_display_enum debug, struct dwarf_section *section = &debug_displays [debug].section; bfd *abfd = (bfd *) file; bfd_byte *contents; + bfd_size_type amt; if (section->start != NULL) { @@ -2480,9 +2504,11 @@ load_specific_debug_section (enum dwarf_section_display_enum debug, section->num_relocs = 0; section->address = bfd_get_section_vma (abfd, sec); section->size = bfd_get_section_size (sec); - section->start = contents = malloc (section->size + 1); + amt = section->size + 1; + section->start = contents = malloc (amt); section->user_data = sec; - if (section->start == NULL + if (amt == 0 + || section->start == NULL || !bfd_get_full_section_contents (abfd, sec, &contents)) { free_debug_section (debug); @@ -2729,6 +2755,10 @@ dump_dwarf (bfd *abfd) init_dwarf_regnames_s390 (); break; + case bfd_arch_riscv: + init_dwarf_regnames_riscv (); + break; + default: break; } diff --git a/binutils/po/binutils.pot b/binutils/po/binutils.pot index d9e970f..29e3c92 100644 --- a/binutils/po/binutils.pot +++ b/binutils/po/binutils.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: bug-binutils@gnu.org\n" -"POT-Creation-Date: 2018-01-13 13:44+0000\n" +"POT-Creation-Date: 2018-01-13 13:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/binutils/po/pt.po b/binutils/po/pt.po new file mode 100644 index 0000000..ad0153f --- /dev/null +++ b/binutils/po/pt.po @@ -0,0 +1,11951 @@ +# Portuguese translations for GNU binutils package. +# Copyright (C) 2018 Free Software Foundation, Inc. +# This file is distributed under the same license as the binutils package. +# Pedro Albuquerque , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: binutils-2.30.0\n" +"Report-Msgid-Bugs-To: bug-binutils@gnu.org\n" +"POT-Creation-Date: 2018-01-13 13:44+0000\n" +"PO-Revision-Date: 2018-02-24 08:03+0000\n" +"Last-Translator: Pedro Albuquerque \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Gtranslator 2.91.6\n" + +#: addr2line.c:80 +#, c-format +msgid "Usage: %s [option(s)] [addr(s)]\n" +msgstr "Uso: %s [opções] [endereços]\n" + +#: addr2line.c:81 +#, c-format +msgid " Convert addresses into line number/file name pairs.\n" +msgstr " Converter endereços em pares nº de linha/nome de ficheiro.\n" + +#: addr2line.c:82 +#, c-format +msgid " If no addresses are specified on the command line, they will be read from stdin\n" +msgstr " Se não forem especificados endereços na linha de comandos, serão lidos de stdin\n" + +#: addr2line.c:83 +#, c-format +msgid "" +" The options are:\n" +" @ Read options from \n" +" -a --addresses Show addresses\n" +" -b --target= Set the binary file format\n" +" -e --exe= Set the input file name (default is a.out)\n" +" -i --inlines Unwind inlined functions\n" +" -j --section= Read section-relative offsets instead of addresses\n" +" -p --pretty-print Make the output easier to read for humans\n" +" -s --basenames Strip directory names\n" +" -f --functions Show function names\n" +" -C --demangle[=style] Demangle function names\n" +" -h --help Display this information\n" +" -v --version Display the program's version\n" +"\n" +msgstr "" +" As opções são:\n" +" @ Ler opções de \n" +" -a --addresses Mostrar endereços\n" +" -b --target= Define o formato do ficheiro binário\n" +" -e --exe= Define o nome do ficheiro de entrada (predefinido: a.out)\n" +" -i --inlines Desenrola funções en linha\n" +" -j --section= Lê desvios relativos de secção em vez de endereços\n" +" -p --pretty-print Torna a saída mais legível para humanos\n" +" -s --basenames Remove nomes de pastas\n" +" -f --functions Mostra nomes de funções\n" +" -C --demangle[=style] Repõe nomes de funções\n" +" -h --help Mostra esta informação\n" +" -v --version Mostra a versão do programa\n" +"\n" + +#: addr2line.c:100 ar.c:336 ar.c:373 coffdump.c:473 dlltool.c:4006 +#: dllwrap.c:518 elfedit.c:677 nlmconv.c:1112 objcopy.c:658 objcopy.c:711 +#: readelf.c:4385 size.c:97 srconv.c:1706 strings.c:668 sysdump.c:648 +#: windmc.c:227 windres.c:688 +#, c-format +msgid "Report bugs to %s\n" +msgstr "Reportar erros a %s\n" + +#. Note for translators: This printf is used to join the +#. function name just printed above to the line number/ +#. file name pair that is about to be printed below. Eg: +#. +#. foo at 123:bar.c +#: addr2line.c:304 +#, c-format +msgid " at " +msgstr " em " + +#. Note for translators: This printf is used to join the +#. line number/file name pair that has just been printed with +#. the line number/file name pair that is going to be printed +#. by the next iteration of the while loop. Eg: +#. +#. 123:bar.c (inlined by) 456:main.c +#: addr2line.c:345 +#, c-format +msgid " (inlined by) " +msgstr " (em linha por) " + +#: addr2line.c:378 +#, c-format +msgid "%s: cannot get addresses from archive" +msgstr "%s: impossível obter endereços do arquivo" + +#: addr2line.c:395 +#, c-format +msgid "%s: cannot find section %s" +msgstr "%s: impossível encontrar a secção %s" + +#: addr2line.c:465 nm.c:1683 objdump.c:3856 +#, c-format +msgid "unknown demangling style `%s'" +msgstr "Estilo de limpeza desconhecido \"%s\"" + +#: ar.c:257 +#, c-format +msgid "no entry %s in archive\n" +msgstr "sem entrada %s no arquivo\n" + +#: ar.c:271 +#, c-format +msgid "Usage: %s [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin ] [member-name] [count] archive-file file...\n" +msgstr "Uso: %s [opções de emulação] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin ] [nome-membro] [total] ficheiro-arquivo...\n" + +#: ar.c:277 +#, c-format +msgid "Usage: %s [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [member-name] [count] archive-file file...\n" +msgstr "Uso: %s [opções de emulação] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [nome-membro] [total] ficheiro-arquivo...\n" + +#: ar.c:285 +#, c-format +msgid " %s -M [ - read options from \n" +msgstr " @ - lê opções de \n" + +#: ar.c:325 +#, c-format +msgid " --target=BFDNAME - specify the target object format as BFDNAME\n" +msgstr " --target=NOMEBFD - especifica o formato do objecto destino como NOMEBFD\n" + +#: ar.c:327 +#, c-format +msgid " optional:\n" +msgstr " opcional:\n" + +#: ar.c:328 +#, c-format +msgid " --plugin

- load the specified plugin\n" +msgstr " --plugin

- carrega a extensão especificada\n" + +#: ar.c:349 +#, c-format +msgid "Usage: %s [options] archive\n" +msgstr "Uso: %s [opções] arquivo\n" + +#: ar.c:350 +#, c-format +msgid " Generate an index to speed access to archives\n" +msgstr " Gerar um índice para acesso rápido aos arquivos\n" + +#: ar.c:351 +#, c-format +msgid "" +" The options are:\n" +" @ Read options from \n" +msgstr "" +" As opções são:\n" +" @ Ler opções de \n" + +#: ar.c:354 +#, c-format +msgid " --plugin Load the specified plugin\n" +msgstr " --plugin Carrega a extensão especificada\n" + +#: ar.c:358 +#, c-format +msgid "" +" -D Use zero for symbol map timestamp (default)\n" +" -U Use an actual symbol map timestamp\n" +msgstr "" +" -D Usa zero para carimbo do mapa de símbolos (predefinição)\n" +" -U Usa um carimbo actual do mapa de símbolos\n" + +#: ar.c:362 +#, c-format +msgid "" +" -D Use zero for symbol map timestamp\n" +" -U Use actual symbol map timestamp (default)\n" +msgstr "" +" -D Usa zero para carimbo do mapa de símbolos\n" +" -U Usa um carimbo actual do mapa de símbolos (predefinição)\n" + +#: ar.c:365 +#, c-format +msgid "" +" -t Update the archive's symbol map timestamp\n" +" -h --help Print this help message\n" +" -v --version Print version information\n" +msgstr "" +" -t Actualiza o carimbo do mapa de símbolos\n" +" -h --help Mostra esta informação\n" +" -V --version Mostra a versão do programa\n" + +#: ar.c:489 +msgid "two different operation options specified" +msgstr "duas opções de operação diferentes especificadas" + +#: ar.c:580 ar.c:640 nm.c:1764 +#, c-format +msgid "sorry - this program has been built without plugin support\n" +msgstr "desculpe - o programa foi compilado sem suporte a extensões\n" + +#: ar.c:770 +msgid "no operation specified" +msgstr "sem operação especificada" + +#: ar.c:773 +msgid "`u' is only meaningful with the `r' option." +msgstr "\"u\" só faz sentido com a opção \"r\"." + +#: ar.c:776 +msgid "`u' is not meaningful with the `D' option." +msgstr "\"u\" não faz sentido com o opção \"D\"." + +#: ar.c:779 +msgid "`u' modifier ignored since `D' is the default (see `U')" +msgstr "Modificador \"u\" ignorado dado que \"D\" é a predefinição (veja \"U\")" + +#: ar.c:788 +msgid "missing position arg." +msgstr "argumento posicional em falta" + +#: ar.c:794 +msgid "`N' is only meaningful with the `x' and `d' options." +msgstr "\"N\" só faz sentido com as opções \"x\" e \"d\"." + +#: ar.c:796 +msgid "`N' missing value." +msgstr "\"N\" com valor em falta." + +#: ar.c:799 +msgid "Value for `N' must be positive." +msgstr "O valor de \"N\" tem de ser positivo." + +#: ar.c:815 +msgid "`x' cannot be used on thin archives." +msgstr "Não pode usar \"x\" em arquivos magros." + +#: ar.c:862 +#, c-format +msgid "internal error -- this option not implemented" +msgstr "erro interno -- opção não implementada" + +#: ar.c:931 +#, c-format +msgid "creating %s" +msgstr "a criar %s" + +#: ar.c:962 +#, c-format +msgid "Cannot convert existing library %s to thin format" +msgstr "Impossível converter biblioteca existente %s para formato magro" + +#: ar.c:968 +#, c-format +msgid "Cannot convert existing thin library %s to normal format" +msgstr "Impossível converter biblioteca magra existente %s para formato normal" + +#: ar.c:1000 ar.c:1064 ar.c:1394 objcopy.c:3288 +#, c-format +msgid "internal stat error on %s" +msgstr "erro interno estático em %s" + +#: ar.c:1019 ar.c:1097 +#, c-format +msgid "%s is not a valid archive" +msgstr "%s não é um arquivo válido" + +#: ar.c:1056 objcopy.c:3252 +#, c-format +msgid "illegal pathname found in archive member: %s" +msgstr "caminho ilegal em membro do arquivo: %s" + +#: ar.c:1155 +msgid "could not create temporary file whilst writing archive" +msgstr "impossível criar ficheiro temporário ao escrever arquivo" + +#: ar.c:1299 +#, c-format +msgid "No member named `%s'\n" +msgstr "Sem membro chamado \"%s\"\n" + +#: ar.c:1349 +#, c-format +msgid "no entry %s in archive %s!" +msgstr "sem entrada %s no arquivo %s!" + +#: ar.c:1488 +#, c-format +msgid "%s: no archive map to update" +msgstr "%s: sem mapa de arquivo para actualizar" + +#: arsup.c:89 +#, c-format +msgid "No entry %s in archive.\n" +msgstr "Sem entrada %s no arquivo.\n" + +#: arsup.c:114 +#, c-format +msgid "Can't open file %s\n" +msgstr "Impossível abrir %s\n" + +#: arsup.c:164 +#, c-format +msgid "%s: Can't open output archive %s\n" +msgstr "%s: impossível abrir arquivo de saída %s\n" + +#: arsup.c:181 +#, c-format +msgid "%s: Can't open input archive %s\n" +msgstr "%s: impossível abrir arquivo de entrada %s\n" + +#: arsup.c:190 +#, c-format +msgid "%s: file %s is not an archive\n" +msgstr "%s: ficheiro %s não é um arquivo\n" + +#: arsup.c:230 +#, c-format +msgid "%s: no output archive specified yet\n" +msgstr "%s: sem arquivo de saída especificado\n" + +#: arsup.c:250 arsup.c:293 arsup.c:335 arsup.c:358 arsup.c:424 +#, c-format +msgid "%s: no open output archive\n" +msgstr "%s: sem arquivo de saída aberto\n" + +#: arsup.c:266 arsup.c:379 arsup.c:405 +#, c-format +msgid "%s: can't open file %s\n" +msgstr "%s: impossível abrir o ficheiro %s\n" + +#: arsup.c:320 arsup.c:401 arsup.c:482 +#, c-format +msgid "%s: can't find module file %s\n" +msgstr "%s: impossível encontrar ficheiro de módulo %s\n" + +#: arsup.c:433 +#, c-format +msgid "Current open archive is %s\n" +msgstr "Arquivo actualmente aberto é: %s\n" + +#: arsup.c:457 +#, c-format +msgid "%s: no open archive\n" +msgstr "%s: sem arquivos abertos\n" + +#: binemul.c:38 +#, c-format +msgid " No emulation specific options\n" +msgstr " Sem opções específicas de emulação\n" + +#. Macros for common output. +#: binemul.h:49 +#, c-format +msgid " emulation options: \n" +msgstr " opções de emulação: \n" + +#: bucomm.c:156 +#, c-format +msgid "can't set BFD default target to `%s': %s" +msgstr "impossível definir destino BFD como \"%s\": %s" + +#: bucomm.c:168 +#, c-format +msgid "%s: Matching formats:" +msgstr "%s: formatos correspondentes:" + +#: bucomm.c:183 +#, c-format +msgid "Supported targets:" +msgstr "Destinos suportados:" + +#: bucomm.c:185 +#, c-format +msgid "%s: supported targets:" +msgstr "%s: destinos suportados:" + +#: bucomm.c:203 +#, c-format +msgid "Supported architectures:" +msgstr "Arquitecturas suportadas:" + +#: bucomm.c:205 +#, c-format +msgid "%s: supported architectures:" +msgstr "%s: arquitecturas suportadas:" + +#: bucomm.c:218 +msgid "big endian" +msgstr "big endian" + +#: bucomm.c:219 +msgid "little endian" +msgstr "little endian" + +#: bucomm.c:220 +msgid "endianness unknown" +msgstr "endian desconhecido" + +#: bucomm.c:267 +#, c-format +msgid "" +"%s\n" +" (header %s, data %s)\n" +msgstr "" +"%s\n" +" (cabeçalho %s, dados %s)\n" + +#: bucomm.c:416 +#, c-format +msgid "BFD header file version %s\n" +msgstr "Versão do cabeçalho de ficheiro BFD %s\n" + +#: bucomm.c:446 +#, c-format +msgid "

:][,] Add a symbol\n" +" --alt-machine-code Use the target's 'th alternative machine\n" +" --writable-text Mark the output text as writable\n" +" --readonly-text Make the output text write protected\n" +" --pure Mark the output file as demand paged\n" +" --impure Mark the output file as impure\n" +" --prefix-symbols Add to start of every symbol name\n" +" --prefix-sections Add to start of every section name\n" +" --prefix-alloc-sections \n" +" Add to start of every allocatable\n" +" section name\n" +" --file-alignment Set PE file alignment to \n" +" --heap [,] Set PE reserve/commit heap to /\n" +" \n" +" --image-base
Set PE image base to
\n" +" --section-alignment Set PE section alignment to \n" +" --stack [,] Set PE reserve/commit stack to /\n" +" \n" +" --subsystem [:]\n" +" Set PE subsystem to [& ]\n" +" --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n" +" Compress DWARF debug sections using zlib\n" +" --decompress-debug-sections Decompress DWARF debug sections using zlib\n" +" --elf-stt-common=[yes|no] Generate ELF common symbols with STT_COMMON\n" +" type\n" +" -M --merge-notes Remove redundant entries in note sections\n" +" --no-merge-notes Do not attempt to remove redundant notes (default)\n" +" -v --verbose List all object files modified\n" +" @ Read options from \n" +" -V --version Display this program's version number\n" +" -h --help Display this output\n" +" --info List object formats & architectures supported\n" +msgstr "" +" -j --only-section Copiar só a secção para a saída\n" +" --add-gnu-debuglink= Adicionar secção .gnu_debuglink ligando a \n" +" -R --remove-section Remove secção da saída\n" +" --remove-relocations Remove relocalizações da secção \n" +" -S --strip-all Remove toda a informação de símbolo e relocalização\n" +" -g --strip-debug Remove todos os símbolos e relocalizações de depuração\n" +" --strip-dwo Remove todas as secções DWO\n" +" --strip-unneeded Remove todos os símbolos não necessários a relocalizações\n" +" -N --strip-symbol Não copia o símbolo \n" +" --strip-unneeded-symbol \n" +" Não copia o símbolo a não ser que seja necessário\n" +" a relocalizações\n" +" --only-keep-debug Remove tudo menos a informação de depuração\n" +" --extract-dwo Copia só secções DWO\n" +" --extract-symbol Remove conteúdo da secção mas mantém os símbolos\n" +" -K --keep-symbol Não remover símbolo \n" +" --keep-file-symbols Não remover símbolo(s) do ficheiro\n" +" --localize-hidden Tornar todos os símbolos ELF ocultos em locais\n" +" -L --localize-symbol Força o símbolo a ser marcado como local\n" +" --globalize-symbol Força o símbolo a ser marcado como global\n" +" -G --keep-global-symbol Localiza todos os símbolos excepto \n" +" -W --weaken-symbol Força o símbolo a ser marcado como fraco\n" +" --weaken Força todos os símbolos globais a serem marcados como fracos\n" +" -w --wildcard Permite wildcards em comparações de símbolos\n" +" -x --discard-all Remove todos os símbolos não globais\n" +" -X --discard-locals Remove qualquer símbolo gerado pelo compilador\n" +" -i --interleave[=] Copia só N de cada bytes\n" +" --interleave-width Define N como --interleave\n" +" -b --byte Selecciona o byte em cada bloco entrelaçado\n" +" --gap-fill Preenche espaços entre secções com \n" +" --pad-to Preenche a última secção até ao endereço \n" +" --set-start Define o endereço inicial como \n" +" {--change-start|--adjust-start} \n" +" Adiciona ao endereço inicial\n" +" {--change-addresses|--adjust-vma} \n" +" Adiciona a LMA, VMA e endereços iniciais\n" +" {--change-section-address|--adjust-section-vma} {=|+|-}\n" +" Altera LMA e VMA da secção em \n" +" --change-section-lma {=|+|-}\n" +" Altera LMA da secção em \n" +" --change-section-vma {=|+|-}\n" +" Altera VMA da secção em \n" +" {--[no-]change-warnings|--[no-]adjust-warnings}\n" +" Avisa se uma secção com nome não existe\n" +" --set-section-flags =\n" +" Define as propriedades da secção como \n" +" --add-section =\n" +" Adiciona secção encontrada em à saída\n" +" --update-section =\n" +" Actualiza conteúdo da secção com\n" +" conteúdos encontrados em \n" +" --dump-section =\n" +" Despeja o conteúdo da secção em \n" +" --rename-section =[,]\n" +" Renomeia a secção para \n" +" --long-section-names {enable|disable|keep}\n" +" Gere nomes longos de secção em objectos Coff.\n" +" --change-leading-char Força formato de saída do estilo do 1º carácter\n" +" --remove-leading-char Remove o 1º carácter de símbolos globais\n" +" --reverse-bytes= Reverte bytes, em secções de saída com conteúdo\n" +" --redefine-sym = Redefine o nome do símbolo como \n" +" --redefine-syms --redefine-sym para todos os pares de símbolos listados em \n" +" --srec-len Restringe o tamanho de Srecords gerados\n" +" --srec-ForçaS3 Restringe o tipo de Srecords gerados a S3\n" +" --strip-symbols -N para todos os símbolos listados em \n" +" --strip-unneeded-symbols \n" +" --strip-unneeded-symbol para todos os símbolos listados\n" +" em \n" +" --keep-symbols -K para todos os símbolos listados em \n" +" --localize-symbols -L para todos os símbolos listados em \n" +" --globalize-symbols --globalize-symbol para todos em \n" +" --keep-global-symbols \n" +" -G para todos os símbolos listados em \n" +" --weaken-symbols -W para todos os símbolos listados em \n" +" --add-symbol =[
:][,]\n" +" Adiciona um símbolo\n" +" --alt-machine-code <índice> Usa a máquina alternativa <índice> do destino\n" +" --writable-text Marca texto de saída para escrita\n" +" --readonly-text Marca texto de saída como protegido contra escrita\n" +" --pure Marca ficheiro de saída como demanda paginada\n" +" --impure Marca ficheiro de saída como impuro\n" +" --prefix-symbols Adiciona ao início de cada nome de símbolo\n" +" --prefix-sections Adiciona ao início de cada nome de secção\n" +" --prefix-alloc-sections \n" +" Adiciona ao início de cada nome de\n" +" secção atribuível\n" +" --file-alignment Define alinhamento de ficheiro PE para \n" +" --heap [,] Define heap reserve/commit PE como /\n" +" --image-base Define base de imagem PE como \n" +" --section-alignment Define alinhamento da secção PE como \n" +" --stack [,] Define a pilha reserve/commit PE como /\n" +" --subsystem [:]\n" +" Define o sub-sistema PE como [& ]\n" +" --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n" +" Comprime secções de depuração DWARF usando zlib\n" +" --decompress-debug-sections Descomprime secções de depuração DWARF usando zlib\n" +" --elf-stt-common=[yes|no] Gera símbolos comuns ELF com tipo STT_COMMON\n" +" -M --merge-notes Remove entradas redundantes em secções de notas\n" +" --no-merge-notes Não tenta remover notas redundantes (predefinição)\n" +" -v --verbose Lista todos os ficheiros de objectos modificados\n" +" @ Lê opções de \n" +" -V --version Mostra a versão do programa\n" +" -h --help Mostra esta informação\n" +" --info Lista formatos & arquitecturas de objectos suportados\n" + +#: objcopy.c:665 +#, c-format +msgid "Usage: %s in-file(s)\n" +msgstr "Uso: %s in-file(s)\n" + +#: objcopy.c:666 +#, c-format +msgid " Removes symbols and sections from files\n" +msgstr " Remove símbolos e secções de ficheiros\n" + +#: objcopy.c:668 +#, c-format +msgid "" +" -I --input-target= Assume input file is in format \n" +" -O --output-target= Create an output file in format \n" +" -F --target= Set both input and output format to \n" +" -p --preserve-dates Copy modified/access timestamps to the output\n" +msgstr "" +" -I --input-target= Assume que o ficheiro de entrada tem formato \n" +" -O --output-target= Cria o ficheiro de saída com formato \n" +" -F --target= Define ficheiros de entrada e saída com formato \n" +" -p --preserve-dates Copia carimbos modificados/acedidos para a saída\n" + +#: objcopy.c:686 +#, c-format +msgid "" +" -R --remove-section= Also remove section from the output\n" +" --remove-relocations Remove relocations from section \n" +" -s --strip-all Remove all symbol and relocation information\n" +" -g -S -d --strip-debug Remove all debugging symbols & sections\n" +" --strip-dwo Remove all DWO sections\n" +" --strip-unneeded Remove all symbols not needed by relocations\n" +" --only-keep-debug Strip everything but the debug information\n" +" -M --merge-notes Remove redundant entries in note sections (default)\n" +" --no-merge-notes Do not attempt to remove redundant notes\n" +" -N --strip-symbol= Do not copy symbol \n" +" -K --keep-symbol= Do not strip symbol \n" +" --keep-file-symbols Do not strip file symbol(s)\n" +" -w --wildcard Permit wildcard in symbol comparison\n" +" -x --discard-all Remove all non-global symbols\n" +" -X --discard-locals Remove any compiler-generated symbols\n" +" -v --verbose List all object files modified\n" +" -V --version Display this program's version number\n" +" -h --help Display this output\n" +" --info List object formats & architectures supported\n" +" -o Place stripped output into \n" +msgstr "" +" -R --remove-section= Remove também secção da saída\n" +" --remove-relocations Remove relocalizações da secção \n" +" -s --strip-all Remove toda a informação de símbolo e relocalização\n" +" -g -S -d --strip-debug Remove todos os símbolos e secções de depuração\n" +" --strip-dwo Remove todas as secções DWO\n" +" --strip-unneeded Remove todos os símbolos não necessários para relocalizaçoes\n" +" --only-keep-debug Remove tudo menos informação de depuração\n" +" -M --merge-notes Remove entradas redundantes em secções de notas (predefinição)\n" +" --no-merge-notes Não tenta remover notas redundantes\n" +" -N --strip-symbol= Não copia símbolo \n" +" -K --keep-symbol= Não remove símbolo \n" +" --keep-file-symbols Não remove símbolos de ficheiro\n" +" -w --wildcard Permite wildcard em comparação de símbolo\n" +" -x --discard-all Remove todos os símbolos não globais\n" +" -X --discard-locals Remove qualquer símbolo gerado pelo compilador\n" +" -v --verbose Lista todos os ficheiros de objectos modificados\n" +" -V --version Mostra a versão do programa\n" +" -h --help Mostra esta informação\n" +" --info Lista formatos e arquitecturas de objecto suportados\n" +" -o Colocar saída limpa em \n" + +#: objcopy.c:761 +#, c-format +msgid "unrecognized section flag `%s'" +msgstr "bandeira de secção \"%s\" não reconhecida" + +#: objcopy.c:762 objcopy.c:834 +#, c-format +msgid "supported flags: %s" +msgstr "bandeiras suportadas: %s" + +#: objcopy.c:833 +#, c-format +msgid "unrecognized symbol flag `%s'" +msgstr "bandeira de símbolo \"%s\" não reconhecida" + +#: objcopy.c:892 +#, c-format +msgid "error: %s both copied and removed" +msgstr "erro: ambos %s copiados e removidos" + +#: objcopy.c:898 +#, c-format +msgid "error: %s both sets and alters VMA" +msgstr "erro: ambos %s definem e alteram VMA" + +#: objcopy.c:904 +#, c-format +msgid "error: %s both sets and alters LMA" +msgstr "erro: ambos %s definem e alteram LMA" + +#: objcopy.c:1055 +#, c-format +msgid "cannot open '%s': %s" +msgstr "impossível abrir \"%s\": %s" + +#: objcopy.c:1058 objcopy.c:4667 +#, c-format +msgid "%s: fread failed" +msgstr "%s: falha em fread" + +#: objcopy.c:1131 +#, c-format +msgid "%s:%d: Ignoring rubbish found on this line" +msgstr "%s:%d: a ignorar disparates encontrados nesta linha" + +#: objcopy.c:1293 +#, c-format +msgid "error: section %s matches both remove and copy options" +msgstr "erro: secção %s cumpre ambas as opções de remoção e cópia" + +#: objcopy.c:1296 +#, c-format +msgid "error: section %s matches both update and remove options" +msgstr "erro: secção %s cumpre ambas as opções de actualização e remoção" + +#: objcopy.c:1448 +#, c-format +msgid "Section %s not found" +msgstr "Secção %s não encontrada" + +#: objcopy.c:1596 +#, c-format +msgid "not stripping symbol `%s' because it is named in a relocation" +msgstr "símbolo \"%s\" não removido porque é chamado numa relocalização" + +#: objcopy.c:1656 +#, c-format +msgid "'before=%s' not found" +msgstr "\"before=%s\" não encontrado" + +#: objcopy.c:1695 +#, c-format +msgid "%s: Multiple redefinition of symbol \"%s\"" +msgstr "%s: múltipla redefinição do símbolo \"%s\"" + +#: objcopy.c:1699 +#, c-format +msgid "%s: Symbol \"%s\" is target of more than one redefinition" +msgstr "%s: o símbolo \"%s\" é destino de mais de uma redefinição" + +#: objcopy.c:1726 +#, c-format +msgid "couldn't open symbol redefinition file %s (error: %s)" +msgstr "impossível abrir ficheiro %s de redefinição de símbolo (erro %s)" + +#: objcopy.c:1804 +#, c-format +msgid "%s:%d: garbage found at end of line" +msgstr "%s:%d: lixo encontrado no fim da linha" + +#: objcopy.c:1807 +#, c-format +msgid "%s:%d: missing new symbol name" +msgstr "%s:%d: novo nome de símbolo em falta" + +#: objcopy.c:1817 +#, c-format +msgid "%s:%d: premature end of file" +msgstr "%s:%d: fim de ficheiro prematuro" + +#: objcopy.c:1843 +#, c-format +msgid "stat returns negative size for `%s'" +msgstr "stat devolve tamanho negativo para \"%s\"" + +#: objcopy.c:1855 +#, c-format +msgid "copy from `%s' [unknown] to `%s' [unknown]\n" +msgstr "copiar de \"%s\"' [desconhecido] to \"%s\" [desconhecido]\n" + +#: objcopy.c:2008 +msgid "corrupt GNU build attribute note: wrong note type" +msgstr "nota de atributo de compilação GNU corrupta: tipo de nota incorrecta" + +#: objcopy.c:2014 +msgid "corrupt GNU build attribute note: note too big" +msgstr "nota de atributo de compilação GNU corrupta: nota muito grande" + +#: objcopy.c:2020 +msgid "corrupt GNU build attribute note: name too small" +msgstr "nota de atributo de compilação GNU corrupta: nome muito pequeno" + +#: objcopy.c:2047 +msgid "corrupt GNU build attribute note: unsupported version" +msgstr "nota de atributo de compilação GNU corrupta: versão não suportada" + +#: objcopy.c:2096 +msgid "corrupt GNU build attribute note: bad description size" +msgstr "nota de atributo de compilação GNU corrupta: tamanho de descrição errado" + +#: objcopy.c:2127 +msgid "corrupt GNU build attribute note: name not NUL terminated" +msgstr "nota de atributo de compilação GNU corrupta: nome não termina com NUL" + +#: objcopy.c:2139 +msgid "corrupt GNU build attribute notes: excess data at end" +msgstr "notas de atributo de compilação GNU corrupta: dados excessivos no fim" + +#: objcopy.c:2145 +msgid "bad GNU build attribute notes: no known versions detected" +msgstr "notas de atributo de compilação GNU corrupta: sem versões conhecidas" + +#: objcopy.c:2153 +msgid "bad GNU build attribute notes: multiple different versions" +msgstr "notas de atributo de compilação GNU corrupta: múltiplas versões diferentes" + +#: objcopy.c:2167 +msgid "bad GNU build attribute notes: first note not version note" +msgstr "notas de atributo de compilação GNU corrupta: 1ª nota não é nota de versão" + +#. PR 17636: Call non-fatal so that we return to our parent who +#. may need to tidy temporary files. +#: objcopy.c:2428 +msgid "Unable to change endianness of input file(s)" +msgstr "Impossível alterar endian dos ficheiros de entrada" + +#: objcopy.c:2440 +#, c-format +msgid "error: the input file '%s' has no sections" +msgstr "erro: o ficheiro de entrada \"%s\" não tem secções" + +#: objcopy.c:2450 +#, c-format +msgid "--compress-debug-sections=[zlib|zlib-gnu|zlib-gabi] is unsupported on `%s'" +msgstr "--compress-debug-sections=[zlib|zlib-gnu|zlib-gabi] não é suportado em \"%s\"" + +#: objcopy.c:2457 +#, c-format +msgid "--elf-stt-common=[yes|no] is unsupported on `%s'" +msgstr "--elf-stt-common=[yes|no] não é suportado em \"%s\"" + +#: objcopy.c:2464 +#, c-format +msgid "copy from `%s' [%s] to `%s' [%s]\n" +msgstr "copiar de \"%s\" [%s] para \"%s\" [%s]\n" + +#: objcopy.c:2513 +#, c-format +msgid "Input file `%s' ignores binary architecture parameter." +msgstr "Ficheiro de entraa \"%s\" ignora o parâmetro de arquitectura binária." + +#: objcopy.c:2521 +#, c-format +msgid "Unable to recognise the format of the input file `%s'" +msgstr "Impossível reconhecer formato do ficheiro de entrada \"%s\"" + +#: objcopy.c:2524 +#, c-format +msgid "Output file cannot represent architecture `%s'" +msgstr "Ficheiro de saída não pode representar a arquitectura \"%s\"" + +#: objcopy.c:2587 +#, c-format +msgid "warning: file alignment (0x%s) > section alignment (0x%s)" +msgstr "aviso: alinhamento do ficheiro (0x%s) > alinhamento da secção (0x%s)" + +#: objcopy.c:2653 +#, c-format +msgid "can't add section '%s'" +msgstr "impossível adicionar secção \"%s\"" + +#: objcopy.c:2667 +#, c-format +msgid "can't create section `%s'" +msgstr "impossível criar secção \"%s\"" + +#: objcopy.c:2716 +#, c-format +msgid "error: %s not found, can't be updated" +msgstr "erro: %s não encontrado, impossível actualizar" + +#: objcopy.c:2741 +msgid "warning: note section is empty" +msgstr "aviso: secção de nota está vazia" + +#: objcopy.c:2746 +msgid "warning: could not load note section" +msgstr "aviso: impossível carregar secção de nota" + +#: objcopy.c:2767 +msgid "warning: failed to set merged notes size" +msgstr "aviso: falha ao definir tamanho das notas unidas" + +#: objcopy.c:2788 +#, c-format +msgid "can't dump section '%s' - it does not exist" +msgstr "impossível despejar secção \"%s\" - não existe" + +#: objcopy.c:2796 +msgid "can't dump section - it has no contents" +msgstr "impossível despejar secção - não tem conteúdo" + +#: objcopy.c:2804 +msgid "can't dump section - it is empty" +msgstr "impossível despejar secção - está vazia" + +#: objcopy.c:2813 +msgid "could not open section dump file" +msgstr "impossível abrir ficheiro de despejo de secção" + +#: objcopy.c:2822 +#, c-format +msgid "error writing section contents to %s (error: %s)" +msgstr "erro ao escrever conteúdo da secção em %s (erro: %s)" + +#: objcopy.c:2831 +msgid "could not retrieve section contents" +msgstr "impossível obter conteúdo da secção" + +#: objcopy.c:2845 +#, c-format +msgid "%s: debuglink section already exists" +msgstr "%s: secção debuglink já existe" + +#: objcopy.c:2857 +#, c-format +msgid "cannot create debug link section `%s'" +msgstr "impossível criar secção debuglink \"%s\"" + +#: objcopy.c:2949 +msgid "Can't fill gap after section" +msgstr "Impossível preencher espaço após secção" + +#: objcopy.c:2973 +msgid "can't add padding" +msgstr "impossível adicionar espaço" + +#: objcopy.c:3090 +msgid "error: failed to copy merged notes into output" +msgstr "erro: falha ao copiar notas unidas para a saída" + +#: objcopy.c:3095 +msgid "could not find any mergeable note sections" +msgstr "impossível encontrar secções de nota para unir" + +#: objcopy.c:3107 +#, c-format +msgid "cannot fill debug link section `%s'" +msgstr "impossível preencher secção debuglink \"%s\"" + +#: objcopy.c:3164 +msgid "error copying private BFD data" +msgstr "erro ao copiar dados privados BFD" + +#: objcopy.c:3175 +#, c-format +msgid "this target does not support %lu alternative machine codes" +msgstr "este destino não suporta códigos máquina %lu alternativos" + +#: objcopy.c:3179 +msgid "treating that number as an absolute e_machine value instead" +msgstr "a tratar este número como valor absoluto e_machine" + +#: objcopy.c:3183 +msgid "ignoring the alternative value" +msgstr "a ignorar valor alternativo" + +#: objcopy.c:3215 objcopy.c:3268 +#, c-format +msgid "cannot create tempdir for archive copying (error: %s)" +msgstr "impossível criar tempdir para cópia do arquivo (erro: %s)" + +#: objcopy.c:3301 +msgid "Unable to recognise the format of file" +msgstr "Impossível reconhecer o formato do ficheiro" + +#: objcopy.c:3428 +#, c-format +msgid "error: the input file '%s' is empty" +msgstr "erro: o ficheiro de entrada \"%s\" está vazio" + +#: objcopy.c:3596 +#, c-format +msgid "Multiple renames of section %s" +msgstr "Múltiplas renomeações da secção %s" + +#: objcopy.c:3642 +msgid "error in private header data" +msgstr "erro nos dados do cabeçalho privado" + +#: objcopy.c:3720 +msgid "failed to create output section" +msgstr "falha ao criar secção de saída" + +#: objcopy.c:3735 +msgid "failed to set size" +msgstr "falha ao definir tamanho" + +#: objcopy.c:3754 +msgid "failed to set vma" +msgstr "falha ao definir vma" + +#: objcopy.c:3779 +msgid "failed to set alignment" +msgstr "falha ao definir alinhamento" + +#: objcopy.c:3811 +msgid "failed to copy private data" +msgstr "falha ao copiar dados privados" + +#: objcopy.c:3967 +msgid "relocation count is negative" +msgstr "total de relocalização é negativo" + +#. User must pad the section up in order to do this. +#: objcopy.c:4064 +#, c-format +msgid "cannot reverse bytes: length of section %s must be evenly divisible by %d" +msgstr "impossível reverter bytes: tamanho da secção %s tem de ser uniformemente divisível por %d" + +#: objcopy.c:4272 +msgid "can't create debugging section" +msgstr "impossível criar secção de depuração" + +#: objcopy.c:4285 +msgid "can't set debugging section contents" +msgstr "impossível definir conteúdo da secção de depuração" + +#: objcopy.c:4293 +#, c-format +msgid "don't know how to write debugging information for %s" +msgstr "não sei como escrever informação de depuração para %s" + +#: objcopy.c:4464 +msgid "could not create temporary file to hold stripped copy" +msgstr "impossível criar ficheiro temporário para manter cópia limpa" + +#: objcopy.c:4536 +#, c-format +msgid "%s: bad version in PE subsystem" +msgstr "%s: má versão em sub-sistema PE" + +#: objcopy.c:4566 +#, c-format +msgid "unknown PE subsystem: %s" +msgstr "Sub-sistema PE desconhecido: %s" + +#: objcopy.c:4620 objcopy.c:4882 objcopy.c:4962 objcopy.c:5103 objcopy.c:5135 +#: objcopy.c:5158 objcopy.c:5162 objcopy.c:5182 +#, c-format +msgid "bad format for %s" +msgstr "mau formato para %s" + +#: objcopy.c:4649 +#, c-format +msgid "cannot open: %s: %s" +msgstr "impossível abrir: %s: %s" + +#: objcopy.c:4700 +msgid "byte number must be non-negative" +msgstr "nº de byte tem de ser não-negativo" + +#: objcopy.c:4706 +#, c-format +msgid "architecture %s unknown" +msgstr "arquitectura %s desconhecida" + +#: objcopy.c:4714 +msgid "interleave must be positive" +msgstr "interleave tem de ser positivo" + +#: objcopy.c:4723 +msgid "interleave width must be positive" +msgstr "largura interleave tem de ser positiva" + +#: objcopy.c:5035 +#, c-format +msgid "unrecognized --compress-debug-sections type `%s'" +msgstr "tipo \"%s\" --compress-debug-sections não reconhecido" + +#: objcopy.c:5056 +#, c-format +msgid "unrecognized --elf-stt-common= option `%s'" +msgstr "opção \"%s\" --elf-stt-common=" + +#: objcopy.c:5072 +#, c-format +msgid "Warning: truncating gap-fill from 0x%s to 0x%x" +msgstr "Aviso: a truncar gap-fill de 0x%s a 0x%x" + +#: objcopy.c:5233 +#, c-format +msgid "unknown long section names option '%s'" +msgstr "opçao \"%s\" de nomes de secção longos desconhecida" + +#: objcopy.c:5251 +msgid "unable to parse alternative machine code" +msgstr "impossível analisar código máquina alternativo" + +#: objcopy.c:5300 +msgid "number of bytes to reverse must be positive and even" +msgstr "número de bytes a reverter tem de ser positivo e par" + +#: objcopy.c:5303 +#, c-format +msgid "Warning: ignoring previous --reverse-bytes value of %d" +msgstr "Aviso: a ignorar valor --reverse-bytes anterior de %d" + +#: objcopy.c:5318 +#, c-format +msgid "%s: invalid reserve value for --heap" +msgstr "%s: valor de reserva inválido para --heap" + +#: objcopy.c:5324 +#, c-format +msgid "%s: invalid commit value for --heap" +msgstr "%s: valor de commit inválido para --heap" + +#: objcopy.c:5349 +#, c-format +msgid "%s: invalid reserve value for --stack" +msgstr "%s: valor de reserva inválido para --stack" + +#: objcopy.c:5355 +#, c-format +msgid "%s: invalid commit value for --stack" +msgstr "%s: valor de commit inválido para --stack" + +#: objcopy.c:5384 +msgid "interleave start byte must be set with --byte" +msgstr "byte inicial de interleave tem de ser definido com --byte" + +#: objcopy.c:5387 +msgid "byte number must be less than interleave" +msgstr "número de byte tem de ser menor que interleave" + +#: objcopy.c:5390 +msgid "interleave width must be less than or equal to interleave - byte`" +msgstr "largura interleave tem de ser menor ou igual que interleave - byte`" + +#: objcopy.c:5419 +#, c-format +msgid "unknown input EFI target: %s" +msgstr "destino EFI de entrada desconhecido: %s" + +#: objcopy.c:5450 +#, c-format +msgid "unknown output EFI target: %s" +msgstr "destino EFI de saída desconhecido: %s" + +#: objcopy.c:5463 +#, c-format +msgid "warning: could not locate '%s'. System error message: %s" +msgstr "aviso: impossível localizar \"%s\". Mensagem de erro do sistema: %s" + +#: objcopy.c:5475 +#, c-format +msgid "warning: could not create temporary file whilst copying '%s', (error: %s)" +msgstr "aviso: impossível criar ficheiro temporário ao copiar \"%s\", (erro: %s)" + +#: objcopy.c:5508 objcopy.c:5522 +#, c-format +msgid "%s %s%c0x%s never used" +msgstr "%s %s%c0x%s nunca usado" + +#: objdump.c:200 +#, c-format +msgid "Usage: %s \n" +msgstr "Uso: %s \n" + +#: objdump.c:201 +#, c-format +msgid " Display information from object .\n" +msgstr "Mostrar informação do objecto .\n" + +#: objdump.c:202 +#, c-format +msgid " At least one of the following switches must be given:\n" +msgstr "Tem de indicar pelo menos uma das seguintes opções:\n" + +#: objdump.c:203 +#, c-format +msgid "" +" -a, --archive-headers Display archive header information\n" +" -f, --file-headers Display the contents of the overall file header\n" +" -p, --private-headers Display object format specific file header contents\n" +" -P, --private=OPT,OPT... Display object format specific contents\n" +" -h, --[section-]headers Display the contents of the section headers\n" +" -x, --all-headers Display the contents of all headers\n" +" -d, --disassemble Display assembler contents of executable sections\n" +" -D, --disassemble-all Display assembler contents of all sections\n" +" -S, --source Intermix source code with disassembly\n" +" -s, --full-contents Display the full contents of all sections requested\n" +" -g, --debugging Display debug information in object file\n" +" -e, --debugging-tags Display debug information using ctags style\n" +" -G, --stabs Display (in raw form) any STABS info in the file\n" +" -W[lLiaprmfFsoRtUuTgAckK] or\n" +" --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n" +" =frames-interp,=str,=loc,=Ranges,=pubtypes,\n" +" =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n" +" =addr,=cu_index,=links,=follow-links]\n" +" Display DWARF info in the file\n" +" -t, --syms Display the contents of the symbol table(s)\n" +" -T, --dynamic-syms Display the contents of the dynamic symbol table\n" +" -r, --reloc Display the relocation entries in the file\n" +" -R, --dynamic-reloc Display the dynamic relocation entries in the file\n" +" @ Read options from \n" +" -v, --version Display this program's version number\n" +" -i, --info List object formats and architectures supported\n" +" -H, --help Display this information\n" +msgstr "" +" -a, --archive-headers Mostra informação do cabeçalho do arquivo\n" +" -f, --file-headers Mostra o conteúdo do cabeçalho geral do arquivo\n" +" -p, --private-headers Mostra conteúdo do cabeçalho do ficheiro específico do formato do objecto\n" +" -P, --private=OPT,OPT... Mostra conteúdo específico do formato do objeto\n" +" -h, --[section-]headers Mostra conteúdo dos cabeçalhos de secção\n" +" -x, --all-headers Mostra conteúdo de todos os cabeçalhos\n" +" -d, --disassemble Mostra conteúdos assembler de secções executáveis\n" +" -D, --disassemble-all Mostra conteúdo assembler de todas as secções\n" +" -S, --source Mistura código fonte com desmontagem\n" +" -s, --full-contents Mostra conteúdo completo de todas as secções pedidas\n" +" -g, --debugging Mostra informação de depuração no ficheiro objecto\n" +" -e, --debugging-tags Mostra informação de depuração usando estilo ctags\n" +" -G, --stabs Mostra (em bruto) informação STABS no ficheiro\n" +" -W[lLiaprmfFsoRtUuTgAckK] ou\n" +" --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n" +" =frames-interp,=str,=loc,=Ranges,=pubtypes,\n" +" =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n" +" =addr,=cu_index,=links,=follow-links]\n" +" Mostra informação DWARF no ficheiro\n" +" -t, --syms Mostra o conteúdo das tabelas de símbolos\n" +" -T, --dynamic-syms Mostra o conteúdo da tabela de símbolos dinâmicos\n" +" -r, --reloc Mostra as entradas de relocalização no ficheiro\n" +" -R, --dynamic-reloc Mostra as entradas dinâmidcas de relocalização no ficheiro\n" +" @ Lê opções de \n" +" -v, --version Mostra a versão do programa\n" +" -i, --info Lista formatos de objectos e arquitecturas suportadas\n" +" -H, --help Mostra esta informação\n" + +#: objdump.c:236 +#, c-format +msgid "" +"\n" +" The following switches are optional:\n" +msgstr "" +"\n" +" As seguintes opções são opcionais:\n" + +#: objdump.c:237 +#, c-format +msgid "" +" -b, --target=BFDNAME Specify the target object format as BFDNAME\n" +" -m, --architecture=MACHINE Specify the target architecture as MACHINE\n" +" -j, --section=NAME Only display information for section NAME\n" +" -M, --disassembler-options=OPT Pass text OPT on to the disassembler\n" +" -EB --endian=big Assume big endian format when disassembling\n" +" -EL --endian=little Assume little endian format when disassembling\n" +" --file-start-context Include context from start of file (with -S)\n" +" -I, --include=DIR Add DIR to search list for source files\n" +" -l, --line-numbers Include line numbers and filenames in output\n" +" -F, --file-offsets Include file offsets when displaying information\n" +" -C, --demangle[=STYLE] Decode mangled/processed symbol names\n" +" The STYLE, if specified, can be `auto', `gnu',\n" +" `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n" +" or `gnat'\n" +" -w, --wide Format output for more than 80 columns\n" +" -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n" +" --start-address=ADDR Only process data whose address is >= ADDR\n" +" --stop-address=ADDR Only process data whose address is <= ADDR\n" +" --prefix-addresses Print complete address alongside disassembly\n" +" --[no-]show-raw-insn Display hex alongside symbolic disassembly\n" +" --insn-width=WIDTH Display WIDTH bytes on a single line for -d\n" +" --adjust-vma=OFFSET Add OFFSET to all displayed section addresses\n" +" --special-syms Include special symbols in symbol dumps\n" +" --inlines Print all inlines for source line (with -l)\n" +" --prefix=PREFIX Add PREFIX to absolute paths for -S\n" +" --prefix-strip=LEVEL Strip initial directory names for -S\n" +msgstr "" +" -b, --target=NOMEBFD Especifica o formato do objecto destino como NOMEBFD\n" +" -m, --architecture=MÁQUINA Especifica a arquitectura destino como MÁQUINA\n" +" -j, --section=NOME Mostra informação só para NOME\n" +" -M, --disassembler-options=OPT Passa texto OPT ao disassembler\n" +" -EB --endian=big Assume formato big endian ao desmontar\n" +" -EL --endian=little Assume formato little endian ao desmontar\n" +" --file-start-context Inclui contexto do início do ficheiro (com -S)\n" +" -I, --include=PASTA Adiciona PASTA à lista de procura de ficheiros fonte\n" +" -l, --line-numbers Inclui nºs de linha e nomes de ficheiro na saída\n" +" -F, --file-offsets Inclui desvios de ficheiro ao mostrar informação\n" +" -C, --demangle[=ESTILO] Descodifica nomes de símbolo embelezados/processados\n" +" O ESTILO, se especificado, pode ser `auto', `gnu',\n" +" `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n" +" ou `gnat'\n" +" -w, --wide Formata saída para mais de 80 colunas\n" +" -z, --disassemble-zeroes Não salta blocos de zeros ao desmontar\n" +" --start-address=ENDEREÇO Só processa dados cujo endereço seja >= ENDEREÇO\n" +" --stop-address=ENDEREÇO Só processa dados cujo endereço seja <= ENDEREÇO\n" +" --prefix-addresses Imprime o endereço completo ao lado da desmontagem\n" +" --[no-]show-raw-insn Mostra hex ao lado da desmontagem simbólica\n" +" --insn-width=LARGURA Mostra LARGURA bytes numa só linha para -d\n" +" --adjust-vma=DESVIO Adiciona DESVIO a todos os endereços de secção mostrados\n" +" --special-syms Inclui símbolos especiais em despejos de símbolos\n" +" --inlines Imprime todos os inlines para linha fonte (com -l)\n" +" --prefix=PREFIXO Adiciona PREFIXO a caminhos absolutos para -S\n" +" --prefix-strip=NÍVEL Remove nomes de pasta iniciais para -S\n" + +#: objdump.c:264 +#, c-format +msgid "" +" --dwarf-depth=N Do not display DIEs at depth N or greater\n" +" --dwarf-start=N Display DIEs starting with N, at the same depth\n" +" or deeper\n" +" --dwarf-check Make additional dwarf internal consistency checks. \n" +"\n" +msgstr "" +" --dwarf-depth=N Não mostra DIEs na profundidade N ou maior\n" +" --dwarf-start=N Mostra DIEs começando com N, à mesma profundidade\n" +" ou superior\n" +" --dwarf-check Faz testes adicionais de consistência interna dwarf. \n" +"\n" + +#: objdump.c:278 +#, c-format +msgid "" +"\n" +"Options supported for -P/--private switch:\n" +msgstr "" +"\n" +"Opções suportadas para -P/--private:\n" + +#: objdump.c:433 +#, c-format +msgid "section '%s' mentioned in a -j option, but not found in any input file" +msgstr "secção %s mencionada numa opção -j, mas não encontrada em nenhum ficheiro de entrada" + +#: objdump.c:584 +#, c-format +msgid "Sections:\n" +msgstr "Secções:\n" + +#: objdump.c:590 +#, c-format +msgid "Idx %-*s Size %-*s%-*sFile off Algn" +msgstr "Idx %-*s Tam. %-*s%-*sFile off Algn" + +#: objdump.c:596 +#, c-format +msgid " Flags" +msgstr ".. Bandeiras" + +#: objdump.c:618 +#, c-format +msgid "failed to read symbol table from: %s" +msgstr "falha ao ler tabela de símbolos de: %s" + +#: objdump.c:619 objdump.c:3453 +msgid "error message was" +msgstr "a mensagem de erro foi" + +#: objdump.c:643 +#, c-format +msgid "%s: not a dynamic object" +msgstr "%s: não é objecto dinâmico" + +#: objdump.c:1165 objdump.c:1189 +#, c-format +msgid " (File Offset: 0x%lx)" +msgstr " (desvio de ficheiro: 0x%lx)" + +#: objdump.c:1431 +#, c-format +msgid "source file %s is more recent than object file\n" +msgstr "ficheiro fonte %s é mais recente que o ficheiro objecto\n" + +#: objdump.c:1883 +#, c-format +msgid "disassemble_fn returned length %d" +msgstr "disassemble_fn devolveu tamanho %d" + +#: objdump.c:2189 objdump.c:3079 +#, c-format +msgid "Reading section %s failed because: %s" +msgstr "Falha ao ler secção %s porque: %s" + +#: objdump.c:2206 +#, c-format +msgid "" +"\n" +"Disassembly of section %s:\n" +msgstr "" +"\n" +"Desmontagem da secção %s:\n" + +#: objdump.c:2383 +#, c-format +msgid "can't use supplied machine %s" +msgstr "impossível usar máquina %s fornecida" + +#: objdump.c:2404 +#, c-format +msgid "can't disassemble for architecture %s\n" +msgstr "impossível desmontar para arquitectura %s\n" + +#: objdump.c:2489 objdump.c:2511 +#, c-format +msgid "" +"\n" +"Can't get contents for section '%s'.\n" +msgstr "" +"\n" +"Impossível obter conteúdos para secção \"%s\".\n" + +#: objdump.c:2695 +#, c-format +msgid "File %s does not contain any dwarf debug information\n" +msgstr "Ficheiro %s não contém informação de depuração dwarf\n" + +#: objdump.c:2758 +#, c-format +msgid "" +"No %s section present\n" +"\n" +msgstr "" +"Sem secção %s\n" +"\n" + +#: objdump.c:2764 +#, c-format +msgid "reading %s section of %s failed: %s" +msgstr "falha ao ler secção %s de %s: %s" + +#: objdump.c:2808 +#, c-format +msgid "" +"Contents of %s section:\n" +"\n" +msgstr "" +"Conteúdo da secção %s:\n" +"\n" + +#: objdump.c:2941 +#, c-format +msgid "architecture: %s, " +msgstr "arquitectura: %s, " + +#: objdump.c:2944 +#, c-format +msgid "flags 0x%08x:\n" +msgstr "bandeiras 0x%08x:\n" + +#: objdump.c:2957 +#, c-format +msgid "" +"\n" +"start address 0x" +msgstr "" +"\n" +"endereço inicial 0x" + +#: objdump.c:2983 +msgid "option -P/--private not supported by this file" +msgstr "opção -P/--private não suportada por este ficheiro" + +#: objdump.c:3007 +#, c-format +msgid "target specific dump '%s' not supported" +msgstr "despejo específico do destino \"%s\" não suportado" + +#: objdump.c:3071 +#, c-format +msgid "Contents of section %s:" +msgstr "Conteúdo da secção %s:" + +#: objdump.c:3073 +#, c-format +msgid " (Starting at file offset: 0x%lx)" +msgstr " (a começar no desvio de ficheiro: 0x%lx)" + +#: objdump.c:3183 +#, c-format +msgid "no symbols\n" +msgstr "sem símbolos\n" + +#: objdump.c:3190 +#, c-format +msgid "no information for symbol number %ld\n" +msgstr "sem informação para número de símbolo %ld\n" + +#: objdump.c:3193 +#, c-format +msgid "could not determine the type of symbol number %ld\n" +msgstr "impossível determinar o tipo de número de símbolo %ld\n" + +#: objdump.c:3452 +#, c-format +msgid "failed to read relocs in: %s" +msgstr "falha ao ler relocs em: %s" + +#: objdump.c:3552 +#, c-format +msgid "" +"\n" +"%s: file format %s\n" +msgstr "" +"\n" +"%s: formato de ficheiro %s\n" + +#: objdump.c:3614 +#, c-format +msgid "%s: printing debugging information failed" +msgstr "%s: falha ao imprimir informação de depuração" + +#: objdump.c:3705 +#, c-format +msgid "In archive %s:\n" +msgstr "No arquivo %s:\n" + +#. Prevent corrupted files from spinning us into an +#. infinite loop. 100 is an arbitrary heuristic. +#: objdump.c:3710 +msgid "Archive nesting is too deep" +msgstr "Aninhamento do arquivo muito profundo" + +#: objdump.c:3714 +#, c-format +msgid "In nested archive %s:\n" +msgstr "No arquivo aninhado %s:\n" + +#: objdump.c:3871 +msgid "error: the start address should be before the end address" +msgstr "erro: o endereço inicial deve estar antes do endereço final" + +#: objdump.c:3876 +msgid "error: the stop address should be after the start address" +msgstr "erro: o endereço de paragem deve estar antes do endereço de início" + +#: objdump.c:3888 +msgid "error: prefix strip must be non-negative" +msgstr "erro: limpeza de prefixo tem de ser não-negativa" + +#: objdump.c:3893 +msgid "error: instruction width must be positive" +msgstr "erro: largura da instrução tem de ser positiva" + +#: objdump.c:3905 +msgid "unrecognized -E option" +msgstr "opção -E não reconhecida" + +#: objdump.c:3916 +#, c-format +msgid "unrecognized --endian type `%s'" +msgstr "--endian type \"%s\" não reconhecido" + +#: od-macho.c:73 +#, c-format +msgid "" +"For Mach-O files:\n" +" header Display the file header\n" +" section Display the segments and sections commands\n" +" map Display the section map\n" +" load Display the load commands\n" +" dysymtab Display the dynamic symbol table\n" +" codesign Display code signature\n" +" seg_split_info Display segment split info\n" +" compact_unwind Display compact unwinding info\n" +" function_starts Display start address of functions\n" +" data_in_code Display data in code entries\n" +" twolevel_hints Display the two-level namespace lookup hints table\n" +" dyld_info Display dyld information\n" +msgstr "" +"For Mach-O files:\n" +" header Mostra o cabeçalho do ficheiro\n" +" section Mostra os segmentos e comandos de secção\n" +" map Mostra o mapa da secção\n" +" load Mostra os comando de carregamento\n" +" dysymtab Mostra a tabela de símbolo dinâmico\n" +" codesign Mostra a assinatura do cógigo\n" +" seg_split_info Mostra informação de divisão do segmento\n" +" compact_unwind Mostra informação compacta de desenrolamento\n" +" function_starts Mostra endereço inicial de funções\n" +" data_in_code Mostra dados em entradas de código\n" +" twolevel_hints Mostra a tabela de dicas de pesquisa de namespace de dois níveis\n" +" dyld_info Mostra informação dyld\n" + +#: od-macho.c:298 +msgid "Mach-O header:\n" +msgstr "cabveçalho Mach-0:\n" + +#: od-macho.c:299 +#, c-format +msgid " magic : %08lx\n" +msgstr " magia : %08lx\n" + +#: od-macho.c:300 +#, c-format +msgid " cputype : %08lx (%s)\n" +msgstr " tipocpu : %08lx (%s)\n" + +#: od-macho.c:302 +#, c-format +msgid " cpusubtype: %08lx\n" +msgstr " subtipocpu: %08lx\n" + +#: od-macho.c:303 +#, c-format +msgid " filetype : %08lx (%s)\n" +msgstr " tipofich : %08lx (%s)\n" + +#: od-macho.c:306 +#, c-format +msgid " ncmds : %08lx (%lu)\n" +msgstr " ncmds : %08lx (%lu)\n" + +#: od-macho.c:307 +#, c-format +msgid " sizeofcmds: %08lx (%lu)\n" +msgstr " tam.decmds: %08lx (%lu)\n" + +#: od-macho.c:308 +#, c-format +msgid " flags : %08lx (" +msgstr " bandeiras : %08lx (" + +#: od-macho.c:310 +msgid ")\n" +msgstr ")\n" + +#: od-macho.c:311 +#, c-format +msgid " reserved : %08x\n" +msgstr " reservado : %08x\n" + +#: od-macho.c:330 +msgid "Segments and Sections:\n" +msgstr "Segmentos e secções:\n" + +#: od-macho.c:331 +msgid " #: Segment name Section name Address\n" +msgstr " #: Nome segmento Nome secção Endereço\n" + +#: od-macho.c:973 +msgid "cannot read rebase dyld info" +msgstr "impossível ler informação rebase dyld" + +#: od-macho.c:978 +msgid "cannot read bind dyld info" +msgstr "impossível ler informação bind dyld" + +#: od-macho.c:983 +msgid "cannot read weak bind dyld info" +msgstr "impossível ler informação weak bind dyld" + +#: od-macho.c:988 +msgid "cannot read lazy bind dyld info" +msgstr "impossível ler informação lazy bind dyld" + +#: od-macho.c:993 +msgid "cannot read export symbols dyld info" +msgstr "impossível ler símbolos de exportação dyld" + +#: od-macho.c:1073 od-macho.c:1083 od-macho.c:1157 od-macho.c:1209 +#, c-format +msgid " [bad block length]\n" +msgstr " [mau tamanho de bloco\n" + +#: od-macho.c:1077 +#, c-format +msgid " %u index entry:\n" +msgid_plural " %u index entries:\n" +msgstr[0] " %u entrada de índice:\n" +msgstr[1] " %u entrada de índice:\n" + +#: od-macho.c:1093 +#, c-format +msgid " index entry %u: type: %08x, offset: %08x\n" +msgstr " entrada de índice %u: tipo: %08x, desvio: %08x\n" + +#: od-macho.c:1164 +#, c-format +msgid " version: %08x\n" +msgstr " versão: %08x\n" + +#: od-macho.c:1165 +#, c-format +msgid " flags: %08x\n" +msgstr " bandeiras: %08x\n" + +#: od-macho.c:1166 +#, c-format +msgid " hash offset: %08x\n" +msgstr " desvio hash: %08x\n" + +#: od-macho.c:1168 +#, c-format +msgid " ident offset: %08x (- %08x)\n" +msgstr " desvio ident: %08x (- %08x)\n" + +#: od-macho.c:1170 +#, c-format +msgid " identity: %s\n" +msgstr " identidade: %s\n" + +#: od-macho.c:1171 +#, c-format +msgid " nbr special slots: %08x (at offset %08x)\n" +msgstr " slots nbr especiais: %08x (no desvio %08x)\n" + +#: od-macho.c:1174 +#, c-format +msgid " nbr code slots: %08x\n" +msgstr " slots nbr de cód: %08x\n" + +#: od-macho.c:1175 +#, c-format +msgid " code limit: %08x\n" +msgstr " limite de código: %08x\n" + +#: od-macho.c:1176 +#, c-format +msgid " hash size: %02x\n" +msgstr " tamanho de hash: %02x\n" + +#: od-macho.c:1177 +#, c-format +msgid " hash type: %02x (%s)\n" +msgstr " tipo de hash: %02x (%s)\n" + +#: od-macho.c:1180 +#, c-format +msgid " spare1: %02x\n" +msgstr " spare1: %02x\n" + +#: od-macho.c:1181 +#, c-format +msgid " page size: %02x\n" +msgstr " tamanho de página:%02x\n" + +#: od-macho.c:1182 +#, c-format +msgid " spare2: %08x\n" +msgstr " spare2: %08x\n" + +#: od-macho.c:1184 +#, c-format +msgid " scatter offset: %08x\n" +msgstr " desvio dispersão: %08x\n" + +#: od-macho.c:1196 +#, c-format +msgid " [truncated block]\n" +msgstr " [bloco truncado]\n" + +#: od-macho.c:1204 +#, c-format +msgid " magic : %08x (%s)\n" +msgstr " magia: %08x (%s)\n" + +#: od-macho.c:1206 +#, c-format +msgid " length: %08x\n" +msgstr " tamanho: %08x\n" + +#: od-macho.c:1237 +msgid "cannot read code signature data" +msgstr "impossível ler dados da assinatura do código" + +#: od-macho.c:1265 +msgid "cannot read segment split info" +msgstr "impossível ler informação de divisão do segmento" + +#: od-macho.c:1271 +msgid "segment split info is not nul terminated" +msgstr "informação de divisão do segmento não termina em NUL" + +#: od-macho.c:1279 +#, c-format +msgid " 32 bit pointers:\n" +msgstr " ponteiros 32 bit:\n" + +#: od-macho.c:1282 +#, c-format +msgid " 64 bit pointers:\n" +msgstr " ponteiros 64 bit:\n" + +#: od-macho.c:1285 +#, c-format +msgid " PPC hi-16:\n" +msgstr " PPC hi-16:\n" + +#: od-macho.c:1288 +#, c-format +msgid " Unhandled location type %u\n" +msgstr " Tipo de localização %u não gerida\n" + +#: od-macho.c:1312 +msgid "cannot read function starts" +msgstr "impossível ler início da função" + +#: od-macho.c:1376 +msgid "cannot read data_in_code" +msgstr "impossível ler data_in_code" + +#: od-macho.c:1414 +msgid "cannot read twolevel hints" +msgstr "Impossível ler dicas twolevel" + +#: od-xcoff.c:77 +#, c-format +msgid "" +"For XCOFF files:\n" +" header Display the file header\n" +" aout Display the auxiliary header\n" +" sections Display the section headers\n" +" syms Display the symbols table\n" +" relocs Display the relocation entries\n" +" lineno Display the line number entries\n" +" loader Display loader section\n" +" except Display exception table\n" +" typchk Display type-check section\n" +" traceback Display traceback tags\n" +" toc Display toc symbols\n" +" ldinfo Display loader info in core files\n" +msgstr "" +"Pra ficheiros XCOFF:\n" +" header Mostra o cabeçalho do ficheiro\n" +" aout Mostra o cabeçalho auxiliar\n" +" sections Mostra os cabeçalhos de secção\n" +" syms Mostra a tabela de símbolos\n" +" relocs Mostra as entradas de relocalização\n" +" lineno Mostra as entradas de número de linha\n" +" loader Mostra a secção do carregador\n" +" except Mostra a tabela de excepções\n" +" typchk Mostra a secção type-check\n" +" traceback Mostra etiquetas traceback\n" +" toc Mostra símbolos toc\n" +" ldinfo Mostra informação do carregador em ficheiros núcleo\n" + +#: od-xcoff.c:419 +#, c-format +msgid " nbr sections: %d\n" +msgstr " secções nbr: %d\n" + +#: od-xcoff.c:420 +#, c-format +msgid " time and date: 0x%08x - " +msgstr " hora e data: 0x%08x - " + +#: od-xcoff.c:422 readelf.c:17081 +#, c-format +msgid "not set\n" +msgstr "não definido\n" + +#: od-xcoff.c:429 +#, c-format +msgid " symbols off: 0x%08x\n" +msgstr " símbolos desligados: 0x%08x\n" + +#: od-xcoff.c:430 +#, c-format +msgid " nbr symbols: %d\n" +msgstr " símbolos nbr: %d\n" + +#: od-xcoff.c:431 +#, c-format +msgid " opt hdr sz: %d\n" +msgstr " opt hdr sz: %d\n" + +#: od-xcoff.c:432 +#, c-format +msgid " flags: 0x%04x " +msgstr " bandeiras: 0x%04x " + +#: od-xcoff.c:446 +#, c-format +msgid "Auxiliary header:\n" +msgstr "Cabeçalho auxiliar:\n" + +#: od-xcoff.c:449 +#, c-format +msgid " No aux header\n" +msgstr " Sem cabeçalho auxiliar\n" + +#: od-xcoff.c:454 +#, c-format +msgid "warning: optional header size too large (> %d)\n" +msgstr "aviso: tamanho de cabeçalho opcional muito grande (> %d)\n" + +#: od-xcoff.c:460 +msgid "cannot read auxhdr" +msgstr "Impossível ler auxhdr" + +#: od-xcoff.c:525 +#, c-format +msgid "Section headers (at %u+%u=0x%08x to 0x%08x):\n" +msgstr "Cabeçalhos de secção (em %u+%u=0x%08x para 0x%08x):\n" + +#: od-xcoff.c:530 +#, c-format +msgid " No section header\n" +msgstr " Sem cabeçalho de secção\n" + +#: od-xcoff.c:535 od-xcoff.c:547 od-xcoff.c:602 +msgid "cannot read section header" +msgstr "Impossível ler cabeçalho de secção" + +#: od-xcoff.c:561 +#, c-format +msgid " Flags: %08x " +msgstr " Bandeiras: %08x " + +#: od-xcoff.c:569 +#, c-format +msgid "overflow - nreloc: %u, nlnno: %u\n" +msgstr "transporte - nreloc: %u, nlnno: %u\n" + +#: od-xcoff.c:590 od-xcoff.c:925 od-xcoff.c:981 +msgid "cannot read section headers" +msgstr "Impossível ler cabeçalhos de secção" + +#: od-xcoff.c:649 +msgid "cannot read strings table length" +msgstr "Impossível ler tamanho da tabela de cadeias" + +#: od-xcoff.c:665 +msgid "cannot read strings table" +msgstr "Impossível ler tabela de cadeias" + +#: od-xcoff.c:673 +msgid "cannot read symbol table" +msgstr "Impossível ler tabela de símbolo" + +#: od-xcoff.c:688 +msgid "cannot read symbol entry" +msgstr "Impossível ler entrada de símbolo" + +#: od-xcoff.c:723 +msgid "cannot read symbol aux entry" +msgstr "Impossível ler entrada auxiliar de símbolo" + +#: od-xcoff.c:745 +#, c-format +msgid "Symbols table (strtable at 0x%08x)" +msgstr "Tabela de símoblos (strtable em 0x%08x)" + +#: od-xcoff.c:750 +#, c-format +msgid "" +":\n" +" No symbols\n" +msgstr "" +":\n" +" Sem símbolos\n" + +#: od-xcoff.c:756 +#, c-format +msgid " (no strings):\n" +msgstr " (sem cadeias):\n" + +#: od-xcoff.c:758 +#, c-format +msgid " (strings size: %08x):\n" +msgstr " (tamanho das cadeias: %08x):\n" + +#. Translators: 'sc' is for storage class, 'off' for offset. +#: od-xcoff.c:772 +#, c-format +msgid " # sc value section type aux name/off\n" +msgstr " # sc valor secção tipo aux nome/desl\n" + +#. Section length, number of relocs and line number. +#: od-xcoff.c:824 +#, c-format +msgid " scnlen: %08x nreloc: %-6u nlinno: %-6u\n" +msgstr " scnlen: %08x nreloc: %-6u nlinno: %-6u\n" + +#. Section length and number of relocs. +#: od-xcoff.c:831 +#, c-format +msgid " scnlen: %08x nreloc: %-6u\n" +msgstr " scnlen: %08x nreloc: %-6u\n" + +#: od-xcoff.c:894 +#, c-format +msgid "offset: %08x" +msgstr "desvio: %08x" + +#: od-xcoff.c:937 +#, c-format +msgid "Relocations for %s (%u)\n" +msgstr "Relocalizações para %s (%u)\n" + +#: od-xcoff.c:940 +msgid "cannot read relocations" +msgstr "Impossível ler relocalizações" + +#: od-xcoff.c:953 +msgid "cannot read relocation entry" +msgstr "Impossível ler entrada de relocalização" + +#: od-xcoff.c:993 +#, c-format +msgid "Line numbers for %s (%u)\n" +msgstr "Números de linha para %s (%u)\n" + +#: od-xcoff.c:996 +msgid "cannot read line numbers" +msgstr "Impossível ler números de linha" + +#. Line number, symbol index and physical address. +#: od-xcoff.c:1000 +#, c-format +msgid "lineno symndx/paddr\n" +msgstr "lineno symndx/paddr\n" + +#: od-xcoff.c:1008 +msgid "cannot read line number entry" +msgstr "Impossível ler entrada de número de linha" + +#: od-xcoff.c:1051 +#, c-format +msgid "no .loader section in file\n" +msgstr "sem secção .loader no ficheiro\n" + +#: od-xcoff.c:1057 +#, c-format +msgid "section .loader is too short\n" +msgstr "secção .loader muito curta\n" + +#: od-xcoff.c:1064 +#, c-format +msgid "Loader header:\n" +msgstr "Cabeçalho de carregador:\n" + +#: od-xcoff.c:1066 +#, c-format +msgid " version: %u\n" +msgstr " versão: %u\n" + +#: od-xcoff.c:1069 +#, c-format +msgid " Unhandled version\n" +msgstr " Versão não gerida\n" + +#: od-xcoff.c:1074 +#, c-format +msgid " nbr symbols: %u\n" +msgstr " símbolos nbr: %u\n" + +#: od-xcoff.c:1076 +#, c-format +msgid " nbr relocs: %u\n" +msgstr " relocalizações nbr:%u\n" + +#. Import string table length. +#: od-xcoff.c:1078 +#, c-format +msgid " import strtab len: %u\n" +msgstr " tamanho strtab importada: %u\n" + +#: od-xcoff.c:1081 +#, c-format +msgid " nbr import files: %u\n" +msgstr " ficheiros importados nbr: %u\n" + +#: od-xcoff.c:1083 +#, c-format +msgid " import file off: %u\n" +msgstr " fich import desl: %u\n" + +#: od-xcoff.c:1085 +#, c-format +msgid " string table len: %u\n" +msgstr " tam. tab. cadeia: %u\n" + +#: od-xcoff.c:1087 +#, c-format +msgid " string table off: %u\n" +msgstr " Tab. cadeia desl: %u\n" + +#: od-xcoff.c:1090 +#, c-format +msgid "Dynamic symbols:\n" +msgstr "Símbolos dinâmicos:\n" + +#: od-xcoff.c:1097 +#, c-format +msgid " %4u %08x %3u " +msgstr " %4u %08x %3u " + +#: od-xcoff.c:1110 +#, c-format +msgid " %3u %3u " +msgstr " %3u %3u " + +#: od-xcoff.c:1119 +#, c-format +msgid "(bad offset: %u)" +msgstr "(mau desvio: %u)" + +#: od-xcoff.c:1126 +#, c-format +msgid "Dynamic relocs:\n" +msgstr "Relocalizações dinâmicas:\n" + +#: od-xcoff.c:1166 +#, c-format +msgid "Import files:\n" +msgstr "Ficheiros importados:\n" + +#: od-xcoff.c:1198 +#, c-format +msgid "no .except section in file\n" +msgstr "sem secção .except no ficheiro\n" + +#: od-xcoff.c:1206 +#, c-format +msgid "Exception table:\n" +msgstr "Tabela de excepções:\n" + +#: od-xcoff.c:1241 +#, c-format +msgid "no .typchk section in file\n" +msgstr "sem secção .typchk no ficheiro\n" + +#: od-xcoff.c:1248 +#, c-format +msgid "Type-check section:\n" +msgstr "Secção type-check:\n" + +#: od-xcoff.c:1295 +#, c-format +msgid " address beyond section size\n" +msgstr " endereço além do tamanho da secção\n" + +#: od-xcoff.c:1305 +#, c-format +msgid " tags at %08x\n" +msgstr " etiquetas em %08x\n" + +#: od-xcoff.c:1383 +#, c-format +msgid " number of CTL anchors: %u\n" +msgstr " nº de âncoras CTL: %u\n" + +#: od-xcoff.c:1402 +#, c-format +msgid " Name (len: %u): " +msgstr " Nome (tam.: %u): " + +#: od-xcoff.c:1405 +#, c-format +msgid "[truncated]\n" +msgstr "[truncado]\n" + +#: od-xcoff.c:1424 +#, c-format +msgid " (end of tags at %08x)\n" +msgstr " (fim de etiquetas em %08x)\n" + +#: od-xcoff.c:1427 +#, c-format +msgid " no tags found\n" +msgstr " sem etiquetas\n" + +#: od-xcoff.c:1431 +#, c-format +msgid " Truncated .text section\n" +msgstr "Secção .text truncada\n" + +#: od-xcoff.c:1516 +#, c-format +msgid "TOC:\n" +msgstr "TOC:\n" + +#: od-xcoff.c:1559 +#, c-format +msgid "Nbr entries: %-8u Size: %08x (%u)\n" +msgstr "entradas nbr: %-8u Tamanho: %08x (%u)\n" + +#: od-xcoff.c:1643 +msgid "cannot read header" +msgstr "Impossível ler cabeçalho" + +#: od-xcoff.c:1651 +#, c-format +msgid "File header:\n" +msgstr "Cabeçalho de ficheiro:\n" + +#: od-xcoff.c:1652 +#, c-format +msgid " magic: 0x%04x (0%04o) " +msgstr " magia: 0x%04x (0%04o) " + +#: od-xcoff.c:1656 +#, c-format +msgid "(WRMAGIC: writable text segments)" +msgstr "(WRMAGIC: segmentos de texto graváveis)" + +#: od-xcoff.c:1659 +#, c-format +msgid "(ROMAGIC: readonly sharablee text segments)" +msgstr "(ROMAGIC: segmentos de texto partilháveis só de leitura)" + +#: od-xcoff.c:1662 +#, c-format +msgid "(TOCMAGIC: readonly text segments and TOC)" +msgstr "(TOCMAGIC: segmentos de texto só de leitura e TOC)" + +#: od-xcoff.c:1665 +#, c-format +msgid "unknown magic" +msgstr "magia desconhecida" + +#: od-xcoff.c:1673 od-xcoff.c:1813 +#, c-format +msgid " Unhandled magic\n" +msgstr " Magia não gerida\n" + +#: od-xcoff.c:1737 +msgid "cannot read loader info table" +msgstr "impossível ler tabela de informação do carregador" + +#: od-xcoff.c:1769 +#, c-format +msgid "" +"\n" +"ldinfo dump not supported in 32 bits environments\n" +msgstr "" +"\n" +"despejo ldinfo não suportado em ambientes 32 bits\n" + +#: od-xcoff.c:1787 +msgid "cannot core read header" +msgstr "impossível ler núcleo do cabeçalho" + +#: od-xcoff.c:1794 +#, c-format +msgid "Core header:\n" +msgstr "Núcleo do cabeçalho:\n" + +#: od-xcoff.c:1795 +#, c-format +msgid " version: 0x%08x " +msgstr " versão: 0x%08x " + +#: od-xcoff.c:1799 +#, c-format +msgid "(dumpx format - aix4.3 / 32 bits)" +msgstr "(formato dumpx - aix4.3 / 32 bits)" + +#: od-xcoff.c:1802 +#, c-format +msgid "(dumpxx format - aix5.0 / 64 bits)" +msgstr "(formato dumpxx - aix5.0 / 64 bits)" + +#: od-xcoff.c:1805 +#, c-format +msgid "unknown format" +msgstr "formato desconhecido" + +#: rclex.c:196 +msgid "invalid value specified for pragma code_page.\n" +msgstr "valor inválido especificado para pragma code_page.\n" + +#: rdcoff.c:116 +#, c-format +msgid "Excessively large slot index: %lx" +msgstr "Índice de slot excessivamente grande: %lx" + +#: rdcoff.c:202 +#, c-format +msgid "parse_coff_type: Bad type code 0x%x" +msgstr "parse_coff_type: código de tipo errado 0x%x" + +#: rdcoff.c:410 rdcoff.c:515 rdcoff.c:703 +#, c-format +msgid "bfd_coff_get_syment failed: %s" +msgstr "falha em bfd_coff_get_syment: %s" + +#: rdcoff.c:426 rdcoff.c:723 +#, c-format +msgid "bfd_coff_get_auxent failed: %s" +msgstr "falha em bfd_coff_get_auxent: %s" + +#: rdcoff.c:790 +#, c-format +msgid "%ld: .bf without preceding function" +msgstr "%ld: .bf sem função precedente" + +#: rdcoff.c:840 +#, c-format +msgid "%ld: unexpected .ef\n" +msgstr "%ld: .ef inesperado\n" + +#: rddbg.c:87 +#, c-format +msgid "%s: no recognized debugging information" +msgstr "%s: sem informação de depuração reconhecida" + +#: rddbg.c:194 +#, c-format +msgid "%s: %s: stab entry %ld is corrupt, strx = 0x%x, type = %d\n" +msgstr "%s: %s: entrada stab %ld está corrompida, strx = 0x%x, tipo = %d\n" + +#: rddbg.c:218 +#, c-format +msgid "%s: %s: stab entry %ld is corrupt\n" +msgstr "%s: %s: entrada stab %ld está corrompida\n" + +#: rddbg.c:417 +#, c-format +msgid "Last stabs entries before error:\n" +msgstr "Últimas entradas stabs antes do erro:\n" + +#: readelf.c:304 +msgid "" +msgstr "" + +#: readelf.c:305 +msgid "" +msgstr "" + +#: readelf.c:382 +#, c-format +msgid "Size truncation prevents reading %s elements of size %s for %s\n" +msgstr "Truncamento de tamanho impede a leitura de %s elementos de tamanho %s para %s\n" + +#: readelf.c:392 +#, c-format +msgid "Size overflow prevents reading %s elements of size %s for %s\n" +msgstr "Transporte de tamanho impede a leitura de %s elementos de tamanho %s para %s\n" + +#: readelf.c:404 +#, c-format +msgid "Reading %s bytes extends past end of file for %s\n" +msgstr "Ler %s bytes ultrapassa o fim de ficheiro para %s\n" + +#: readelf.c:412 +#, c-format +msgid "Unable to seek to 0x%lx for %s\n" +msgstr "Impossível procurar para 0x%lx para %s\n" + +#: readelf.c:428 +#, c-format +msgid "Out of memory allocating %s bytes for %s\n" +msgstr "Sem memória ao alocar %s bytes para %s\n" + +#: readelf.c:439 +#, c-format +msgid "Unable to read in %s bytes of %s\n" +msgstr "impossível ler em %s bytes de %s\n" + +#: readelf.c:868 +msgid "Don't know about relocations on this machine architecture\n" +msgstr "Desconhecem-se relocalizações na arquitectura desta máquina\n" + +#: readelf.c:895 readelf.c:1000 +msgid "32-bit relocation data" +msgstr "dados de relocalização 32 bit" + +#: readelf.c:907 readelf.c:937 readelf.c:1011 readelf.c:1040 +msgid "out of memory parsing relocs\n" +msgstr "sem memória ao analisar relocalizações\n" + +#: readelf.c:925 readelf.c:1029 +msgid "64-bit relocation data" +msgstr "dados de relocalização 64 bit" + +#: readelf.c:1159 +#, c-format +msgid " Offset Info Type Sym. Value Symbol's Name + Addend\n" +msgstr " Desvio Info Tipo Valor sím. Nome símbolo + Adenda\n" + +#: readelf.c:1161 +#, c-format +msgid " Offset Info Type Sym.Value Sym. Name + Addend\n" +msgstr " Desvio Info Tipo Valor sím Nome sím. + Adenda\n" + +#: readelf.c:1166 +#, c-format +msgid " Offset Info Type Sym. Value Symbol's Name\n" +msgstr " Desvio Info Tipo Valor sím. Nome símbolo\n" + +#: readelf.c:1168 +#, c-format +msgid " Offset Info Type Sym.Value Sym. Name\n" +msgstr " Desvio Info Tipo Valor sím. Nome sím.\n" + +#: readelf.c:1176 +#, c-format +msgid " Offset Info Type Symbol's Value Symbol's Name + Addend\n" +msgstr " Desvio Info Tipo Valor símbolo Nome símbolo + Adenda\n" + +#: readelf.c:1178 +#, c-format +msgid " Offset Info Type Sym. Value Sym. Name + Addend\n" +msgstr " Desvio Info Tipo Valor sím. Nome sím. + Adenda\n" + +#: readelf.c:1183 +#, c-format +msgid " Offset Info Type Symbol's Value Symbol's Name\n" +msgstr " Desvio Info Tipo Valor símbolo Nome símbolo \n" + +#: readelf.c:1185 +#, c-format +msgid " Offset Info Type Sym. Value Sym. Name\n" +msgstr " Desvio Info Tipo Valor sím. Nome sím.\n" + +#: readelf.c:1555 readelf.c:1745 readelf.c:1753 +#, c-format +msgid "unrecognized: %-7lx" +msgstr "não reconhecido: %-7lx" + +#: readelf.c:1581 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:1590 +#, c-format +msgid " bad symbol index: %08lx in reloc" +msgstr " mau índice de símbolo: %08lx em reloc" + +#: readelf.c:1691 +#, c-format +msgid "" +msgstr "<índice de tabela de cadeia: %3ld>" + +#: readelf.c:1694 +#, c-format +msgid "" +msgstr "<índice de tabela de cadeia corrompido: %3ld>" + +#: readelf.c:2180 +#, c-format +msgid "Processor Specific: %lx" +msgstr "Específico do processador: %lx" + +#: readelf.c:2207 +#, c-format +msgid "Operating System specific: %lx" +msgstr "Específico do sistema operativo: %lx" + +#: readelf.c:2211 readelf.c:3947 +#, c-format +msgid ": %lx" +msgstr ": %lx" + +#: readelf.c:2224 +msgid "NONE (None)" +msgstr "NADA (nada)" + +#: readelf.c:2225 +msgid "REL (Relocatable file)" +msgstr "REL (ficheiro relocalizável)" + +#: readelf.c:2226 +msgid "EXEC (Executable file)" +msgstr "EXEC (ficheiro executável)" + +#: readelf.c:2227 +msgid "DYN (Shared object file)" +msgstr "DYN (ficheiro de objecto partilhado)" + +#: readelf.c:2228 +msgid "CORE (Core file)" +msgstr "CORE (ficheiro de núcleo)" + +#: readelf.c:2232 +#, c-format +msgid "Processor Specific: (%x)" +msgstr "Especifico do processador: (%x)" + +#: readelf.c:2234 +#, c-format +msgid "OS Specific: (%x)" +msgstr "Específico do OS: (%x)" + +#: readelf.c:2236 +#, c-format +msgid ": %x" +msgstr ": %x" + +#. Please keep this switch table sorted by increasing EM_ value. +#. 0 +#: readelf.c:2250 readelf.c:15426 readelf.c:15437 +msgid "None" +msgstr "Nada" + +#: readelf.c:2479 +#, c-format +msgid ": 0x%x" +msgstr ": 0x%x" + +#: readelf.c:2759 +msgid ", " +msgstr ", " + +#: readelf.c:3128 readelf.c:9543 +msgid "unknown" +msgstr "desconhecido" + +#: readelf.c:3129 +msgid "unknown mac" +msgstr "mac desconhecido" + +#: readelf.c:3197 +msgid ", " +msgstr ", " + +#: readelf.c:3207 +msgid "" +msgstr "" + +#: readelf.c:3218 +#, c-format +msgid ", unknown flags bits: %#x" +msgstr ", bandeiras bits desconhecidas: %#x" + +#: readelf.c:3227 +msgid ", relocatable" +msgstr ", relocakizáveis" + +#: readelf.c:3230 +msgid ", relocatable-lib" +msgstr ", biblioteca relocalizável" + +#: readelf.c:3312 +msgid ", unknown v850 architecture variant" +msgstr ", variante de arquitectura v850 desconhecida" + +#: readelf.c:3378 +msgid ", unknown CPU" +msgstr ", CPU desconhecido" + +#: readelf.c:3393 +msgid ", unknown ABI" +msgstr ", ABI desconhecido" + +#: readelf.c:3418 readelf.c:3474 +msgid ", unknown ISA" +msgstr ", ISA desconhecido" + +#: readelf.c:3584 +#, c-format +msgid "Unrecognised IA64 VMS Command Code: %x\n" +msgstr "Código de comando IA64 VMS não reconhecido: %x\n" + +#: readelf.c:3648 +msgid ": architecture variant: " +msgstr ": variante de arquitectura: " + +#: readelf.c:3667 +msgid ": unknown" +msgstr ": desconhecido" + +#: readelf.c:3671 +msgid ": unknown extra flag bits also present" +msgstr ": bits bandeira extra também presentes desconhecidos" + +#: readelf.c:3720 +msgid "Standalone App" +msgstr "Aplicação independente" + +#: readelf.c:3729 +msgid "Bare-metal C6000" +msgstr "Bare-metal C6000" + +#: readelf.c:3739 readelf.c:4644 readelf.c:4660 readelf.c:16757 +#: readelf.c:16797 +#, c-format +msgid "" +msgstr "<%x desconhecido>" + +#. This message is probably going to be displayed in a 15 +#. character wide field, so put the hex value first. +#: readelf.c:4274 +#, c-format +msgid "%08x: " +msgstr "%08x: " + +#: readelf.c:4332 +#, c-format +msgid "Usage: readelf elf-file(s)\n" +msgstr "Uso: readelf ficheiros elf\n" + +#: readelf.c:4333 +#, c-format +msgid " Display information about the contents of ELF format files\n" +msgstr "Mostra informação sobre o conteúdo de ficheiros de formato ELF\n" + +#: readelf.c:4334 +#, c-format +msgid "" +" Options are:\n" +" -a --all Equivalent to: -h -l -S -s -r -d -V -A -I\n" +" -h --file-header Display the ELF file header\n" +" -l --program-headers Display the program headers\n" +" --segments An alias for --program-headers\n" +" -S --section-headers Display the sections' header\n" +" --sections An alias for --section-headers\n" +" -g --section-groups Display the section groups\n" +" -t --section-details Display the section details\n" +" -e --headers Equivalent to: -h -l -S\n" +" -s --syms Display the symbol table\n" +" --symbols An alias for --syms\n" +" --dyn-syms Display the dynamic symbol table\n" +" -n --notes Display the core notes (if present)\n" +" -r --relocs Display the relocations (if present)\n" +" -u --unwind Display the unwind info (if present)\n" +" -d --dynamic Display the dynamic section (if present)\n" +" -V --version-info Display the version sections (if present)\n" +" -A --arch-specific Display architecture specific information (if any)\n" +" -c --archive-index Display the symbol/file index in an archive\n" +" -D --use-dynamic Use the dynamic section info when displaying symbols\n" +" -x --hex-dump=\n" +" Dump the contents of section as bytes\n" +" -p --string-dump=\n" +" Dump the contents of section as strings\n" +" -R --relocated-dump=\n" +" Dump the contents of section as relocated bytes\n" +" -z --decompress Decompress section before dumping it\n" +" -w[lLiaprmfFsoRtUuTgAckK] or\n" +" --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n" +" =frames-interp,=str,=loc,=Ranges,=pubtypes,\n" +" =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n" +" =addr,=cu_index,=links,=follow-links]\n" +" Display the contents of DWARF debug sections\n" +msgstr "" +" As opções são:\n" +" -a --all Equivalente a: -h -l -S -s -r -d -V -A -I\n" +" -h --file-header Mostra o cabeçalho do ficheiro ELF\n" +" -l --program-headers Mostra os cabeçalhos do programa\n" +" --segments Aliás para --program-headers\n" +" -S --section-headers Mostra o cabeçalho da secção\n" +" --sections Aliás para for --section-headers\n" +" -g --section-groups Mostra os grupos da secção\n" +" -t --section-details Mostra os detalhes da secção\n" +" -e --headers Equivalente a: -h -l -S\n" +" -s --syms Mostra a tabela de símbolos\n" +" --symbols Aliás para for --syms\n" +" --dyn-syms Mostra a tabela de símbolo dinâmico\n" +" -n --notes Mostra as notas de núcleo (se houver)\n" +" -r --relocs Mostra as relocalizações (se houver)\n" +" -u --unwind Mostra a informação unwind (se houver)\n" +" -d --dynamic Mostra a secção dinâmica (se houver)\n" +" -V --version-info Mostra as secções da versão (se houver)\n" +" -A --arch-specific Mostra informação específica da arquitectura (se houver)\n" +" -c --archive-index Mostra o índice de símbolo/ficheiro num arquivo\n" +" -D --use-dynamic Usa a informação na secção dinâmica ao mostrar símbolos\n" +" -x --hex-dump=\n" +" Despeja o conteúdo de da secção como bytes\n" +" -p --string-dump=\n" +" Despeja o conteúdo de da secção como strings\n" +" -R --relocated-dump=\n" +" Despeja o conteúdo de da secção como bytes relocalizados\n" +" -z --decompress Descomprime a secção antes de despejar\n" +" -w[lLiaprmfFsoRtUuTgAckK] ou\n" +" --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,\n" +" =frames-interp,=str,=loc,=Ranges,=pubtypes,\n" +" =gdb_index,=trace_info,=trace_abbrev,=trace_aranges,\n" +" =addr,=cu_index,=links,=follow-links]\n" +" Mostra o conteúdo de secções de depuração DWARF\n" + +#: readelf.c:4368 +#, c-format +msgid "" +" --dwarf-depth=N Do not display DIEs at depth N or greater\n" +" --dwarf-start=N Display DIEs starting with N, at the same depth\n" +" or deeper\n" +msgstr "" +" --dwarf-depth=N Não mostra DIEs à profundidade N ou maior\n" +" --dwarf-start=N Mostra DIEs começando em N, à mesma profundidade\n" +" ou superior\n" + +#: readelf.c:4373 +#, c-format +msgid "" +" -i --instruction-dump=\n" +" Disassemble the contents of section \n" +msgstr "" +" -i --instruction-dump=\n" +" Desmonta o conteúdo da secção \n" + +#: readelf.c:4377 +#, c-format +msgid "" +" -I --histogram Display histogram of bucket list lengths\n" +" -W --wide Allow output width to exceed 80 characters\n" +" @ Read options from \n" +" -H --help Display this information\n" +" -v --version Display the version number of readelf\n" +msgstr "" +" -I --histogram Mostra o histograma de tamanhos da lista\n" +" -W --wide Permite que a saída exceda 80 caracteres\n" +" @ Lê opções de \n" +" -H --help Mostra esta informação\n" +" -v --version Mostra a versão do readelf\n" + +#: readelf.c:4406 readelf.c:4437 readelf.c:4441 +msgid "Out of memory allocating dump request table.\n" +msgstr "Sem memória ao alocar tabela de despejo.\n" + +#: readelf.c:4618 +#, c-format +msgid "Invalid option '-%c'\n" +msgstr "Opção inválida \"-%c\"\n" + +#: readelf.c:4640 readelf.c:4656 readelf.c:10210 +msgid "none" +msgstr "nada" + +#: readelf.c:4657 +msgid "2's complement, little endian" +msgstr "complemento 2, little endian" + +#: readelf.c:4658 +msgid "2's complement, big endian" +msgstr "complemento 2, big endian" + +#: readelf.c:4678 +msgid "Not an ELF file - it has the wrong magic bytes at the start\n" +msgstr "Não é ficheiro ELF - tem os bytes mágicos errados no início\n" + +#: readelf.c:4688 +#, c-format +msgid "ELF Header:\n" +msgstr "Cabeçalho ELF:\n" + +#: readelf.c:4689 +#, c-format +msgid " Magic: " +msgstr " Magia: " + +#: readelf.c:4693 +#, c-format +msgid " Class: %s\n" +msgstr " Classe: %s\n" + +#: readelf.c:4695 +#, c-format +msgid " Data: %s\n" +msgstr " Dados: %s\n" + +#: readelf.c:4697 +#, c-format +msgid " Version: %d %s\n" +msgstr " Versão: %d %s\n" + +#: readelf.c:4702 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:4704 +#, c-format +msgid " OS/ABI: %s\n" +msgstr " OS/ABI: %s\n" + +#: readelf.c:4706 +#, c-format +msgid " ABI Version: %d\n" +msgstr " Versão ABI: %d\n" + +#: readelf.c:4708 +#, c-format +msgid " Type: %s\n" +msgstr " Tipo: %s\n" + +#: readelf.c:4710 +#, c-format +msgid " Machine: %s\n" +msgstr " Máquina: %s\n" + +#: readelf.c:4712 +#, c-format +msgid " Version: 0x%lx\n" +msgstr " Versão: 0x%lx\n" + +#: readelf.c:4715 +#, c-format +msgid " Entry point address: " +msgstr " Endereço do ponto de entrada: " + +#: readelf.c:4717 +#, c-format +msgid "" +"\n" +" Start of program headers: " +msgstr "" +"\n" +" Início dos cabeçalhos do programa: " + +#: readelf.c:4719 +#, c-format +msgid "" +" (bytes into file)\n" +" Start of section headers: " +msgstr "" +" (bytes no ficheiro)\n" +" Início dos cabeçalhos de secção: " + +#: readelf.c:4721 +#, c-format +msgid " (bytes into file)\n" +msgstr " (bytes no ficheiro)\n" + +#: readelf.c:4723 +#, c-format +msgid " Flags: 0x%lx%s\n" +msgstr " Bandeiras: 0x%lx%s\n" + +#: readelf.c:4726 +#, c-format +msgid " Size of this header: %ld (bytes)\n" +msgstr " Tamanho deste cabeçalho: %ld (bytes)\n" + +#: readelf.c:4728 +#, c-format +msgid " Size of program headers: %ld (bytes)\n" +msgstr " Tamanho dos cabeçalhos do programa:%ld (bytes)\n" + +#: readelf.c:4730 +#, c-format +msgid " Number of program headers: %ld" +msgstr " Nº de cabeçalhos do programa: %ld" + +#: readelf.c:4737 +#, c-format +msgid " Size of section headers: %ld (bytes)\n" +msgstr " Tamanho dos cabeçalhos de secção: %ld (bytes)\n" + +#: readelf.c:4739 +#, c-format +msgid " Number of section headers: %ld" +msgstr " Nº dos cabeçalhos de secção: %ld" + +#: readelf.c:4744 +#, c-format +msgid " Section header string table index: %ld" +msgstr " Índice de tabela de cadeias da secção: %ld" + +#: readelf.c:4751 +#, c-format +msgid " " +msgstr " " + +#: readelf.c:4791 readelf.c:4838 +msgid "The e_phentsize field in the ELF header is less than the size of an ELF program header\n" +msgstr "O campo e_phentsize no cabeçalho ELF é menor que o tamanho de um cabeçalho de programa ELF\n" + +#: readelf.c:4795 readelf.c:4842 +msgid "The e_phentsize field in the ELF header is larger than the size of an ELF program header\n" +msgstr "O campo e_phentsize no cabeçalho ELF é maior que o tamanho de um cabeçalho de programa ELF\n" + +#: readelf.c:4798 readelf.c:4845 +msgid "program headers" +msgstr "cabeçalhos do programa" + +#: readelf.c:4884 +#, c-format +msgid "Too many program headers - %#x - the file is not that big\n" +msgstr "Muitos cabeçalhos do programa - %#x - o ficheiro não é assim tão grande\n" + +#: readelf.c:4893 +#, c-format +msgid "Out of memory reading %u program headers\n" +msgstr "Sem memória ao ler %u cabeçalhos do programa\n" + +#: readelf.c:4924 +msgid "possibly corrupt ELF header - it has a non-zero program header offset, but no program headers\n" +msgstr "cabeçalho ELF possivelmente corrupto - tem desvio não-zero no cabeçalho do programa sem cabeçalhos do programa\n" + +#: readelf.c:4929 +#, c-format +msgid "" +"\n" +"There are no program headers in this file.\n" +msgstr "" +"\n" +"Não há cabeçalhos do programa nest ficheiro.\n" + +#: readelf.c:4935 +#, c-format +msgid "" +"\n" +"Elf file type is %s\n" +msgstr "" +"\n" +"Tipo de ficheiro Elf é %s\n" + +#: readelf.c:4936 +#, c-format +msgid "Entry point 0x%s\n" +msgstr "Ponto de entrada 0x%s\n" + +#: readelf.c:4937 +#, c-format +msgid "There is %d program header, starting at offset %s\n" +msgid_plural "There are %d program headers, starting at offset %s\n" +msgstr[0] "Há %d cabeçalho do programa, começando no desvio %s\n" +msgstr[1] "Há %d cabeçalhos do programa, começando no desvio %s\n" + +#: readelf.c:4950 readelf.c:4952 +#, c-format +msgid "" +"\n" +"Program Headers:\n" +msgstr "" +"\n" +"Cabeçalhos do programa:\n" + +#: readelf.c:4956 +#, c-format +msgid " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" +msgstr " Tipo Desvio EndVirtl EndFís TamFich TamMem Bdr Alinh\n" + +#: readelf.c:4959 +#, c-format +msgid " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" +msgstr " Tipo Desvio EndVirtl EndFís TamFich TamMem Bdr Alinh\n" + +#: readelf.c:4963 +#, c-format +msgid " Type Offset VirtAddr PhysAddr\n" +msgstr " Tipo Desvio EndVirtl EndFís \n" + +#: readelf.c:4965 +#, c-format +msgid " FileSiz MemSiz Flags Align\n" +msgstr " TamFich TamMem Bndrs Alinh\n" + +#: readelf.c:5064 +msgid "LOAD segments must be sorted in order of increasing VirtAddr\n" +msgstr "segmentos LOAD têm de estar ordenados por EndVirtl crescente\n" + +#: readelf.c:5067 +msgid "the segment's file size is larger than its memory size\n" +msgstr "o tamanho de ficheiro do segmento é maior que o seu tamanho da memória\n" + +#: readelf.c:5074 +msgid "the PHDR segment must occur before any LOAD segment\n" +msgstr "o segmento PHDR tem de ocorrer antes de qualquer segmento LOAD\n" + +#: readelf.c:5086 +msgid "the PHDR segment is not covered by a LOAD segment\n" +msgstr "o segmento PHDR não é coberto por um segmento LOAD\n" + +#: readelf.c:5092 +msgid "more than one dynamic segment\n" +msgstr "mais de um segmento dinâmico\n" + +#: readelf.c:5111 +msgid "no .dynamic section in the dynamic segment\n" +msgstr "sem secção .dynamyc no segmento dinâmico\n" + +#: readelf.c:5126 +msgid "the .dynamic section is not contained within the dynamic segment\n" +msgstr "a secção .dynamic não está contida dentro do segmento dinâmico\n" + +#: readelf.c:5129 +msgid "the .dynamic section is not the first section in the dynamic segment.\n" +msgstr "a secção .dynamyc não é a primeira secção no segmento dinâmico.\n" + +#: readelf.c:5139 +msgid "the dynamic segment offset + size exceeds the size of the file\n" +msgstr "o desvio+tamanho do segmento dinâmico excede o tamanho do ficheiro\n" + +#: readelf.c:5147 +msgid "Unable to find program interpreter name\n" +msgstr "Impossível encontrar nome do interpretador do programa\n" + +#: readelf.c:5154 +msgid "Internal error: failed to create format string to display program interpreter\n" +msgstr "Erro interno: falha ao criar cadeia de formato para mostrar o interpretador do programa\n" + +#: readelf.c:5158 +msgid "Unable to read program interpreter name\n" +msgstr "Impossível ler nome do interpretador do programa\n" + +#: readelf.c:5161 +#, c-format +msgid " [Requesting program interpreter: %s]\n" +msgstr " [A pedir interpretador do programa: %s]\n" + +#: readelf.c:5172 +#, c-format +msgid "" +"\n" +" Section to Segment mapping:\n" +msgstr "" +"\n" +" Secção para mapa do segmento:\n" + +#: readelf.c:5173 +#, c-format +msgid " Segment Sections...\n" +msgstr " Secções do segmento...\n" + +#: readelf.c:5209 +msgid "Cannot interpret virtual addresses without program headers.\n" +msgstr "Impossível interpretar endereços virtuais sem cabeçalhos de programa.\n" + +#: readelf.c:5225 +#, c-format +msgid "Virtual address 0x%lx not located in any PT_LOAD segment.\n" +msgstr "Endereço virtual 0x%lx não localizado em nenhum segmento PT_LOAD.\n" + +#: readelf.c:5250 readelf.c:5314 +msgid "The e_shentsize field in the ELF header is less than the size of an ELF section header\n" +msgstr "O campo e_shentsize no cabeçalho ELF é menor que o tamanho dum cabeçalho de secção ELF\n" + +#: readelf.c:5254 readelf.c:5319 +msgid "The e_shentsize field in the ELF header is larger than the size of an ELF section header\n" +msgstr "O campo e_shentsize no cabeçalho ELF é maior que o tamanho dum cabeçalho de secção ELF\n" + +#: readelf.c:5258 readelf.c:5324 +msgid "section headers" +msgstr "cabeçalhos de secção" + +#: readelf.c:5268 readelf.c:5334 +#, c-format +msgid "Out of memory reading %u section headers\n" +msgstr "Sem memória ao ler %u cabeçalhos de secção\n" + +#: readelf.c:5287 readelf.c:5353 +#, c-format +msgid "Section %u has an out of range sh_link value of %u\n" +msgstr "Secção %u tem um valor sh_link %u fora do intervalo\n" + +#: readelf.c:5289 readelf.c:5355 +#, c-format +msgid "Section %u has an out of range sh_info value of %u\n" +msgstr "Secção %u tem um valor sh_info %u fora do intervalo\n" + +#: readelf.c:5384 readelf.c:5497 +#, c-format +msgid "Section %s has an invalid sh_entsize of 0x%lx\n" +msgstr "Secção %s tem um sh_entsize inválido de 0x%lx\n" + +#: readelf.c:5392 readelf.c:5505 +#, c-format +msgid "Section %s has an invalid sh_size of 0x%lx\n" +msgstr "Secção %s tem um sh_size inválido de 0x%lx\n" + +#: readelf.c:5402 readelf.c:5515 +#, c-format +msgid "Size (0x%lx) of section %s is not a multiple of its sh_entsize (0x%lx)\n" +msgstr "Tamanho (0x%lx) da secção %s não é múltiplo do seu sh_entsize (0x%lx)\n" + +#: readelf.c:5410 readelf.c:5523 +msgid "symbols" +msgstr "símbolos" + +#: readelf.c:5424 readelf.c:5537 +msgid "symbol table section indicies" +msgstr "Índices da secção da tabela de símbolos" + +#: readelf.c:5430 readelf.c:5543 +#, c-format +msgid "Index section %s has an sh_size of 0x%lx - expected 0x%lx\n" +msgstr "Secção índice %s tem um tamanho 0x%lx - esperado 0x%lx\n" + +#: readelf.c:5443 readelf.c:5556 +#, c-format +msgid "Out of memory reading %lu symbols\n" +msgstr "Sem memória ao ler %lu símbolos\n" + +#: readelf.c:5737 readelf.c:5812 readelf.c:5830 readelf.c:5848 +msgid "Internal error: not enough buffer room for section flag info" +msgstr "Erro interno: sem espaço no buffer para informação da bandeira de secção" + +#: readelf.c:5855 +#, c-format +msgid "UNKNOWN (%*.*lx)" +msgstr "DESCONHECIDO (%*.*lx)" + +#: readelf.c:5874 readelf.c:5889 +msgid "Compressed section is too small even for a compression header\n" +msgstr "Secção comprimida muito pequena mesmo para um cabeçalho de compressão\n" + +#: readelf.c:5913 +msgid "possibly corrupt ELF file header - it has a non-zero section header offset, but no section headers\n" +msgstr "cabeçalho de ficheiro ELF possivelmente corrupto - tem desvio de cabeçalho de secção não-zero sem cabeçalhos de secção\n" + +#: readelf.c:5918 +#, c-format +msgid "" +"\n" +"There are no sections in this file.\n" +msgstr "" +"\n" +"Não há secções neste ficheiro.\n" + +#: readelf.c:5924 +#, c-format +msgid "There is %d section header, starting at offset 0x%lx:\n" +msgid_plural "There are %d section headers, starting at offset 0x%lx:\n" +msgstr[0] "Há %d cabeçalho de secção, começando no desvio 0x%lx:\n" +msgstr[1] "Há %d cabeçalhos de secção, começando no desvio 0x%lx:\n" + +#: readelf.c:5953 readelf.c:6728 readelf.c:7174 readelf.c:7583 readelf.c:8026 +#: readelf.c:9130 readelf.c:11631 readelf.c:13597 readelf.c:17458 +msgid "string table" +msgstr "tabela de cadeia" + +#. Note: coded this way so that there is a single string for translation. +#: readelf.c:6024 +#, c-format +msgid "Section %d has invalid sh_entsize of %s\n" +msgstr "Secção %d tem um sh_entsize inválido de %s\n" + +#: readelf.c:6025 +#, c-format +msgid "(Using the expected size of %u for the rest of this dump)\n" +msgstr "(a usar o tamanho esperado de %u para o resto do despejo)\n" + +#: readelf.c:6046 +msgid "File contains multiple dynamic symbol tables\n" +msgstr "O ficheiro contém múltiplas tabelas de símbolo dinâmico\n" + +#: readelf.c:6058 +msgid "File contains multiple dynamic string tables\n" +msgstr "O ficheiro contém múltiplas tabelas de cadeia dinâmica\n" + +#: readelf.c:6064 +msgid "dynamic strings" +msgstr "cadeias dinâmicas" + +#: readelf.c:6154 +#, c-format +msgid "" +"\n" +"Section Headers:\n" +msgstr "" +"\n" +"Cabeçalhos de secção:\n" + +#: readelf.c:6156 +#, c-format +msgid "" +"\n" +"Section Header:\n" +msgstr "" +"\n" +"Cabeçalho de secção:\n" + +#: readelf.c:6162 readelf.c:6173 readelf.c:6184 +#, c-format +msgid " [Nr] Name\n" +msgstr " [Nr] Nome\n" + +#: readelf.c:6163 +#, c-format +msgid " Type Addr Off Size ES Lk Inf Al\n" +msgstr " Tipo End. Dev Tam. ES Lg Inf Al\n" + +#: readelf.c:6167 +#, c-format +msgid " [Nr] Name Type Addr Off Size ES Flg Lk Inf Al\n" +msgstr " [Nr] Nome Tipo End. Des Tam. ES Bdr Lg Inf Al\n" + +#: readelf.c:6174 +#, c-format +msgid " Type Address Off Size ES Lk Inf Al\n" +msgstr " Tipo Endereço Des Tam. ES Lg Inf Al\n" + +#: readelf.c:6178 +#, c-format +msgid " [Nr] Name Type Address Off Size ES Flg Lk Inf Al\n" +msgstr " [Nr] Nome Tipo Endereço Des Tam. ES Bdr Lg Inf Al\n" + +#: readelf.c:6185 +#, c-format +msgid " Type Address Offset Link\n" +msgstr " Tipo Endereço Desvio Lig.\n" + +#: readelf.c:6186 +#, c-format +msgid " Size EntSize Info Align\n" +msgstr " Tam. Tam.Ent Info Alinh\n" + +#: readelf.c:6190 +#, c-format +msgid " [Nr] Name Type Address Offset\n" +msgstr " [Nr] Nome Tipo Endereço Desvio\n" + +#: readelf.c:6191 +#, c-format +msgid " Size EntSize Flags Link Info Align\n" +msgstr " Tam. Tam.Ent Bands Lig. Info Alinh\n" + +#: readelf.c:6196 +#, c-format +msgid " Flags\n" +msgstr " Bandeiras\n" + +#: readelf.c:6218 +#, c-format +msgid "[%2u]: Link field (%u) should index a symtab section.\n" +msgstr "[%2u]: campo de ligação (%u) devia indexar uma secção symtab.\n" + +#: readelf.c:6231 +#, c-format +msgid "[%2u]: Link field (%u) should index a string section.\n" +msgstr "[%2u]: campo de ligação (%u) devia indexar uma secção de cadeia.\n" + +#: readelf.c:6239 readelf.c:6250 +#, c-format +msgid "[%2u]: Unexpected value (%u) in link field.\n" +msgstr "[%2u]: valor inesperado (%u) num campo de ligação.\n" + +#: readelf.c:6281 +#, c-format +msgid "[%2u]: Info field (%u) should index a relocatable section.\n" +msgstr "[%2u]: campo de informação (%u) devia indexar uma secção relocalizável.\n" + +#: readelf.c:6293 readelf.c:6320 +#, c-format +msgid "[%2u]: Unexpected value (%u) in info field.\n" +msgstr "[%2u]: valor inesperado (%u) em campo de informação.\n" + +#: readelf.c:6315 +#, c-format +msgid "[%2u]: Expected link to another section in info field" +msgstr "[%2u]: esperada ligação a outra secção no campo de informação" + +#: readelf.c:6330 +#, c-format +msgid "Size of section %u is larger than the entire file!\n" +msgstr "Tamanho da secção %u maior que o ficheiro completo!\n" + +#: readelf.c:6399 +#, c-format +msgid "section %u: sh_link value of %u is larger than the number of sections\n" +msgstr "secção %u: valor sh_link de %u é maior que o número de secções\n" + +#: readelf.c:6501 +msgid "compression header" +msgstr "cabeçalho de compressão" + +#: readelf.c:6510 +#, c-format +msgid " [: 0x%x], " +msgstr " [: 0x%x], " + +#. The ordering of the letters shown here matches the ordering of the +#. corresponding SHF_xxx values, and hence the order in which these +#. letters will be displayed to the user. +#: readelf.c:6524 +#, c-format +msgid "" +"Key to Flags:\n" +" W (write), A (alloc), X (execute), M (merge), S (strings), I (info),\n" +" L (link order), O (extra OS processing required), G (group), T (TLS),\n" +" C (compressed), x (unknown), o (OS specific), E (exclude),\n" +" " +msgstr "" +"Tecla para bandeiras:\n" +" W (write), A (alloc), X (execute), M (merge), S (strings), I (info),\n" +" L (link order), O (extra OS processing required), G (group), T (TLS),\n" +" C (compressed), x (unknown), o (OS specific), E (exclude),\n" +" " + +#: readelf.c:6531 +#, c-format +msgid "l (large), " +msgstr "l (large), " + +#: readelf.c:6533 +#, c-format +msgid "y (purecode), " +msgstr "y (purecode), " + +#: readelf.c:6535 +#, c-format +msgid "v (VLE), " +msgstr "v (VLE), " + +#: readelf.c:6552 +#, c-format +msgid "[0x%x: " +msgstr "[0x%x: " + +#: readelf.c:6594 +#, c-format +msgid "" +"\n" +"There are no sections to group in this file.\n" +msgstr "" +"\n" +"Não há secções para agrupar neste ficheiro.\n" + +#: readelf.c:6601 +msgid "Section headers are not available!\n" +msgstr "Cabeçalhos de secção indisponíveis!\n" + +#: readelf.c:6611 +#, c-format +msgid "Out of memory reading %u section group headers\n" +msgstr "Sem memória ao ler %u cabeçalhos de grupo de secção\n" + +#: readelf.c:6627 +#, c-format +msgid "" +"\n" +"There are no section groups in this file.\n" +msgstr "" +"\n" +"Não há grupos de secção neste ficheiro.\n" + +#: readelf.c:6636 +#, c-format +msgid "Out of memory reading %lu groups\n" +msgstr "Sem memória ao ler %lu grupos\n" + +#: readelf.c:6666 +#, c-format +msgid "Bad sh_link in group section `%s'\n" +msgstr "Mau sh_link na secção de grupo \"%s\"\n" + +#: readelf.c:6680 +#, c-format +msgid "Corrupt header in group section `%s'\n" +msgstr "Cabeçalho corrupto na secção de grupo \"%s\"\n" + +#: readelf.c:6686 readelf.c:6697 +#, c-format +msgid "Bad sh_info in group section `%s'\n" +msgstr "Mau sh_info na secção de grupo \"%s\"\n" + +#: readelf.c:6738 +#, c-format +msgid "Section %s has sh_entsize (0x%lx) which is larger than its size (0x%lx)\n" +msgstr "Secção %s tem sh_entsize (0x%lx) que é maior que o seu tamanho (0x%lx)\n" + +#: readelf.c:6747 +msgid "section data" +msgstr "dados de secção" + +#: readelf.c:6758 +#, c-format +msgid "" +"\n" +"%sgroup section [%5u] `%s' [%s] contains %u sections:\n" +msgstr "" +"\n" +"%ssecção de grupo [%5u] \"%s\" [%s] contém %u secções:\n" + +#: readelf.c:6761 +#, c-format +msgid " [Index] Name\n" +msgstr " [Índice] Nome\n" + +#: readelf.c:6779 +#, c-format +msgid "section [%5u] in group section [%5u] > maximum section [%5u]\n" +msgstr "secção [%5u] na secção de grupo [%5u] > secção máxima [%5u]\n" + +#: readelf.c:6782 +msgid "Further error messages about overlarge group section indicies suppressed\n" +msgstr "Mais mensagens de erro sobre índices de secção de grupos excessivamente grandes suprimidas\n" + +#: readelf.c:6795 +#, c-format +msgid "section [%5u] in group section [%5u] already in group section [%5u]\n" +msgstr "secção [%5u] na secção de grupo [%5u] já está na secção de grupo [%5u]\n" + +#: readelf.c:6799 +msgid "Further error messages about already contained group sections suppressed\n" +msgstr "Mais mensagens de erro sobre secções de grupos já contidas suprimidas\n" + +#: readelf.c:6811 +#, c-format +msgid "section 0 in group section [%5u]\n" +msgstr "secção 0 na secção de grupo [%5u]\n" + +#: readelf.c:6880 +msgid "dynamic section image fixups" +msgstr "arranjos de imagem de secção dinâmica" + +#: readelf.c:6888 +#, c-format +msgid "corrupt library name index of 0x%lx found in dynamic entry" +msgstr "Índice de 0x%lx de nome de biblioteca corrupto encontrado em entrada dinâmica" + +#: readelf.c:6892 +#, c-format +msgid "" +"\n" +"Image fixups for needed library #%d: %s - ident: %lx\n" +msgstr "" +"\n" +"Arranjos de imagem para biblioteca necessária #%d: %s - ident: %lx\n" + +#: readelf.c:6895 +#, c-format +msgid "Seg Offset Type SymVec DataType\n" +msgstr "Seg Desvio Tipo VecSím TipoDados\n" + +#: readelf.c:6928 +msgid "dynamic section image relocations" +msgstr "relocalizações de imagem de secção dinâmica" + +#: readelf.c:6932 +#, c-format +msgid "" +"\n" +"Image relocs\n" +msgstr "" +"\n" +"Relocs de imagem\n" + +#: readelf.c:6934 +#, c-format +msgid "Seg Offset Type Addend Seg Sym Off\n" +msgstr "Seg Desvio Tipo Adenda Seg Sím Off\n" + +#: readelf.c:6990 +msgid "dynamic string section" +msgstr "secção de cadeia dinâmica" + +#: readelf.c:7091 +#, c-format +msgid "" +"\n" +"'%s' relocation section at offset 0x%lx contains %ld bytes:\n" +msgstr "" +"\n" +"secção de relocalização \"%s\" no desvio 0x%lx contém %ld bytes:\n" + +#: readelf.c:7108 +#, c-format +msgid "" +"\n" +"There are no dynamic relocations in this file.\n" +msgstr "" +"\n" +"Não há relocalizações dinâmicas neste ficheiro.\n" + +#: readelf.c:7133 +#, c-format +msgid "" +"\n" +"Relocation section " +msgstr "" +"\n" +"Secção de relocalização." + +#: readelf.c:7141 +#, c-format +msgid " at offset 0x%lx contains %lu entry:\n" +msgid_plural " at offset 0x%lx contains %lu entries:\n" +msgstr[0] " no desvio 0x%lx contém %lu entrada:\n" +msgstr[1] " no desvio 0x%lx contém %lu entradas:\n" + +#: readelf.c:7202 +#, c-format +msgid "" +"\n" +"There are no static relocations in this file." +msgstr "" +"\n" +"Não há relocalizações estáticas neste ficheiro." + +#: readelf.c:7203 +#, c-format +msgid "" +"\n" +"To see the dynamic relocations add --use-dynamic to the command line.\n" +msgstr "" +"\n" +"Para ver relocalizações dinâmicas adicione --use-dynamic à linha de comandos.\n" + +#: readelf.c:7209 +#, c-format +msgid "" +"\n" +"There are no relocations in this file.\n" +msgstr "" +"\n" +"Não há relocalizações neste ficheiro.\n" + +#: readelf.c:7379 +#, c-format +msgid "Invalid offset %lx in table entry %ld\n" +msgstr "Desvio inválido %lx na entrada de tabela %ld\n" + +#: readelf.c:7397 +#, c-format +msgid "\tUnknown version.\n" +msgstr "\tVersão desconhecida.\n" + +#: readelf.c:7460 readelf.c:7884 +msgid "unwind table" +msgstr "desenrolar tabela" + +#: readelf.c:7510 +#, c-format +msgid "Skipping unknown relocation type: %u\n" +msgstr "A saltar tipo de relocalização desconhecido: %u\n" + +#: readelf.c:7517 +#, c-format +msgid "Skipping unexpected relocation type: %s\n" +msgstr "A saltar tipo de relocalização inesperado: %s\n" + +#: readelf.c:7526 +#, c-format +msgid "Skipping reloc with overlarge offset: %lx\n" +msgstr "A saltar relocalização com desvio extra-grande: %lx\n" + +#: readelf.c:7577 readelf.c:8020 +msgid "Multiple auxillary string tables encountered\n" +msgstr "Encontradas múltiplas tabelas de cadeias auxiliares\n" + +#: readelf.c:7591 readelf.c:8034 readelf.c:9138 +#, c-format +msgid "" +"\n" +"There are no unwind sections in this file.\n" +msgstr "" +"\n" +"Não secções a desenrolar neste ficheiro.\n" + +#: readelf.c:7665 +#, c-format +msgid "" +"\n" +"Could not find unwind info section for " +msgstr "" +"\n" +"Impossível encontrar secção de informação de desenrolar para " + +#: readelf.c:7677 +msgid "unwind info" +msgstr "informação de desenrolar" + +#: readelf.c:7680 +#, c-format +msgid "" +"\n" +"Unwind section " +msgstr "" +"\n" +"Secção de desenrolar " + +#: readelf.c:7687 +#, c-format +msgid " at offset 0x%lx contains %lu entries:\n" +msgstr " no desvio 0x%lx contém %lu entradas:\n" + +#: readelf.c:7966 +#, c-format +msgid "Skipping unexpected relocation type %s\n" +msgstr "A saltar tipo de relocalização inesperado: %s\n" + +#: readelf.c:8042 readelf.c:9145 +#, c-format +msgid "" +"\n" +"Unwind section '%s' at offset 0x%lx contains %lu entry:\n" +msgid_plural "" +"\n" +"Unwind section '%s' at offset 0x%lx contains %lu entries:\n" +msgstr[0] "" +"\n" +"Secção de desenrolar \"%s\" no desvio 0x%lx contém %lu entrada:\n" +msgstr[1] "" +"\n" +"Secção de desenrolar \"%s\" no desvio 0x%lx contém %lu entradas:\n" + +#: readelf.c:8181 +msgid "unwind data" +msgstr "dados de desenrolar" + +#: readelf.c:8254 +#, c-format +msgid "Skipping unexpected relocation at offset 0x%lx\n" +msgstr "A saltar relocalização inesperada no desvio 0x%lx\n" + +#: readelf.c:8276 +#, c-format +msgid "Unknown section relocation type %d encountered\n" +msgstr "Encontrado tipo de relocalização %d desconhecido\n" + +#: readelf.c:8284 +#, c-format +msgid "Bad symbol index in unwind relocation (%lu > %lu)\n" +msgstr "Mau índice de símbolo em relocalização de desenrolar (%lu > %lu)\n" + +#: readelf.c:8299 +#, c-format +msgid "Skipping unknown ARM relocation type: %d\n" +msgstr "A saltar tipo de relocalização ARM desconhecido: %d\n" + +#: readelf.c:8309 +#, c-format +msgid "Skipping unexpected ARM relocation type %s\n" +msgstr "A saltar tipo de relocalização ARM inesperado: %s\n" + +#: readelf.c:8318 +#, c-format +msgid "Skipping unknown C6000 relocation type: %d\n" +msgstr "A saltar tipo de relocalização C6000 desconhecido: %d\n" + +#: readelf.c:8328 +#, c-format +msgid "Skipping unexpected C6000 relocation type %s\n" +msgstr "A saltar tipo de relocalização ARM inesperado: %s\n" + +#. This function currently only supports ARM and TI unwinders. +#: readelf.c:8337 +msgid "Only TI and ARM unwinders are currently supported\n" +msgstr "Só são suportados desenroladores TI e ARM\n" + +#: readelf.c:8400 +#, c-format +msgid "[Truncated opcode]\n" +msgstr "[opcode truncado]\n" + +#: readelf.c:8448 readelf.c:8664 +#, c-format +msgid "Refuse to unwind" +msgstr "Recusa de desenrolar" + +#: readelf.c:8471 +#, c-format +msgid " [Reserved]" +msgstr " [Reservado]" + +#: readelf.c:8499 +#, c-format +msgid " finish" +msgstr " termina" + +#: readelf.c:8504 readelf.c:8597 +#, c-format +msgid "[Spare]" +msgstr "[Vago]" + +#: readelf.c:8538 +msgid "corrupt change to vsp" +msgstr "alteração corrupta a vsp" + +#: readelf.c:8619 readelf.c:8769 +#, c-format +msgid " [unsupported opcode]" +msgstr " [opcode não suportado]" + +#: readelf.c:8712 +#, c-format +msgid "pop frame {" +msgstr "pop frame {" + +#: readelf.c:8723 +msgid "[pad]" +msgstr "[pad]" + +#: readelf.c:8751 +msgid "Corrupt stack pointer adjustment detected\n" +msgstr "Detectado ajuste de ponteiro de stack corrupto\n" + +#: readelf.c:8758 +#, c-format +msgid "sp = sp + %ld" +msgstr "sp = sp + %ld" + +#: readelf.c:8828 +#, c-format +msgid " Personality routine: " +msgstr " Rotina de personalidade: " + +#: readelf.c:8860 +#, c-format +msgid " [Truncated data]\n" +msgstr " [Dados truncados]\n" + +#: readelf.c:8884 +#, c-format +msgid "Corrupt ARM compact model table entry: %x \n" +msgstr "Entrada de tabela de modelo compacto ARM corrupta: %x \n" + +#: readelf.c:8889 +#, c-format +msgid " Compact model index: %d\n" +msgstr " Índice de modelo compacto: %d\n" + +#: readelf.c:8915 +msgid "Unknown ARM compact model index encountered\n" +msgstr "Encontrado índice de modelo compacto ARM desconhecido\n" + +#: readelf.c:8916 +#, c-format +msgid " [reserved]\n" +msgstr " [reservado]\n" + +#: readelf.c:8931 +#, c-format +msgid " Restore stack from frame pointer\n" +msgstr " Restaurar stack do ponteiro de frame\n" + +#: readelf.c:8933 +#, c-format +msgid " Stack increment %d\n" +msgstr " Incremento do stack %d\n" + +#: readelf.c:8934 +#, c-format +msgid " Registers restored: " +msgstr " Registos restaurados: " + +#: readelf.c:8939 +#, c-format +msgid " Return register: %s\n" +msgstr " Registo devolvido: %s\n" + +#: readelf.c:8943 +#, c-format +msgid " [reserved (%d)]\n" +msgstr " [reservado (%d)]\n" + +#: readelf.c:8947 +#, c-format +msgid "Unsupported architecture type %d encountered when decoding unwind table\n" +msgstr "Encontrado tipo de arquitectura %d não suportado ao descodificar tabela de desenrolar\n" + +#: readelf.c:9002 +#, c-format +msgid "corrupt index table entry: %x\n" +msgstr "entrada de tabela de índice corrupta: %x\n" + +#: readelf.c:9042 +#, c-format +msgid "Unwind entry contains corrupt offset (0x%lx) into section %s\n" +msgstr "Entrada de desenrolar contém desvio corrupto (0x%lx) na secção %s\n" + +#: readelf.c:9058 +#, c-format +msgid "Could not locate .ARM.extab section containing 0x%lx.\n" +msgstr "Impossível localizar secção extab .ARM contendo 0x%lx.\n" + +#: readelf.c:9103 +#, c-format +msgid "Unsupported architecture type %d encountered when processing unwind table\n" +msgstr "Encontrado tipo de arquitectura %d não suportado ao processar tabela de desenrolar\n" + +#: readelf.c:9125 +msgid "Multiple string tables found in file.\n" +msgstr "Encontradas múltiplas tabelas de cadeia no ficheiro.\n" + +#: readelf.c:9191 +#, c-format +msgid "" +"\n" +"The decoding of unwind sections for machine type %s is not currently supported.\n" +msgstr "" +"\n" +"A descodificação de secções de desenrolar para tipos de máquina %s não é suportada.\n" + +#: readelf.c:9203 +#, c-format +msgid "NONE" +msgstr "NADA" + +#: readelf.c:9228 +#, c-format +msgid "Interface Version: %s" +msgstr "Versão da interface: %s" + +#. Note: coded this way so that there is a single string for translation. +#: readelf.c:9234 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:9252 +#, c-format +msgid "Time Stamp: %s" +msgstr "Carimbo: %s" + +#: readelf.c:9430 readelf.c:9478 +msgid "dynamic section" +msgstr "secção dinâmica" + +#: readelf.c:9450 readelf.c:9499 +#, c-format +msgid "Out of memory allocating space for %lu dynamic entries\n" +msgstr "Sem memória ao alocar espaço para %lu entradas dinâmicas\n" + +#: readelf.c:9559 +#, c-format +msgid "" +"\n" +"There is no dynamic section in this file.\n" +msgstr "" +"\n" +"Não há secção dinâmica neste ficheiro.\n" + +#. See PR 21379 for a reproducer. +#: readelf.c:9597 +#, c-format +msgid "Invalid DT_SYMTAB entry: %lx" +msgstr "Entrada DT_SYMTAB inválida: %lx" + +#: readelf.c:9615 +msgid "Unable to determine the number of symbols to load\n" +msgstr "Impossível determinar o número de símbolos a carregar\n" + +#: readelf.c:9651 +msgid "Unable to determine the length of the dynamic string table\n" +msgstr "Impossível determinar o tamanho da tabela de cadeia dinâmica\n" + +#: readelf.c:9657 +msgid "dynamic string table" +msgstr "tabela de cadeia dinâmica" + +#: readelf.c:9679 +#, c-format +msgid "Bad value (%d) for SYMINENT entry\n" +msgstr "Mau valor (%d) para entrada SYMINENT\n" + +#: readelf.c:9698 +msgid "symbol information" +msgstr "informação de símbolo" + +#: readelf.c:9705 +#, c-format +msgid "Out of memory allocating %lu byte for dynamic symbol info\n" +msgstr "Sem memória ao alocar %lu byte para informação de símbolo dinâmico\n" + +#: readelf.c:9724 +#, c-format +msgid "" +"\n" +"Dynamic section at offset 0x%lx contains %lu entry:\n" +msgid_plural "" +"\n" +"Dynamic section at offset 0x%lx contains %lu entries:\n" +msgstr[0] "" +"\n" +"Secção dinâmica no desvio 0x%lx contém %lu entrada:\n" +msgstr[1] "" +"\n" +"Secção dinâmica no desvio 0x%lx contém %lu entradas:\n" + +#: readelf.c:9731 +#, c-format +msgid " Tag Type Name/Value\n" +msgstr " Etq Tipo Nome/Valor\n" + +#: readelf.c:9765 +#, c-format +msgid "Auxiliary library" +msgstr "Biblioteca auxiliar" + +#: readelf.c:9769 +#, c-format +msgid "Filter library" +msgstr "Biblioteca de filtro" + +#: readelf.c:9773 +#, c-format +msgid "Configuration file" +msgstr "Ficheiro de configuração" + +#: readelf.c:9777 +#, c-format +msgid "Dependency audit library" +msgstr "Biblioteca de auditoria de dependência" + +#: readelf.c:9781 +#, c-format +msgid "Audit library" +msgstr "Biblioteca de auditoria" + +#: readelf.c:9799 readelf.c:9827 readelf.c:9855 +#, c-format +msgid "Flags:" +msgstr "Bandeiras:" + +#: readelf.c:9802 readelf.c:9830 readelf.c:9857 +#, c-format +msgid " None\n" +msgstr " Nada\n" + +#: readelf.c:10048 +#, c-format +msgid "Shared library: [%s]" +msgstr "Biblioteca partilhada: [%s]" + +#: readelf.c:10051 +#, c-format +msgid " program interpreter" +msgstr " interpretador do programa" + +#: readelf.c:10055 +#, c-format +msgid "Library soname: [%s]" +msgstr "soname da biblioteca: [%s]" + +#: readelf.c:10059 +#, c-format +msgid "Library rpath: [%s]" +msgstr "rpath da biblioteca: [%s]" + +#: readelf.c:10063 +#, c-format +msgid "Library runpath: [%s]" +msgstr "runpath da biblioteca: [%s]" + +#: readelf.c:10097 +#, c-format +msgid " (bytes)\n" +msgstr " (bytes)\n" + +#: readelf.c:10127 +#, c-format +msgid "Not needed object: [%s]\n" +msgstr "Objecto não necessário: [%s]\n" + +#: readelf.c:10152 +#, c-format +msgid ": %d" +msgstr ": %d" + +#: readelf.c:11007 +#, c-format +msgid ": %x" +msgstr ": %x" + +#: readelf.c:11046 +#, c-format +msgid "bad section index[%3d]" +msgstr "mau índice de secção[%3d]" + +#: readelf.c:11067 +#, c-format +msgid "Size truncation prevents reading %s elements of size %u\n" +msgstr "Truncamento de tamanho impede a leitura de %s elementos de tamanho %u\n" + +#: readelf.c:11076 +#, c-format +msgid "Invalid number of dynamic entries: %s\n" +msgstr "Número inválido de entradas dinâmicas: %s\n" + +#: readelf.c:11084 +#, c-format +msgid "Out of memory reading %s dynamic entries\n" +msgstr "Sem memória ao ler %s entradas dinâmicas\n" + +#: readelf.c:11091 +#, c-format +msgid "Unable to read in %s bytes of dynamic data\n" +msgstr "Impossível ler em %s bytes de dados dinâmicos\n" + +#: readelf.c:11100 +#, c-format +msgid "Out of memory allocating space for %s dynamic entries\n" +msgstr "Sem memória ao alocar espaço para %s entradas dinâmicas\n" + +#: readelf.c:11127 +#, c-format +msgid "\n" +msgstr "\n" + +#: readelf.c:11159 +#, c-format +msgid " " +msgstr " " + +#: readelf.c:11185 +msgid "version data" +msgstr "dados de versão" + +#: readelf.c:11290 +msgid "version need aux (3)" +msgstr "versão precisa aux (3)" + +#: readelf.c:11365 readelf.c:11417 readelf.c:11441 readelf.c:11471 +#: readelf.c:11495 +msgid "Unable to seek to start of dynamic information\n" +msgstr "Impossível procurar para início da informação dinâmica\n" + +#: readelf.c:11371 readelf.c:11423 +msgid "Failed to read in number of buckets\n" +msgstr "Falha ao ler no número de baldes\n" + +#: readelf.c:11377 +msgid "Failed to read in number of chains\n" +msgstr "Falha ao ler no número de correntes\n" + +#: readelf.c:11479 +msgid "Failed to determine last chain length\n" +msgstr "Falha ao determinar tamanho da última corrente\n" + +#: readelf.c:11526 +#, c-format +msgid "" +"\n" +"Symbol table for image:\n" +msgstr "" +"\n" +"Tabela de símbolo para imagem:\n" + +#: readelf.c:11528 readelf.c:11554 +#, c-format +msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" +msgstr " Núm Bld: Valor Tam. Tipo Bind Vis Nome Ndx\n" + +#: readelf.c:11530 readelf.c:11556 +#, c-format +msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" +msgstr " Núm Bld: Valor Tam. Tipo Bind Vis Nome Ndx\n" + +#: readelf.c:11541 readelf.c:11737 +msgid "histogram chain is corrupt\n" +msgstr "corrente de histograma corrupta\n" + +#: readelf.c:11552 +#, c-format +msgid "" +"\n" +"Symbol table of `.gnu.hash' for image:\n" +msgstr "" +"\n" +"Tabela de símbolo de \".gnu.hash\" para imagem:\n" + +#: readelf.c:11597 +#, c-format +msgid "" +"\n" +"Symbol table '%s' has a sh_entsize of zero!\n" +msgstr "" +"\n" +"Tabela de símbolo \"%s\" tem sh_entsize zero!\n" + +#: readelf.c:11603 +#, c-format +msgid "" +"\n" +"Symbol table '%s' contains %lu entry:\n" +msgid_plural "" +"\n" +"Symbol table '%s' contains %lu entries:\n" +msgstr[0] "" +"\n" +"Tabela de símbolo \"%s\" contém %lu entrada:\n" +msgstr[1] "" +"\n" +"Tabela de símbolo \"%s\" contém %lu entradas:\n" + +#: readelf.c:11610 +#, c-format +msgid " Num: Value Size Type Bind Vis Ndx Name\n" +msgstr " Núm: Valor Tam. Tipo Bind Vis Nome Ndx\n" + +#: readelf.c:11612 +#, c-format +msgid " Num: Value Size Type Bind Vis Ndx Name\n" +msgstr " Núm: Valor Tam. Tipo Bind Vis Nome Ndx\n" + +#: readelf.c:11687 +#, c-format +msgid "local symbol %u found at index >= %s's sh_info value of %u\n" +msgstr "encontrado símbolo local %u em índice >= valor sh_info de %s de %u\n" + +#: readelf.c:11698 +#, c-format +msgid "" +"\n" +"Dynamic symbol information is not available for displaying symbols.\n" +msgstr "" +"\n" +"Informação de símbolo dinâmico indisponível para mostrar símbolos.\n" + +#: readelf.c:11711 +#, c-format +msgid "" +"\n" +"Histogram for bucket list length (total of %lu bucket):\n" +msgid_plural "" +"\n" +"Histogram for bucket list length (total of %lu buckets):\n" +msgstr[0] "" +"\n" +"Histograma para tamanho da lista de baldes (total de balde %lu):\n" +msgstr[1] "" +"\n" +"Histograma para tamanho da lista de baldes (total de baldes %lu):\n" + +#: readelf.c:11721 +msgid "Out of memory allocating space for histogram buckets\n" +msgstr "Sem memória ao alocar espaço para baldes de histograma\n" + +#: readelf.c:11727 readelf.c:11803 +#, c-format +msgid " Length Number %% of total Coverage\n" +msgstr " Taman. Número %% de total Cobertura\n" + +#: readelf.c:11749 +msgid "Out of memory allocating space for histogram counts\n" +msgstr "Sem memória ao alocar espaço para totais de histograma\n" + +#: readelf.c:11789 +#, c-format +msgid "" +"\n" +"Histogram for `.gnu.hash' bucket list length (total of %lu bucket):\n" +msgid_plural "" +"\n" +"Histogram for `.gnu.hash' bucket list length (total of %lu buckets):\n" +msgstr[0] "" +"\n" +"Histograma para tamanho da lista de baldes \".gnu.hash\" (total de balde %lu):\n" +msgstr[1] "" +"\n" +"Histograma para tamanho da lista de baldes \".gnu.hash\" (total de baldes %lu):\n" + +#: readelf.c:11799 +msgid "Out of memory allocating space for gnu histogram buckets\n" +msgstr "Sem memória ao alocar espaço para baldes de histograma gnu\n" + +#: readelf.c:11825 +msgid "Out of memory allocating space for gnu histogram counts\n" +msgstr "Sem memória ao alocar espaço para totais de histograma gnu\n" + +#: readelf.c:11870 +#, c-format +msgid "" +"\n" +"Dynamic info segment at offset 0x%lx contains %d entry:\n" +msgid_plural "" +"\n" +"Dynamic info segment at offset 0x%lx contains %d entries:\n" +msgstr[0] "" +"\n" +"Segmento de informação dinâmica no desvio 0x%lx contém %d entrada:\n" +msgstr[1] "" +"\n" +"Segmento de informação dinâmica no desvio 0x%lx contém %d entradas:\n" + +#: readelf.c:11877 +#, c-format +msgid " Num: Name BoundTo Flags\n" +msgstr " Núm: Nome AssocA Bands\n" + +#: readelf.c:11884 +#, c-format +msgid "" +msgstr "<índice corrupto>" + +#: readelf.c:11888 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:11977 +#, c-format +msgid "MSP430 SYM_DIFF reloc contains invalid symbol index %lu\n" +msgstr "reloc MSP430 SYM_DIFF contém índice de símbolo inválido %lu\n" + +#: readelf.c:12006 +#, c-format +msgid "MSP430 reloc contains invalid symbol index %lu\n" +msgstr "reloc MSP430 contém índice de símbolo inválido %lu\n" + +#. PR 21137 +#: readelf.c:12017 +#, c-format +msgid "MSP430 sym diff reloc contains invalid offset: 0x%lx\n" +msgstr "reloc sym diff MSP430 contém desvio inválido: 0x%lx\n" + +#: readelf.c:12028 +msgid "Unhandled MSP430 reloc type found after SYM_DIFF reloc\n" +msgstr "Encontrado tipo de reloc MSP430 não gerido após reloc SYM_DIFF\n" + +#: readelf.c:12051 +#, c-format +msgid "MN10300_SYM_DIFF reloc contains invalid symbol index %lu\n" +msgstr "reloc MN10300_SYM_DIFF contém índice de símbolo inválido %lu\n" + +#: readelf.c:12065 +#, c-format +msgid "MN10300 reloc contains invalid symbol index %lu\n" +msgstr "reloc MN10300 contém índice de símbolo inválido %lu\n" + +#: readelf.c:12075 +#, c-format +msgid "MN10300 sym diff reloc contains invalid offset: 0x%lx\n" +msgstr "reloc MN10300 sym diff contém desvio inváĺido: 0x%lx\n" + +#: readelf.c:12085 +msgid "Unhandled MN10300 reloc type found after SYM_DIFF reloc\n" +msgstr "Encontrado tipo de reloc MN10300 não gerido após reloc SYM_DIFF\n" + +#: readelf.c:12108 +#, c-format +msgid "RL78_SYM reloc contains invalid symbol index %lu\n" +msgstr "reloc RL78_SYM reloc contém índice de símbolo inválido %lu\n" + +#: readelf.c:12127 readelf.c:12136 +#, c-format +msgid "RL78 sym diff reloc contains invalid offset: 0x%lx\n" +msgstr "reloc RL78 sym diff contém desvio inválido: 0x%lx\n" + +#: readelf.c:12345 +#, c-format +msgid "Missing knowledge of 32-bit reloc types used in DWARF sections of machine number %d\n" +msgstr "Faltam conhecimentos de tipos de reloc 32 bit usados em secções DWARF da máquina número %d\n" + +#: readelf.c:12955 +#, c-format +msgid "unable to apply unsupported reloc type %d to section %s\n" +msgstr "impossível aplicar tipo de reloc %d não suportado à secção %s\n" + +#: readelf.c:12965 +#, c-format +msgid "skipping invalid relocation offset 0x%lx in section %s\n" +msgstr "a ignorar desvio de relocalização 0x%lx inválido na secção %s\n" + +#: readelf.c:12975 +#, c-format +msgid "skipping invalid relocation symbol index 0x%lx in section %s\n" +msgstr "a ignorar índice de símbolo de relocalização 0x%lx inválido na secção %s\n" + +#: readelf.c:12999 +#, c-format +msgid "skipping unexpected symbol type %s in section %s relocation %ld\n" +msgstr "a ignorar tipo de símbolo %s inesperado na secção %s relocalização %ld\n" + +#: readelf.c:13062 +#, c-format +msgid "" +"\n" +"Assembly dump of section %s\n" +msgstr "" +"\n" +"Despejo de montagem da secção %s\n" + +#: readelf.c:13080 +#, c-format +msgid "Section '%s' has no data to dump.\n" +msgstr "Secção \"%s\" não tem dados para despejar.\n" + +#: readelf.c:13086 +msgid "section contents" +msgstr "conteúdo da secção" + +#: readelf.c:13161 +#, c-format +msgid "" +"\n" +"String dump of section '%s':\n" +msgstr "" +"\n" +"Despejo de cadeia da secção \"%s\":\n" + +#: readelf.c:13177 readelf.c:13324 readelf.c:13499 +#, c-format +msgid "section '%s' has unsupported compress type: %d\n" +msgstr "secção \"%s\" tem um tipo de compressão não suportado: %d\n" + +#: readelf.c:13183 readelf.c:13330 readelf.c:13505 +#, c-format +msgid "compressed section '%s' is corrupted\n" +msgstr "secção comprimida \"%s\" está corrupta\n" + +#: readelf.c:13215 readelf.c:13364 readelf.c:13542 +#, c-format +msgid "Unable to decompress section %s\n" +msgstr "impossível descomprimir a secção %s\n" + +#: readelf.c:13240 +#, c-format +msgid " Note: This section has relocations against it, but these have NOT been applied to this dump.\n" +msgstr " Nota: esta secção tem relocalizações contra, mas NÃO foram aplicadas a este despejo.\n" + +#: readelf.c:13273 readelf.c:14368 readelf.c:14411 readelf.c:14459 +#: readelf.c:14491 +#, c-format +msgid "\n" +msgstr "\n" + +#: readelf.c:13281 +#, c-format +msgid " No strings found in this section." +msgstr " Sem cadeias nesta secção." + +#: readelf.c:13309 +#, c-format +msgid "" +"\n" +"Hex dump of section '%s':\n" +msgstr "" +"\n" +"Despejo máximo da secção \"%s\":\n" + +#: readelf.c:13397 +#, c-format +msgid " NOTE: This section has relocations against it, but these have NOT been applied to this dump.\n" +msgstr " NOTA: esta secção tem relocalizações contra, mas NÃO foram aplicadas a este despejo.\n" + +#: readelf.c:13466 +#, c-format +msgid "%s section data" +msgstr "%s dados da secção" + +#: readelf.c:13490 +#, c-format +msgid "compressed section %s is too small to contain a compression header" +msgstr "secção comprimida %s muito pequena para conter um cabeçalho de compressão" + +#: readelf.c:13652 +#, c-format +msgid "" +"\n" +"Section '%s' has no debugging data.\n" +msgstr "" +"\n" +"A secção \"%s\" não tem dados de depuração.\n" + +#. There is no point in dumping the contents of a debugging section +#. which has the NOBITS type - the bits in the file will be random. +#. This can happen when a file containing a .eh_frame section is +#. stripped with the --only-keep-debug command line option. +#: readelf.c:13661 +#, c-format +msgid "section '%s' has the NOBITS type - its contents are unreliable.\n" +msgstr "secção \"%s\" tem tipo NOBITS - o seu conteúdo não é de confiança.\n" + +#: readelf.c:13711 +#, c-format +msgid "Unrecognized debug section: %s\n" +msgstr "Secção de depuração não reconhecida: %s\n" + +#: readelf.c:13739 +#, c-format +msgid "Section '%s' was not dumped because it does not exist!\n" +msgstr "A secção \"%s\" não foi despejada porque não existe!\n" + +#: readelf.c:13800 +#, c-format +msgid "Section %d was not dumped because it does not exist!\n" +msgstr "A secção %d não foi despejada porque não existe!\n" + +#: readelf.c:13857 +msgid "\n" +msgstr "\n" + +#: readelf.c:13872 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:13912 +#, c-format +msgid "Absent/Non standard\n" +msgstr "Ausente/Não padrão\n" + +#: readelf.c:13915 +#, c-format +msgid "Bare metal/mwdt\n" +msgstr "Metal nu/mwdt\n" + +#: readelf.c:13918 +#, c-format +msgid "Bare metal/newlib\n" +msgstr "Metal nu/newlib\n" + +#: readelf.c:13921 +#, c-format +msgid "Linux/uclibc\n" +msgstr "Linux/uclibc\n" + +#: readelf.c:13924 +#, c-format +msgid "Linux/glibc\n" +msgstr "Linux/glibc\n" + +#: readelf.c:13927 readelf.c:14011 +#, c-format +msgid "Unknown\n" +msgstr "Desconhecido\n" + +#: readelf.c:13940 readelf.c:13971 readelf.c:14002 +#, c-format +msgid "Absent\n" +msgstr "Ausente\n" + +#: readelf.c:13984 +msgid "yes" +msgstr "sim" + +#: readelf.c:13984 +msgid "no" +msgstr "não" + +#: readelf.c:14025 readelf.c:14033 +msgid "default" +msgstr "predefinição" + +#: readelf.c:14026 +msgid "smallest" +msgstr "o menor" + +#: readelf.c:14032 +msgid "OPTFP" +msgstr "OPTFP" + +#: readelf.c:14226 readelf.c:14240 readelf.c:14259 readelf.c:14767 +#: readelf.c:15058 readelf.c:15071 readelf.c:15084 +#, c-format +msgid "None\n" +msgstr "Nenhum\n" + +#: readelf.c:14227 +#, c-format +msgid "Application\n" +msgstr "Aplicação\n" + +#: readelf.c:14228 +#, c-format +msgid "Realtime\n" +msgstr "Tempo real\n" + +#: readelf.c:14229 +#, c-format +msgid "Microcontroller\n" +msgstr "Micro-controlador\n" + +#: readelf.c:14230 +#, c-format +msgid "Application or Realtime\n" +msgstr "Aplicação ou Tempo real\n" + +#: readelf.c:14241 readelf.c:14261 readelf.c:14821 readelf.c:14839 +#: readelf.c:14914 readelf.c:14935 readelf.c:17091 +#, c-format +msgid "8-byte\n" +msgstr "8-byte\n" + +#: readelf.c:14242 readelf.c:14917 readelf.c:14938 readelf.c:17090 +#, c-format +msgid "4-byte\n" +msgstr "4-byte\n" + +#: readelf.c:14246 readelf.c:14265 +#, c-format +msgid "8-byte and up to %d-byte extended\n" +msgstr "8-byte e até %d-byte estendido\n" + +#: readelf.c:14260 +#, c-format +msgid "8-byte, except leaf SP\n" +msgstr "8-byte, excepto leaf SP\n" + +#: readelf.c:14277 readelf.c:14365 readelf.c:14954 +#, c-format +msgid "flag = %d, vendor = " +msgstr "bandeira = %d, fabricante = " + +#: readelf.c:14298 +#, c-format +msgid "True\n" +msgstr "Verdadeiro\n" + +#: readelf.c:14320 +#, c-format +msgid "\n" +msgstr "\n" + +#: readelf.c:14369 +msgid "corrupt vendor attribute\n" +msgstr "atributo de fabricante corrupto\n" + +#: readelf.c:14421 +#, c-format +msgid "unspecified hard/soft float, " +msgstr "flutuante rígido/suave não especificado, " + +#: readelf.c:14424 +#, c-format +msgid "hard float, " +msgstr "flutuante rígido, " + +#: readelf.c:14427 +#, c-format +msgid "soft float, " +msgstr "flutuante suave, " + +#: readelf.c:14430 +#, c-format +msgid "single-precision hard float, " +msgstr "flutuante rígido de precisãi única, " + +#: readelf.c:14437 +#, c-format +msgid "unspecified long double\n" +msgstr "long double não especificado\n" + +#: readelf.c:14440 +#, c-format +msgid "128-bit IBM long double\n" +msgstr "long double 128-bit IBM\n" + +#: readelf.c:14443 +#, c-format +msgid "64-bit long double\n" +msgstr "long double 64-bit\n" + +#: readelf.c:14446 +#, c-format +msgid "128-bit IEEE long double\n" +msgstr "long double 128-bit IEEE\n" + +#: readelf.c:14469 readelf.c:14501 +#, c-format +msgid "unspecified\n" +msgstr "não especificado\n" + +#: readelf.c:14472 +#, c-format +msgid "generic\n" +msgstr "genérico\n" + +#: readelf.c:14507 +#, c-format +msgid "memory\n" +msgstr "memória\n" + +#: readelf.c:14536 +#, c-format +msgid "any\n" +msgstr "qualquer\n" + +#: readelf.c:14539 +#, c-format +msgid "software\n" +msgstr "programa\n" + +#: readelf.c:14542 +#, c-format +msgid "hardware\n" +msgstr "equipamento\n" + +#: readelf.c:14668 +#, c-format +msgid "Hard or soft float\n" +msgstr "flutuante rígido ou suave\n" + +#: readelf.c:14671 +#, c-format +msgid "Hard float (double precision)\n" +msgstr "flutuante rígido (precisão dupla)\n" + +#: readelf.c:14674 +#, c-format +msgid "Hard float (single precision)\n" +msgstr "flutuante rígido (precisão simples)\n" + +#: readelf.c:14677 +#, c-format +msgid "Soft float\n" +msgstr "flutuante suave\n" + +#: readelf.c:14680 +#, c-format +msgid "Hard float (MIPS32r2 64-bit FPU 12 callee-saved)\n" +msgstr "Flutuante rígido (MIPS32r2 64-bit FPU 12 callee-saved)\n" + +#: readelf.c:14683 +#, c-format +msgid "Hard float (32-bit CPU, Any FPU)\n" +msgstr "Flutuante rígido (32-bit CPU, Any FPU)\n" + +#: readelf.c:14686 +#, c-format +msgid "Hard float (32-bit CPU, 64-bit FPU)\n" +msgstr "Flutuante rígido (32-bit CPU, 64-bit FPU)\n" + +#: readelf.c:14689 +#, c-format +msgid "Hard float compat (32-bit CPU, 64-bit FPU)\n" +msgstr "Flutuante rígido compatível (32-bit CPU, 64-bit FPU)\n" + +#: readelf.c:14692 +#, c-format +msgid "NaN 2008 compatibility\n" +msgstr "Compatibilidade NaN 2008\n" + +#: readelf.c:14731 +#, c-format +msgid "Any MSA or not\n" +msgstr "Qualquer MSA ou não\n" + +#: readelf.c:14734 +#, c-format +msgid "128-bit MSA\n" +msgstr "128-bit MSA\n" + +#: readelf.c:14800 +#, c-format +msgid "Not used\n" +msgstr "Não usado\n" + +#: readelf.c:14803 +#, c-format +msgid "2 bytes\n" +msgstr "2 bytes\n" + +#: readelf.c:14806 +#, c-format +msgid "4 bytes\n" +msgstr "4 bytes\n" + +#: readelf.c:14824 readelf.c:14842 readelf.c:14920 readelf.c:14941 +#, c-format +msgid "16-byte\n" +msgstr "16-byte\n" + +#: readelf.c:14857 +#, c-format +msgid "DSBT addressing not used\n" +msgstr "Endereçamento DSBT não usado\n" + +#: readelf.c:14860 +#, c-format +msgid "DSBT addressing used\n" +msgstr "Endereçamento DSBT usado\n" + +#: readelf.c:14875 +#, c-format +msgid "Data addressing position-dependent\n" +msgstr "Endereçamento de dados dependente da posição\n" + +#: readelf.c:14878 +#, c-format +msgid "Data addressing position-independent, GOT near DP\n" +msgstr "Endereçamento de dados dependente da posição, GOT perto de DP\n" + +#: readelf.c:14881 +#, c-format +msgid "Data addressing position-independent, GOT far from DP\n" +msgstr "Endereçamento de dados dependente da posição, GOT longe de DP\n" + +#: readelf.c:14896 +#, c-format +msgid "Code addressing position-dependent\n" +msgstr "Endereçamento de código dependente da posição\n" + +#: readelf.c:14899 +#, c-format +msgid "Code addressing position-independent\n" +msgstr "Endereçamento de código independente da posição\n" + +#: readelf.c:15059 +#, c-format +msgid "MSP430\n" +msgstr "MSP430\n" + +#: readelf.c:15060 +#, c-format +msgid "MSP430X\n" +msgstr "MSP430X\n" + +#: readelf.c:15072 readelf.c:15085 +#, c-format +msgid "Small\n" +msgstr "Pequeno\n" + +#: readelf.c:15073 readelf.c:15086 +#, c-format +msgid "Large\n" +msgstr "Grande\n" + +#: readelf.c:15087 +#, c-format +msgid "Restricted Large\n" +msgstr "Grande restrito\n" + +#: readelf.c:15093 +#, c-format +msgid " : " +msgstr " : " + +#: readelf.c:15148 +msgid "attributes" +msgstr "atributos" + +#: readelf.c:15160 +#, c-format +msgid "Unknown attributes version '%c'(%d) - expecting 'A'\n" +msgstr "Versão de atributos desconhecida \"%c\"(%d) - esperada \"A\"\n" + +#: readelf.c:15179 +msgid "Tag section ends prematurely\n" +msgstr "Secção de etiqueta termina prematuramente\n" + +#: readelf.c:15188 +#, c-format +msgid "Bad attribute length (%u > %u)\n" +msgstr "Mau tamanho de atributo (%u > %u)\n" + +#: readelf.c:15196 +#, c-format +msgid "Attribute length of %u is too small\n" +msgstr "Tamanho de atributo %u muito pequeno\n" + +#: readelf.c:15207 +msgid "Corrupt attribute section name\n" +msgstr "Nome de secção de atributo corrupto\n" + +#: readelf.c:15212 +#, c-format +msgid "Attribute Section: " +msgstr "Secção de atributo: " + +#: readelf.c:15239 +msgid "Unused bytes at end of section\n" +msgstr "Bytes não usados no fim da secção\n" + +#: readelf.c:15249 +#, c-format +msgid "Bad subsection length (%u > %u)\n" +msgstr "Mau tamanho de sub-secção (%u > %u)\n" + +#: readelf.c:15257 +#, c-format +msgid "Bad subsection length (%u < 6)\n" +msgstr "Mau tamanho de sub-secção (%u > 6)\n" + +#: readelf.c:15272 +#, c-format +msgid "File Attributes\n" +msgstr "Atributos de ficheiro\n" + +#: readelf.c:15275 +#, c-format +msgid "Section Attributes:" +msgstr "Atributos de secção:" + +#: readelf.c:15278 +#, c-format +msgid "Symbol Attributes:" +msgstr "Atributos de símbolo:" + +#: readelf.c:15294 +#, c-format +msgid "Unknown tag: %d\n" +msgstr "Etiqueta desconhecida: %d\n" + +#: readelf.c:15315 +#, c-format +msgid " Unknown attribute:\n" +msgstr " Atributo desconhecido:\n" + +#: readelf.c:15357 +msgid "MIPS GOT entry extends beyond the end of available data\n" +msgstr "Entrada MIPS GOT ultrapassa o fim dos dados disponíveis\n" + +#: readelf.c:15428 readelf.c:15500 +msgid "Unknown" +msgstr "Desconhecido" + +#: readelf.c:15547 +msgid "Corrupt MIPS ABI Flags section.\n" +msgstr "Secção Bandeiras MIPS ABI corrupta.\n" + +#: readelf.c:15553 +msgid "MIPS ABI Flags section" +msgstr "Secção Bandeiras MIPS ABI" + +#: readelf.c:15612 readelf.c:16160 +msgid "Global Offset Table data" +msgstr "Dados Global Offset Table" + +#: readelf.c:15616 +#, c-format +msgid "" +"\n" +"Static GOT:\n" +msgstr "" +"\n" +"GOT estático:\n" + +#: readelf.c:15617 readelf.c:16165 +#, c-format +msgid " Canonical gp value: " +msgstr " Valor gp canónico: " + +#: readelf.c:15631 readelf.c:16169 readelf.c:16296 +#, c-format +msgid " Reserved entries:\n" +msgstr " Entradas reservadas:\n" + +#: readelf.c:15632 +#, c-format +msgid " %*s %10s %*s\n" +msgstr " %*s %10s %*s\n" + +#: readelf.c:15633 readelf.c:15663 readelf.c:16171 readelf.c:16199 +#: readelf.c:16217 readelf.c:16298 readelf.c:16307 +msgid "Address" +msgstr "Endereço" + +#: readelf.c:15633 readelf.c:15663 readelf.c:16171 readelf.c:16199 +#: readelf.c:16218 +msgid "Access" +msgstr "Acesso" + +#: readelf.c:15634 readelf.c:15664 +msgid "Value" +msgstr "Valor" + +#: readelf.c:15661 readelf.c:16197 +#, c-format +msgid " Local entries:\n" +msgstr " Entradas locais:\n" + +#: readelf.c:15743 readelf.c:16410 +msgid "liblist section data" +msgstr "Dados de secção liblist" + +#: readelf.c:15746 +#, c-format +msgid "" +"\n" +"Section '.liblist' contains %lu entry:\n" +msgid_plural "" +"\n" +"Section '.liblist' contains %lu entries:\n" +msgstr[0] "" +"\n" +"Secção \".liblist\" contém %lu entrada:\n" +msgstr[1] "" +"\n" +"Secção \".liblist\" contém %lu entradas:\n" + +#: readelf.c:15750 +msgid " Library Time Stamp Checksum Version Flags\n" +msgstr " Biblioteca Carimbo Checksum Versão Bands\n" + +#: readelf.c:15776 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:15781 +msgid " NONE" +msgstr " NENHUM" + +#: readelf.c:15834 +msgid "No MIPS_OPTIONS header found\n" +msgstr "Sem cabeçalho MIPS_OPTIONS\n" + +#: readelf.c:15839 +msgid "options" +msgstr "opções" + +#: readelf.c:15846 +msgid "Out of memory allocating space for MIPS options\n" +msgstr "Sem memória ao alocar espaço para opções MIPS\n" + +#: readelf.c:15868 +#, c-format +msgid "Invalid size (%u) for MIPS option\n" +msgstr "Tamanho inválido (%u) para opção MIPS\n" + +#: readelf.c:15877 +#, c-format +msgid "" +"\n" +"Section '%s' contains %d entry:\n" +msgid_plural "" +"\n" +"Section '%s' contains %d entries:\n" +msgstr[0] "" +"\n" +"Secção \"%s\" contém %d entrada:\n" +msgstr[1] "" +"\n" +"Secção \"%s\" contém %d entradas:\n" + +#: readelf.c:16048 +msgid "conflict list found without a dynamic symbol table\n" +msgstr "encontrada lista de conflito sem tabela de símbolo dinâmico\n" + +#: readelf.c:16056 +#, c-format +msgid "Overlarge number of conflicts detected: %lx\n" +msgstr "Detectado número de conflitos muito grande: %lx\n" + +#: readelf.c:16064 +msgid "Out of memory allocating space for dynamic conflicts\n" +msgstr "Sem memória ao alocar espaço para conflitos dinâmicos\n" + +#: readelf.c:16074 readelf.c:16089 +msgid "conflict" +msgstr "conflito" + +#: readelf.c:16099 +#, c-format +msgid "" +"\n" +"Section '.conflict' contains %lu entry:\n" +msgid_plural "" +"\n" +"Section '.conflict' contains %lu entries:\n" +msgstr[0] "" +"\n" +"Secção \".conflict\" contém %lu entrada:\n" +msgstr[1] "" +"\n" +"Secção \".conflict\" contém %lu entradas:\n" + +#: readelf.c:16103 +msgid " Num: Index Value Name" +msgstr " Núm: Índ. Valor Nome" + +#: readelf.c:16110 +#, c-format +msgid "" +msgstr "<índice de símbolo corrupto>" + +#: readelf.c:16121 readelf.c:16246 readelf.c:16331 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:16144 +#, c-format +msgid "The GOT symbol offset (%lu) is greater than the symbol table size (%lu)\n" +msgstr "O desvio de símbolo GOT (%lu) é maior que o tamanho da tabela de śimbolos (%lu)\n" + +#: readelf.c:16153 +#, c-format +msgid "Too many GOT symbols: %lu\n" +msgstr "Demasiados símbolos GOT: %lu\n" + +#: readelf.c:16164 +#, c-format +msgid "" +"\n" +"Primary GOT:\n" +msgstr "" +"\n" +"GOT primário:\n" + +#: readelf.c:16170 +#, c-format +msgid " %*s %10s %*s Purpose\n" +msgstr " %*s %10s %*s - propósito\n" + +#: readelf.c:16172 readelf.c:16200 readelf.c:16219 readelf.c:16298 +#: readelf.c:16308 +msgid "Initial" +msgstr "Inicial" + +#: readelf.c:16174 +#, c-format +msgid " Lazy resolver\n" +msgstr " Solucionista preguiçoso\n" + +#: readelf.c:16189 +#, c-format +msgid " Module pointer (GNU extension)\n" +msgstr " Ponteiro de módulo (extensão GNU)\n" + +#: readelf.c:16215 +#, c-format +msgid " Global entries:\n" +msgstr " Entradas globais:\n" + +#: readelf.c:16220 readelf.c:16309 +msgid "Sym.Val." +msgstr "Val.Sím." + +#. Note for translators: "Ndx" = abbreviated form of "Index". +#: readelf.c:16223 readelf.c:16309 +msgid "Ndx" +msgstr "Ndx" + +#: readelf.c:16223 readelf.c:16309 +msgid "Name" +msgstr "Nome" + +#: readelf.c:16233 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:16249 +#, c-format +msgid "" +msgstr "<índice de símbolo %lu excede o nº de símbolos dinâmicos>" + +#: readelf.c:16291 +msgid "Procedure Linkage Table data" +msgstr "Dados Procedure Linkage Table" + +#: readelf.c:16297 +#, c-format +msgid " %*s %*s Purpose\n" +msgstr " %*s %*s - propósito\n" + +#: readelf.c:16300 +#, c-format +msgid " PLT lazy resolver\n" +msgstr " Solucionista preguiçoso PLT\n" + +#: readelf.c:16302 +#, c-format +msgid " Module pointer\n" +msgstr " Ponteiro de módulo\n" + +#: readelf.c:16305 +#, c-format +msgid " Entries:\n" +msgstr " Entradas:\n" + +#: readelf.c:16319 +#, c-format +msgid "" +msgstr "<índice de símbolo corrupto: %lu>" + +#: readelf.c:16357 +msgid "NDS32 elf flags section" +msgstr "Secção de bandeiras elf NDS32" + +#: readelf.c:16421 +msgid "liblist string table" +msgstr "tabela de cadeia liblist" + +#: readelf.c:16433 +#, c-format +msgid "" +"\n" +"Library list section '%s' contains %lu entries:\n" +msgid_plural "" +"\n" +"Library list section '%s' contains %lu entries:\n" +msgstr[0] "" +"\n" +"Secção de lista de biblioteca \"%s\" contém %lu entrada:\n" +msgstr[1] "" +"\n" +"Secção de lista de biblioteca \"%s\" contém %lu entradas:\n" + +#: readelf.c:16439 +msgid " Library Time Stamp Checksum Version Flags" +msgstr " Biblioteca Carimbo Checksum Versão Bands" + +#: readelf.c:16489 +msgid "NT_AUXV (auxiliary vector)" +msgstr "NT_AUXV (vector auxiliar)" + +#: readelf.c:16491 +msgid "NT_PRSTATUS (prstatus structure)" +msgstr "NT_PRSTATUS (estrutura prstatus)" + +#: readelf.c:16493 +msgid "NT_FPREGSET (floating point registers)" +msgstr "NT_FPREGSET (registos de vírgula flutuante)" + +#: readelf.c:16495 +msgid "NT_PRPSINFO (prpsinfo structure)" +msgstr "NT_PRPSINFO (estrutura prpsinfo)" + +#: readelf.c:16497 +msgid "NT_TASKSTRUCT (task structure)" +msgstr "NT_TASKSTRUCT (estrutura task)" + +#: readelf.c:16499 +msgid "NT_PRXFPREG (user_xfpregs structure)" +msgstr "NT_PRXFPREG (estrutura user_xfpregs)" + +#: readelf.c:16501 +msgid "NT_PPC_VMX (ppc Altivec registers)" +msgstr "NT_PPC_VMX (registos ppc Altivec)" + +#: readelf.c:16503 +msgid "NT_PPC_VSX (ppc VSX registers)" +msgstr "NT_PPC_VSX (registos ppc VSX)" + +#: readelf.c:16505 +msgid "NT_PPC_TAR (ppc TAR register)" +msgstr "NT_PPC_TAR (registo ppc TAR)" + +#: readelf.c:16507 +msgid "NT_PPC_PPR (ppc PPR register)" +msgstr "NT_PPC_PPR (registo ppc PPR)" + +#: readelf.c:16509 +msgid "NT_PPC_DSCR (ppc DSCR register)" +msgstr "NT_PPC_DSCR (registo ppc DSCR)" + +#: readelf.c:16511 +msgid "NT_PPC_EBB (ppc EBB registers)" +msgstr "NT_PPC_EBB (registos ppc EBB)" + +#: readelf.c:16513 +msgid "NT_PPC_PMU (ppc PMU registers)" +msgstr "NT_PPC_PMU (registos ppc PMU)" + +#: readelf.c:16515 +msgid "NT_PPC_TM_CGPR (ppc checkpointed GPR registers)" +msgstr "NT_PPC_TM_CGPR (registos ppc checkpointed GPR)" + +#: readelf.c:16517 +msgid "NT_PPC_TM_CFPR (ppc checkpointed floating point registers)" +msgstr "NT_PPC_TM_CFPR (registos de vírgula flutuante ppc checkpointed)" + +#: readelf.c:16519 +msgid "NT_PPC_TM_CVMX (ppc checkpointed Altivec registers)" +msgstr "NT_PPC_TM_CVMX (registos Altivec ppc checkpointed)" + +#: readelf.c:16521 +msgid "NT_PPC_TM_VSX (ppc checkpointed VSX registers)" +msgstr "NT_PPC_TM_VSX (registos VSX ppc checkpointed)" + +#: readelf.c:16523 +msgid "NT_PPC_TM_SPR (ppc TM special purpose registers)" +msgstr "NT_PPC_TM_SPR (registos com propósito especial ppc TM)" + +#: readelf.c:16525 +msgid "NT_PPC_TM_CTAR (ppc checkpointed TAR register)" +msgstr "NT_PPC_TM_CTAR (registo TAR ppc checkpointed)" + +#: readelf.c:16527 +msgid "NT_PPC_TM_CPPR (ppc checkpointed PPR register)" +msgstr "NT_PPC_TM_CPPR (registo PPR ppc checkpointed)" + +#: readelf.c:16529 +msgid "NT_PPC_TM_CDSCR (ppc checkpointed DSCR register)" +msgstr "NT_PPC_TM_CDSCR (registo DSCR ppc checkpointed)" + +#: readelf.c:16531 +msgid "NT_386_TLS (x86 TLS information)" +msgstr "NT_386_TLS (informação x86 TLS)" + +#: readelf.c:16533 +msgid "NT_386_IOPERM (x86 I/O permissions)" +msgstr "NT_386_IOPERM (permisões E/S x86)" + +#: readelf.c:16535 +msgid "NT_X86_XSTATE (x86 XSAVE extended state)" +msgstr "NT_X86_XSTATE (estado estendido x86 XSAVE)" + +#: readelf.c:16537 +msgid "NT_S390_HIGH_GPRS (s390 upper register halves)" +msgstr "NT_S390_HIGH_GPRS (metades do registo superior s390)" + +#: readelf.c:16539 +msgid "NT_S390_TIMER (s390 timer register)" +msgstr "NT_S390_TIMER (registo do temporizador s390)" + +#: readelf.c:16541 +msgid "NT_S390_TODCMP (s390 TOD comparator register)" +msgstr "NT_S390_TODCMP (regisot do comparador s390 TOD)" + +#: readelf.c:16543 +msgid "NT_S390_TODPREG (s390 TOD programmable register)" +msgstr "NT_S390_TODPREG (registo programável s390 TOD)" + +#: readelf.c:16545 +msgid "NT_S390_CTRS (s390 control registers)" +msgstr "NT_S390_CTRS (registos de controlo s390)" + +#: readelf.c:16547 +msgid "NT_S390_PREFIX (s390 prefix register)" +msgstr "NT_S390_PREFIX (registo de prefixo s390)" + +#: readelf.c:16549 +msgid "NT_S390_LAST_BREAK (s390 last breaking event address)" +msgstr "NT_S390_LAST_BREAK (endereço do último evento de quebra s390)" + +#: readelf.c:16551 +msgid "NT_S390_SYSTEM_CALL (s390 system call restart data)" +msgstr "NT_S390_SYSTEM_CALL (dados de reinício de chamada do sistema s390)" + +#: readelf.c:16553 +msgid "NT_S390_TDB (s390 transaction diagnostic block)" +msgstr "NT_S390_TDB (bloco de diagnóstico de transacção s390)" + +#: readelf.c:16555 +msgid "NT_S390_VXRS_LOW (s390 vector registers 0-15 upper half)" +msgstr "NT_S390_VXRS_LOW (metade superior 0-15 de registos de vector s390)" + +#: readelf.c:16557 +msgid "NT_S390_VXRS_HIGH (s390 vector registers 16-31)" +msgstr "NT_S390_VXRS_HIGH (registos de vector 16-31 s390)" + +#: readelf.c:16559 +msgid "NT_S390_GS_CB (s390 guarded-storage registers)" +msgstr "NT_S390_GS_CB (registos de armazenamento guardado s390)" + +#: readelf.c:16561 +msgid "NT_S390_GS_BC (s390 guarded-storage broadcast control)" +msgstr "NT_S390_GS_BC (controlo de emissão de armazenamento guardado s390)" + +#: readelf.c:16563 +msgid "NT_ARM_VFP (arm VFP registers)" +msgstr "NT_ARM_VFP (registos VFP arm)" + +#: readelf.c:16565 +msgid "NT_ARM_TLS (AArch TLS registers)" +msgstr "NT_ARM_TLS (registos TLS AArch)" + +#: readelf.c:16567 +msgid "NT_ARM_HW_BREAK (AArch hardware breakpoint registers)" +msgstr "NT_ARM_HW_BREAK (registos de ponto de quebra de equipamento AArch)" + +#: readelf.c:16569 +msgid "NT_ARM_HW_WATCH (AArch hardware watchpoint registers)" +msgstr "NT_ARM_HW_WATCH (registos de ponto de observação de equipamento AArch)" + +#: readelf.c:16571 +msgid "NT_PSTATUS (pstatus structure)" +msgstr "NT_PSTATUS (estrutura pstatus)" + +#: readelf.c:16573 +msgid "NT_FPREGS (floating point registers)" +msgstr "NT_FPREGS (registos de vírgula flutuante)" + +#: readelf.c:16575 +msgid "NT_PSINFO (psinfo structure)" +msgstr "NT_PSINFO (estrutura psinfo)" + +#: readelf.c:16577 +msgid "NT_LWPSTATUS (lwpstatus_t structure)" +msgstr "NT_LWPSTATUS (estrutura lwpstatus_t)" + +#: readelf.c:16579 +msgid "NT_LWPSINFO (lwpsinfo_t structure)" +msgstr "NT_LWPSINFO (estrutura lwpsinfo_t)" + +#: readelf.c:16581 +msgid "NT_WIN32PSTATUS (win32_pstatus structure)" +msgstr "NT_WIN32PSTATUS (estrutura win32_pstatus)" + +#: readelf.c:16583 +msgid "NT_SIGINFO (siginfo_t data)" +msgstr "NT_SIGINFO (siginfo_t data)" + +#: readelf.c:16585 +msgid "NT_FILE (mapped files)" +msgstr "NT_FILE (ficheiros mapeados)" + +#: readelf.c:16593 +msgid "NT_VERSION (version)" +msgstr "NT_VERSION (versão)" + +#: readelf.c:16595 +msgid "NT_ARCH (architecture)" +msgstr "NT_ARCH (arquitectura)" + +#: readelf.c:16597 +msgid "OPEN" +msgstr "OPEN" + +#: readelf.c:16599 +msgid "func" +msgstr "func" + +#: readelf.c:16604 readelf.c:16723 readelf.c:17064 readelf.c:17208 +#: readelf.c:17266 readelf.c:17343 +#, c-format +msgid "Unknown note type: (0x%08x)" +msgstr "Tipo de nota desconhecido: (0x%08x)" + +#: readelf.c:16625 +#, c-format +msgid " Cannot decode 64-bit note in 32-bit build\n" +msgstr " Impossível descodificar nota 64-bit em compilação 32-bit\n" + +#: readelf.c:16633 +msgid " Malformed note - too short for header\n" +msgstr " Nota malformada - muito curta para cabeçalho\n" + +#: readelf.c:16642 +msgid " Malformed note - does not end with \\0\n" +msgstr " Nota malformada - não termina com \\0\n" + +#: readelf.c:16655 +msgid " Malformed note - too short for supplied file count\n" +msgstr " Nota malformada - muito curta para total de ficheiros indicado\n" + +#: readelf.c:16659 +#, c-format +msgid " Page size: " +msgstr " Tamanho de página: " + +#: readelf.c:16663 +#, c-format +msgid " %*s%*s%*s\n" +msgstr " %*s%*s%*s\n" + +#: readelf.c:16664 +msgid "Start" +msgstr "Início" + +#: readelf.c:16665 +msgid "End" +msgstr "Fim" + +#: readelf.c:16666 +msgid "Page Offset" +msgstr "Desvio de página" + +#: readelf.c:16674 +msgid " Malformed note - filenames end too early\n" +msgstr " Nota malformada - nome de ficheiro acaba muito cedo\n" + +#: readelf.c:16706 +msgid "NT_GNU_ABI_TAG (ABI version tag)" +msgstr "NT_GNU_ABI_TAG (etiqueta de versão ABI)" + +#: readelf.c:16708 +msgid "NT_GNU_HWCAP (DSO-supplied software HWCAP info)" +msgstr "NT_GNU_HWCAP (informação HWCAP de programa DSO fornecido)" + +#: readelf.c:16710 +msgid "NT_GNU_BUILD_ID (unique build ID bitstring)" +msgstr "NT_GNU_BUILD_ID (bitstring de ID única de compilação)" + +#: readelf.c:16712 +msgid "NT_GNU_GOLD_VERSION (gold version)" +msgstr "NT_GNU_GOLD_VERSION (versão dourada)" + +#: readelf.c:16714 +msgid "NT_GNU_PROPERTY_TYPE_0" +msgstr "NT_GNU_PROPERTY_TYPE_0" + +#: readelf.c:16716 +msgid "NT_GNU_BUILD_ATTRIBUTE_OPEN" +msgstr "NT_GNU_BUILD_ATTRIBUTE_OPEN" + +#: readelf.c:16718 +msgid "NT_GNU_BUILD_ATTRIBUTE_FUNC" +msgstr "NT_GNU_BUILD_ATTRIBUTE_FUNC" + +#: readelf.c:16812 +#, c-format +msgid " Properties: " +msgstr " Propriedades: " + +#: readelf.c:16816 +#, c-format +msgid "\n" +msgstr "\n" + +#: readelf.c:16828 +#, c-format +msgid "\n" +msgstr "\n" + +#: readelf.c:16839 +#, c-format +msgid "\n" +msgstr "\n" + +#: readelf.c:16855 readelf.c:16863 readelf.c:16871 readelf.c:16888 +#: readelf.c:16896 +#, c-format +msgid " " +msgstr " " + +#: readelf.c:16886 +#, c-format +msgid "stack size: " +msgstr "tamanho do stack: " + +#: readelf.c:16905 +#, c-format +msgid "\n" +msgstr " \n" + +#: readelf.c:16990 +#, c-format +msgid " OS: %s, ABI: %ld.%ld.%ld\n" +msgstr " OS: %s, ABI: %ld.%ld.%ld\n" + +#: readelf.c:16999 +#, c-format +msgid " Version: " +msgstr " Versão: " + +#. Hardware capabilities information. Word 0 is the number of entries. +#. Word 1 is a bitmask of enabled entries. The rest of the descriptor +#. is a series of entries, where each entry is a single byte followed +#. by a nul terminated string. The byte gives the bit number to test +#. if enabled in the bitmask. +#: readelf.c:17015 +#, c-format +msgid " Hardware Capabilities: " +msgstr " Capacidades do equipamento: " + +#: readelf.c:17018 +msgid "\n" +msgstr "\n" + +#: readelf.c:17023 +#, c-format +msgid "num entries: %ld, enabled mask: %lx\n" +msgstr "nº entradas: %ld, máscara activa: %lx\n" + +#: readelf.c:17039 +#, c-format +msgid " Description data: " +msgstr " Dados de descrição: " + +#: readelf.c:17057 +msgid "Alignment of 8-byte objects" +msgstr "Alinhamento de objectos 8-byte" + +#: readelf.c:17058 +msgid "Sizeof double and long double" +msgstr "Tamanho de double e long double" + +#: readelf.c:17059 +msgid "Type of FPU support needed" +msgstr "Tipo de suporte FPU necessário" + +#: readelf.c:17060 +msgid "Use of SIMD instructions" +msgstr "Uso de instruções SIMD" + +#: readelf.c:17061 +msgid "Use of cache" +msgstr "Uso da cache" + +#: readelf.c:17062 +msgid "Use of MMU" +msgstr "Uso de MMU" + +#: readelf.c:17098 +#, c-format +msgid "4-bytes\n" +msgstr "4-bytes\n" + +#: readelf.c:17099 +#, c-format +msgid "8-bytes\n" +msgstr "8-bytes\n" + +#: readelf.c:17106 +#, c-format +msgid "FPU-2.0\n" +msgstr "FPU-2.0\n" + +#: readelf.c:17107 +#, c-format +msgid "FPU-3.0\n" +msgstr "FPU-3.0\n" + +#: readelf.c:17116 +#, c-format +msgid "yes\n" +msgstr "sim\n" + +#: readelf.c:17126 +#, c-format +msgid "unknown value: %x\n" +msgstr "valor desconhecido: %x\n" + +#: readelf.c:17168 +msgid "NT_THRMISC (thrmisc structure)" +msgstr "NT_THRMISC (estrutura thrmisc)" + +#: readelf.c:17170 +msgid "NT_PROCSTAT_PROC (proc data)" +msgstr "NT_PROCSTAT_PROC (dados proc)" + +#: readelf.c:17172 +msgid "NT_PROCSTAT_FILES (files data)" +msgstr "NT_PROCSTAT_FILES (ficheiros de dados)" + +#: readelf.c:17174 +msgid "NT_PROCSTAT_VMMAP (vmmap data)" +msgstr "NT_PROCSTAT_VMMAP (dados vmmap)" + +#: readelf.c:17176 +msgid "NT_PROCSTAT_GROUPS (groups data)" +msgstr "NT_PROCSTAT_GROUPS (dados de grupos)" + +#: readelf.c:17178 +msgid "NT_PROCSTAT_UMASK (umask data)" +msgstr "NT_PROCSTAT_UMASK (dados umask)" + +#: readelf.c:17180 +msgid "NT_PROCSTAT_RLIMIT (rlimit data)" +msgstr "NT_PROCSTAT_RLIMIT (dados rlimit)" + +#: readelf.c:17182 +msgid "NT_PROCSTAT_OSREL (osreldate data)" +msgstr "NT_PROCSTAT_OSREL (dados osreldate)" + +#: readelf.c:17184 +msgid "NT_PROCSTAT_PSSTRINGS (ps_strings data)" +msgstr "NT_PROCSTAT_PSSTRINGS (dados ps_strings)" + +#: readelf.c:17186 +msgid "NT_PROCSTAT_AUXV (auxv data)" +msgstr "NT_PROCSTAT_AUXV (dados auxv)" + +#: readelf.c:17188 +msgid "NT_PTLWPINFO (ptrace_lwpinfo structure)" +msgstr "NT_PTLWPINFO (estrutura ptrace_lwpinfo)" + +#: readelf.c:17199 +msgid "NetBSD procinfo structure" +msgstr "Estrutura NetBSD procinfo" + +#: readelf.c:17225 readelf.c:17239 +msgid "PT_GETREGS (reg structure)" +msgstr "PT_GETREGS (estrutura reg)" + +#: readelf.c:17227 readelf.c:17241 +msgid "PT_GETFPREGS (fpreg structure)" +msgstr "PT_GETFPREGS (estrutura fpreg)" + +#: readelf.c:17260 +msgid "NT_STAPSDT (SystemTap probe descriptors)" +msgstr "NT_STAPSDT (descritores de sonda SystemTap)" + +#: readelf.c:17293 +#, c-format +msgid " Provider: %s\n" +msgstr " Fornecedor: %s\n" + +#: readelf.c:17294 +#, c-format +msgid " Name: %s\n" +msgstr " Nome: %s\n" + +#: readelf.c:17295 +#, c-format +msgid " Location: " +msgstr " Localização: " + +#: readelf.c:17297 +#, c-format +msgid ", Base: " +msgstr ", base: " + +#: readelf.c:17299 +#, c-format +msgid ", Semaphore: " +msgstr ", semáforo: " + +#: readelf.c:17302 +#, c-format +msgid " Arguments: %s\n" +msgstr " Argumentos: %s\n" + +#: readelf.c:17315 +msgid "NT_VMS_MHD (module header)" +msgstr "NT_VMS_MHD (cabeçalho de módulo)" + +#: readelf.c:17317 +msgid "NT_VMS_LNM (language name)" +msgstr "NT_VMS_LNM (nome da linguagem)" + +#: readelf.c:17319 +msgid "NT_VMS_SRC (source files)" +msgstr "NT_VMS_SRC (ficheiros-fonte)" + +#: readelf.c:17323 +msgid "NT_VMS_EIDC (consistency check)" +msgstr "NT_VMS_EIDC (verificação de consistência)" + +#: readelf.c:17325 +msgid "NT_VMS_FPMODE (FP mode)" +msgstr "NT_VMS_FPMODE (modo FP)" + +#: readelf.c:17329 +msgid "NT_VMS_IMGNAM (image name)" +msgstr "NT_VMS_IMGNAM (nome de imagem)" + +#: readelf.c:17331 +msgid "NT_VMS_IMGID (image id)" +msgstr "NT_VMS_IMGID (id de imagem)" + +#: readelf.c:17333 +msgid "NT_VMS_LINKID (link id)" +msgstr "NT_VMS_LINKID (id de ligação)" + +#: readelf.c:17335 +msgid "NT_VMS_IMGBID (build id)" +msgstr "NT_VMS_IMGBID (id de compilação)" + +#: readelf.c:17337 +msgid "NT_VMS_GSTNAM (sym table name)" +msgstr "NT_VMS_GSTNAM (nome de tab. de sím.)" + +#: readelf.c:17357 +#, c-format +msgid " Creation date : %.17s\n" +msgstr " Data de criação: %.17s\n" + +#: readelf.c:17358 +#, c-format +msgid " Last patch date: %.17s\n" +msgstr " Data últ. patch: %.17s\n" + +#: readelf.c:17359 +#, c-format +msgid " Module name : %s\n" +msgstr " Nome do módulo : %s\n" + +#: readelf.c:17360 +#, c-format +msgid " Module version : %s\n" +msgstr " Versão do módulo: %s\n" + +#: readelf.c:17363 +#, c-format +msgid " Invalid size\n" +msgstr " Tamanho inválido\n" + +#: readelf.c:17366 +#, c-format +msgid " Language: %s\n" +msgstr " Linguagem: %s\n" + +#: readelf.c:17370 +#, c-format +msgid " Floating Point mode: " +msgstr " Modo Vírgula flutuante: " + +#: readelf.c:17375 +#, c-format +msgid " Link time: " +msgstr " Hora de ligação: " + +#: readelf.c:17381 +#, c-format +msgid " Patch time: " +msgstr " Hora do patch: " + +#: readelf.c:17387 +#, c-format +msgid " Major id: %u, minor id: %u\n" +msgstr " Id Major: %u, id minor: %u\n" + +#: readelf.c:17390 +#, c-format +msgid " Last modified : " +msgstr " Última modificação: " + +#: readelf.c:17393 +#, c-format +msgid "" +"\n" +" Link flags : " +msgstr "" +"\n" +" Bands ligação: " + +#: readelf.c:17396 +#, c-format +msgid " Header flags: 0x%08x\n" +msgstr " Bands cabeçalho: 0x%08x\n" + +#: readelf.c:17398 +#, c-format +msgid " Image id : %s\n" +msgstr " Id imagem : %s\n" + +#: readelf.c:17402 +#, c-format +msgid " Image name: %s\n" +msgstr " Nome imagem: %s\n" + +#: readelf.c:17405 +#, c-format +msgid " Global symbol table name: %s\n" +msgstr " Nome da tabela de símbolo global: %s\n" + +#: readelf.c:17408 +#, c-format +msgid " Image id: %s\n" +msgstr " Id imagem: %s\n" + +#: readelf.c:17411 +#, c-format +msgid " Linker id: %s\n" +msgstr " Id linker: %s\n" + +#: readelf.c:17562 readelf.c:17570 +#, c-format +msgid " Applies to region from %#lx to %#lx\n" +msgstr " Aplica-se a região de %#lx a %#lx\n" + +#: readelf.c:17565 readelf.c:17572 +#, c-format +msgid " Applies to region from %#lx\n" +msgstr " Aplica-se a região de %#lx\n" + +#: readelf.c:17601 +#, c-format +msgid " \n" +msgstr " \n" + +#: readelf.c:17602 +#, c-format +msgid " " +msgstr " inválido" + +#: readelf.c:17616 +#, c-format +msgid "Gap in build notes detected from %#lx to %#lx\n" +msgstr "Detectado buraco nas notas de compilação de %#lx a %#lx\n" + +#: readelf.c:17619 readelf.c:17630 +#, c-format +msgid " Applies to region from %#lx" +msgstr " Aplica-se à região de %#lx" + +#: readelf.c:17624 readelf.c:17635 +#, c-format +msgid " to %#lx" +msgstr " a %#lx" + +#: readelf.c:17641 +#, c-format +msgid " (%s)" +msgstr " (%s)" + +#: readelf.c:17662 readelf.c:17677 +#, c-format +msgid "corrupt name field in GNU build attribute note: size = %ld\n" +msgstr "campo de nome corrupto em nota de atributo GNU: tamanho = %ld\n" + +#: readelf.c:17663 readelf.c:17678 +msgid " " +msgstr " " + +#: readelf.c:17697 +#, c-format +msgid "unrecognised attribute type in name field: %d\n" +msgstr "tipo de atributo não reconhecido no campo nome: %d\n" + +#: readelf.c:17698 +msgid "" +msgstr "" + +#: readelf.c:17708 +msgid "" +msgstr "" + +#: readelf.c:17713 +msgid "" +msgstr "" + +#: readelf.c:17718 +msgid "" +msgstr "" + +#: readelf.c:17723 +msgid "" +msgstr "" + +#: readelf.c:17728 +msgid "" +msgstr "" + +#: readelf.c:17733 +msgid "" +msgstr "" + +#: readelf.c:17738 +msgid "" +msgstr "" + +#: readelf.c:17743 +msgid "" +msgstr "" + +#: readelf.c:17762 +#, c-format +msgid "unrecognised byte in name field: %d\n" +msgstr "byte desconhecido no campo de nome: %d\n" + +#: readelf.c:17763 +#, c-format +msgid "" +msgstr "" + +#: readelf.c:17775 +#, c-format +msgid "attribute does not have an expected type (%c)\n" +msgstr "o atributo não tem um tipo esperado (%c)\n" + +#: readelf.c:17779 +#, c-format +msgid "corrupt name field: namesz: %lu but parsing gets to %ld\n" +msgstr "nome de campo corrupto: namesz: %lu mas a análise obtém %ld\n" + +#: readelf.c:17806 +#, c-format +msgid "corrupt numeric name field: too many bytes in the value: %x\n" +msgstr "campo de nome numérico corrupto: demasiados bytes no valor: %x\n" + +#: readelf.c:17974 +#, c-format +msgid " description data: " +msgstr " dados de descrição: " + +#: readelf.c:18013 +msgid "notes" +msgstr "notas" + +#: readelf.c:18021 +#, c-format +msgid "" +"\n" +"Displaying notes found in: %s\n" +msgstr "" +"\n" +"Notas mostradas encontradas em: %s\n" + +#: readelf.c:18023 +#, c-format +msgid "" +"\n" +"Displaying notes found at file offset 0x%08lx with length 0x%08lx:\n" +msgstr "" +"\n" +"Notas mostradas encontradas no desvio de ficheiro 0x%08lx com tamanho 0x%08lx:\n" + +#: readelf.c:18035 +#, c-format +msgid "Corrupt note: alignment %ld, expecting 4 or 8\n" +msgstr "Nota corrupta: alinhamento %ld, esperado 4 ou 8\n" + +#: readelf.c:18040 +#, c-format +msgid " %-20s %10s\tDescription\n" +msgstr " %-20s %10s\tDescrição\n" + +#: readelf.c:18040 +msgid "Owner" +msgstr "Dono" + +#: readelf.c:18040 +msgid "Data size" +msgstr "Tamanho de dados" + +#: readelf.c:18058 readelf.c:18087 +#, c-format +msgid "Corrupt note: only %ld byte remains, not enough for a full note\n" +msgid_plural "Corrupt note: only %ld bytes remain, not enough for a full note\n" +msgstr[0] "Nota corrupta: só resta %ld byte, insuficiente para uma nota completa\n" +msgstr[1] "Nota corrupta: só restam %ld bytes, insuficiente para uma nota completa\n" + +#: readelf.c:18115 +#, c-format +msgid "note with invalid namesz and/or descsz found at offset 0x%lx\n" +msgstr "encontrada nota com namesz e/ou descsz inválidos no desvio 0x%lx\n" + +#: readelf.c:18117 +#, c-format +msgid " type: 0x%lx, namesize: 0x%08lx, descsize: 0x%08lx, alignment: %u\n" +msgstr " tipo: 0x%lx, namesize: 0x%08lx, descsize: 0x%08lx, alinhamento: %u\n" + +#: readelf.c:18135 +msgid "Out of memory allocating space for inote name\n" +msgstr "Sem memória ao alocar espaço para nome inote\n" + +#: readelf.c:18198 +msgid "v850 notes" +msgstr "notas v850" + +#: readelf.c:18205 +#, c-format +msgid "" +"\n" +"Displaying contents of Renesas V850 notes section at offset 0x%lx with length 0x%lx:\n" +msgstr "" +"\n" +"A mostrar conteúdo da secção de notas Renesas V850 no desvio 0x%lx com tamanho 0x%lx:\n" + +#: readelf.c:18222 +#, c-format +msgid "Corrupt note: name size is too big: %lx\n" +msgstr "Nota corrupta: tamanho de nome muito grande: %lx\n" + +#: readelf.c:18232 +#, c-format +msgid "corrupt descsz found in note at offset 0x%lx\n" +msgstr "encontrado descsz corrupto em nota no desvio 0x%lx\n" + +#: readelf.c:18234 readelf.c:18247 +#, c-format +msgid " type: 0x%lx, namesize: 0x%lx, descsize: 0x%lx\n" +msgstr " tipo: 0x%lx, namesize: 0x%lx, descsize: 0x%lx\n" + +#: readelf.c:18245 +#, c-format +msgid "corrupt namesz found in note at offset 0x%lx\n" +msgstr "encontrado namesz corrupto em nota no desvio 0x%lx\n" + +#: readelf.c:18323 +#, c-format +msgid "No note segments present in the core file.\n" +msgstr "Sem segmentos de nota presentes no ficheiro-núcleo.\n" + +#: readelf.c:18331 +#, c-format +msgid " Unknown GNU attribute: %s\n" +msgstr "Atributo GNU desconhecido: %s\n" + +#: readelf.c:18466 +msgid "" +"This instance of readelf has been built without support for a\n" +"64 bit data type and so it cannot read 64 bit ELF files.\n" +msgstr "" +"Esta instância do readelf foi compilada sem suporte a tipo\n" +"de dados 64 bit, pelo que não pode ler ficheiros ELF 64 bit.\n" + +#: readelf.c:18589 +#, c-format +msgid "%s: Failed to read file header\n" +msgstr "%s: falha ao ler cabeçalho de ficheiro\n" + +#: readelf.c:18603 +#, c-format +msgid "" +"\n" +"File: %s\n" +msgstr "" +"\n" +"Ficheiro: %s\n" + +#: readelf.c:18789 +#, c-format +msgid "%s: unable to dump the index as none was found\n" +msgstr "%s: impossível despejar o índice, nenhum encontrado\n" + +#: readelf.c:18795 +#, c-format +msgid "Index of archive %s: (%lu entries, 0x%lx bytes in the symbol table)\n" +msgstr "Índice do arquivo %s: (%lu entradas, 0x%lx bytes na tabela de símbolo)\n" + +#: readelf.c:18814 +#, c-format +msgid "Contents of binary %s at offset " +msgstr "Conteúdo do binário %s no desvio " + +#: readelf.c:18824 +#, c-format +msgid "%s: end of the symbol table reached before the end of the index\n" +msgstr "%s: atingido o fim da tabela de símbolo antes do fim do índice\n" + +#: readelf.c:18841 +#, c-format +msgid "%s: %ld byte remains in the symbol table, but without corresponding entries in the index table\n" +msgid_plural "%s: %ld bytes remain in the symbol table, but without corresponding entries in the index table\n" +msgstr[0] "%s: resta %ld byte na tabela de símbolo, mas não têm entrada correspondente no índice da tabela\n" +msgstr[1] "%s: restam %ld bytes na tabela de símbolo, mas não têm entrada correspondente no índice da tabela\n" + +#: readelf.c:18854 +#, c-format +msgid "%s: failed to seek back to start of object files in the archive\n" +msgstr "%s: falha ao procurar até ao início dos ficheiros objecto no arquivo\n" + +#: readelf.c:18938 readelf.c:19050 +#, c-format +msgid "Input file '%s' is not readable.\n" +msgstr "Ficheiro de entrada \"%s\" não é legível.\n" + +#: readelf.c:18962 +#, c-format +msgid "%s: contains corrupt thin archive: %s\n" +msgstr "%s: contém arquivo magro corrupto - %s\n" + +#: readelf.c:18975 +#, c-format +msgid "%s: failed to seek to archive member.\n" +msgstr "%s: falha ao procurar membro do arquivo.\n" + +#: readelf.c:19042 +msgid "Out of memory allocating file data structure\n" +msgstr "Sem memória ao alocar estrutura de dados de ficheiro\n" + +#: readelf.c:19078 +#, c-format +msgid "File %s is not an archive so its index cannot be displayed.\n" +msgstr "O ficheiro %s não é um arquivo, o índice não pode ser mostrado.\n" + +#: readelf.c:19137 +msgid "Nothing to do.\n" +msgstr "Nada a fazer.\n" + +#: rename.c:122 +#, c-format +msgid "%s: cannot set time: %s" +msgstr "%s: impossível definir a hora - %s" + +#. We have to clean up here. +#: rename.c:157 rename.c:195 +#, c-format +msgid "unable to rename '%s'; reason: %s" +msgstr "impossível renomear \"%s\"; motivo: %s" + +#: rename.c:203 +#, c-format +msgid "unable to copy file '%s'; reason: %s" +msgstr "impossível copiar \"%s\"; motivo: %s" + +#: resbin.c:119 +#, c-format +msgid "%s: not enough binary data" +msgstr "%s: sem dados binários suficientes" + +#: resbin.c:135 +msgid "null terminated unicode string" +msgstr "cadeia unicode terminada em null" + +#: resbin.c:162 resbin.c:168 +msgid "resource ID" +msgstr "ID do recurso" + +#: resbin.c:207 +msgid "cursor" +msgstr "cursor" + +#: resbin.c:238 resbin.c:245 +msgid "menu header" +msgstr "cabeçalho de menu" + +#: resbin.c:254 +msgid "menuex header" +msgstr "cabeçalho de menuex" + +#: resbin.c:258 +msgid "menuex offset" +msgstr "desvio menuex" + +#: resbin.c:263 +#, c-format +msgid "unsupported menu version %d" +msgstr "versão de menu %d não suportada" + +#: resbin.c:288 resbin.c:303 resbin.c:365 +msgid "menuitem header" +msgstr "cabeçalho de menuitem" + +#: resbin.c:395 +msgid "menuitem" +msgstr "menuitem" + +#: resbin.c:432 resbin.c:460 +msgid "dialog header" +msgstr "cabeçalho de diálogo" + +#: resbin.c:450 +#, c-format +msgid "unexpected DIALOGEX version %d" +msgstr "versão DIALOGEX inesperada %d" + +#: resbin.c:495 +msgid "dialog font point size" +msgstr "tamanho do ponto da letra do diálogo" + +#: resbin.c:503 +msgid "dialogex font information" +msgstr "informação da letra dialogex" + +#: resbin.c:529 resbin.c:547 +msgid "dialog control" +msgstr "controlo de diálogo" + +#: resbin.c:539 +msgid "dialogex control" +msgstr "controlo de dialogex" + +#: resbin.c:568 +msgid "dialog control end" +msgstr "fim do controlo de diálogo" + +#: resbin.c:578 +msgid "dialog control data" +msgstr "dados do controlo de diálogo" + +#: resbin.c:618 +msgid "stringtable string length" +msgstr "tamanho da cadeia stringtable" + +#: resbin.c:628 +msgid "stringtable string" +msgstr "cadeia stringtable" + +#: resbin.c:658 +msgid "fontdir header" +msgstr "cabeçalho fontdir" + +#: resbin.c:672 +msgid "fontdir" +msgstr "fontdir" + +#: resbin.c:689 +msgid "fontdir device name" +msgstr "nome de dispositivo fontdir" + +#: resbin.c:695 +msgid "fontdir face name" +msgstr "nome facial de fontdir" + +#: resbin.c:735 +msgid "accelerator" +msgstr "atalho" + +#: resbin.c:794 +msgid "group cursor header" +msgstr "cabeçalho de cursor de grupo" + +#: resbin.c:798 resrc.c:1350 +#, c-format +msgid "unexpected group cursor type %d" +msgstr "tipo de cursor de grupo %d inesperado" + +#: resbin.c:813 +msgid "group cursor" +msgstr "cursor de grupo" + +#: resbin.c:849 +msgid "group icon header" +msgstr "cabeçalho de ícone de grupo" + +#: resbin.c:853 resrc.c:1297 +#, c-format +msgid "unexpected group icon type %d" +msgstr "tipo de ícone de grupo %d inesperado" + +#: resbin.c:868 +msgid "group icon" +msgstr "ícone de grupo" + +#: resbin.c:932 +msgid "unexpected version string" +msgstr "cadeia de versão inesperada" + +#: resbin.c:964 +#, c-format +msgid "version length %lu greater than resource length %lu" +msgstr "tamanho de versão %lu maior que o tamanho do recurso %lu" + +#: resbin.c:968 +#, c-format +msgid "unexpected version type %d" +msgstr "tipo de versão %d inesperado" + +#: resbin.c:980 +#, c-format +msgid "unexpected fixed version information length %ld" +msgstr "tamanho de informação de versão fixa %ld inesperado" + +#: resbin.c:983 +msgid "fixed version info" +msgstr "informação de versão fixa" + +#: resbin.c:987 +#, c-format +msgid "unexpected fixed version signature %lu" +msgstr "assinatura de versão fixa %lu inesperada" + +#: resbin.c:991 +#, c-format +msgid "unexpected fixed version info version %lu" +msgstr "informação de versão fixa versão %lu inesperada" + +#: resbin.c:1020 +msgid "version var info" +msgstr "informação de variável de versão" + +#: resbin.c:1037 +#, c-format +msgid "unexpected stringfileinfo value length %ld" +msgstr "tamanho de valor %ld de stringfileinfo inesperado" + +#: resbin.c:1054 +msgid "version stringtable" +msgstr "stringtable versão" + +#: resbin.c:1062 +#, c-format +msgid "unexpected version stringtable value length %ld" +msgstr "tamanho de valor %ld de stringtable versão inesperado" + +#: resbin.c:1079 +msgid "version string" +msgstr "cadeia de versão" + +#: resbin.c:1094 +#, c-format +msgid "unexpected version string length %ld != %ld + %ld" +msgstr "tamanho de cadeia de versão inesperado %ld != %ld + %ld" + +#: resbin.c:1101 +#, c-format +msgid "unexpected version string length %ld < %ld" +msgstr "tamanho de cadeia de versão inesperado %ld < %ld" + +#: resbin.c:1127 +#, c-format +msgid "unexpected varfileinfo value length %ld" +msgstr "tamanho de valor varfileinfo %ld inesperado" + +#: resbin.c:1146 +msgid "version varfileinfo" +msgstr "varfileinfo versão" + +#: resbin.c:1161 +#, c-format +msgid "unexpected version value length %ld" +msgstr "tamanho de valor de versão %ld inesperado" + +#: resbin.c:1171 +msgid "nul bytes found in version string" +msgstr "encontrados bytes nulos em cadeia de versão" + +#: resbin.c:1174 +#, c-format +msgid "unexpected version string character: %x" +msgstr "carácter de cadeia de versão inesperado: %x" + +#: rescoff.c:123 +msgid "filename required for COFF input" +msgstr "requerido nome de ficheiro para entrada COFF" + +#: rescoff.c:140 +#, c-format +msgid "%s: no resource section" +msgstr "%s: sem secção de recurso" + +#: rescoff.c:150 +#, c-format +msgid "%s: .rsrc section is bigger than the file!" +msgstr "%s: .secção rsrc é maior que o ficheiro!" + +#: rescoff.c:178 +#, c-format +msgid "%s: %s: address out of bounds" +msgstr "%s: %s: endereço fora dos limites" + +#: rescoff.c:199 +msgid "Resources nest too deep" +msgstr "Recursos aninhados muito fundo" + +#: rescoff.c:202 +msgid "directory" +msgstr "pasta" + +#: rescoff.c:230 +msgid "named directory entry" +msgstr "entrada de pasta nomeada" + +#: rescoff.c:239 +msgid "directory entry name" +msgstr "nome de entrada de pasta" + +#: rescoff.c:253 +msgid "resource name" +msgstr "nome de recurso" + +#: rescoff.c:264 +msgid "named subdirectory" +msgstr "sub-pasta nomeada" + +#: rescoff.c:272 +msgid "named resource" +msgstr "recurso nomeado" + +#: rescoff.c:287 +msgid "ID directory entry" +msgstr "entrada de pasta ID" + +#: rescoff.c:304 +msgid "ID subdirectory" +msgstr "sub-pasta ID" + +#: rescoff.c:312 +msgid "ID resource" +msgstr "recurso ID" + +#: rescoff.c:337 +msgid "resource type unknown" +msgstr "tipo de recurso desconhecido" + +#: rescoff.c:340 +msgid "data entry" +msgstr "entrada de dados" + +#: rescoff.c:348 +msgid "resource data" +msgstr "dados do recurso" + +#: rescoff.c:353 +msgid "resource data size" +msgstr "tamanho dos dados do recurso" + +#: rescoff.c:448 +msgid "filename required for COFF output" +msgstr "requerido nome de ficheiro para saída COFF" + +#: rescoff.c:732 +msgid "can't get BFD_RELOC_RVA relocation type" +msgstr "impossível obter tipo de relocalização BFD_RELOC_RVA" + +#: resrc.c:256 resrc.c:328 +#, c-format +msgid "can't open temporary file `%s': %s" +msgstr "impossível abrir ficheiro temporário \"%s\": %s" + +#: resrc.c:262 +#, c-format +msgid "can't redirect stdout: `%s': %s" +msgstr "impossível redireccionar stdout: \"%s\": %s" + +#: resrc.c:324 +#, c-format +msgid "can't execute `%s': %s" +msgstr "impossível executar \"%s\": %s" + +#: resrc.c:333 +#, c-format +msgid "Using temporary file `%s' to read preprocessor output\n" +msgstr "A usar ficheiro temporário \"%s\" para ler saída do pré-processador\n" + +#: resrc.c:340 +#, c-format +msgid "can't popen `%s': %s" +msgstr "impossível popen \"%s\": %s" + +#: resrc.c:342 +#, c-format +msgid "Using popen to read preprocessor output\n" +msgstr "A usar popen para ler saída do pré-processador\n" + +#: resrc.c:408 +#, c-format +msgid "Tried `%s'\n" +msgstr "Tentado \"%s\"\n" + +#: resrc.c:419 +#, c-format +msgid "Using `%s'\n" +msgstr "A usar \"%s\"\n" + +#: resrc.c:603 +msgid "preprocessing failed." +msgstr "falha ao pré-processar." + +#: resrc.c:634 +#, c-format +msgid "%s: unexpected EOF" +msgstr "%s: fim de ficheiro inesperado" + +#: resrc.c:683 +#, c-format +msgid "%s: read of %lu returned %lu" +msgstr "%s: leitura de %lu devolveu %lu" + +#: resrc.c:722 resrc.c:1497 +#, c-format +msgid "stat failed on bitmap file `%s': %s" +msgstr "falha de stat em mapa de bits \"%s\": %s" + +#: resrc.c:773 +#, c-format +msgid "cursor file `%s' does not contain cursor data" +msgstr "ficheiro de cursor \"%s\" não contém dados de cursor" + +#: resrc.c:805 resrc.c:1205 +#, c-format +msgid "%s: fseek to %lu failed: %s" +msgstr "%s: fseek por %lu falhou: %s" + +#: resrc.c:931 +msgid "help ID requires DIALOGEX" +msgstr "ID de ajuda requer DIALOGEX" + +#: resrc.c:933 +msgid "control data requires DIALOGEX" +msgstr "dados de controlo requerem DIALOGEX" + +#: resrc.c:961 +#, c-format +msgid "stat failed on font file `%s': %s" +msgstr "falha de stat em ficheiro de letra \"%s\": %s" + +#: resrc.c:1174 +#, c-format +msgid "icon file `%s' does not contain icon data" +msgstr "ficheiro de ícone \"%s\" não contém dados de ícone" + +#: resrc.c:1723 resrc.c:1758 +#, c-format +msgid "stat failed on file `%s': %s" +msgstr "falha de stat em ficheiro \"%s\": %s" + +#: resrc.c:1957 +#, c-format +msgid "can't open `%s' for output: %s" +msgstr "impossível abrir \"%s\" para saída: %s" + +#: size.c:77 +#, c-format +msgid " Displays the sizes of sections inside binary files\n" +msgstr "Mostra os tamanhos de secções dentro de ficheiros binários\n" + +#: size.c:78 +#, c-format +msgid " If no input file(s) are specified, a.out is assumed\n" +msgstr "Se não forem especificados ficheiros, é assumido a.out\n" + +#: size.c:79 +#, c-format +msgid "" +" The options are:\n" +" -A|-B --format={sysv|berkeley} Select output style (default is %s)\n" +" -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n" +" -t --totals Display the total sizes (Berkeley only)\n" +" --common Display total size for *COM* syms\n" +" --target= Set the binary file format\n" +" @ Read options from \n" +" -h --help Display this information\n" +" -v --version Display the program's version\n" +"\n" +msgstr "" +" As opções são:\n" +" -A|-B --format={sysv|berkeley} Selecciona o estilo de saída (apredefinição é %s)\n" +" -o|-d|-x --radix={8|10|16} Mostra números em formato octal, decimal ou hex\n" +" -t --totals Mostra tamanhos totais (só Berkeley)\n" +" --common Mostra o tamanho total para símbolos *COM*\n" +" --target= Define o formato do ficheiro biário\n" +" @ Lê opções de \n" +" -h --help Mostra esta informação\n" +" -v --version Mostra a versão do programa\n" +"\n" + +#: size.c:159 +#, c-format +msgid "invalid argument to --format: %s" +msgstr "Argumento inválido para --format: %s" + +#: size.c:186 +#, c-format +msgid "Invalid radix: %s\n" +msgstr "radix inválido: %s\n" + +#: srconv.c:130 +msgid "Checksum failure" +msgstr "Falha de checksum" + +#. FIXME: Return error status. +#: srconv.c:142 +msgid "Failed to write checksum" +msgstr "Falha ao escrever checksum" + +#: srconv.c:182 +#, c-format +msgid "Unsupported integer write size: %d" +msgstr "Tamanho de inteiro para escrita não suportado: %d" + +#. FIXME: Return error status. +#: srconv.c:268 +msgid "Failed to write TR block" +msgstr "Falha ao escrever bloco TR" + +#: srconv.c:359 +#, c-format +msgid "Unrecognized H8300 sub-architecture: %ld" +msgstr "Sub-arquitectura H8300 não suportada: %ld" + +#: srconv.c:377 +#, c-format +msgid "Unsupported architecture: %d" +msgstr "Arquitectura não suportada: %d" + +#: srconv.c:831 +#, c-format +msgid "Unrecognised type: %d" +msgstr "Tipo não reconhecido: %d" + +#: srconv.c:957 +#, c-format +msgid "Unrecognised coff symbol type: %d" +msgstr "tipo de símbolo coff não reconhecido: %d" + +#: srconv.c:1019 srconv.c:1119 +#, c-format +msgid "Unrecognised coff symbol visibility: %d" +msgstr "Visibilidade de símbolo coff não reconhecida: %d" + +#: srconv.c:1045 srconv.c:1090 +#, c-format +msgid "Unrecognised coff symbol location: %d" +msgstr "localização de símbolo coff não reconhecida: %d" + +#. FIXME: Return error status. +#: srconv.c:1424 +msgid "Failed to write CS struct" +msgstr "Falha ao escrever estrutura CS" + +#: srconv.c:1696 +#, c-format +msgid "Convert a COFF object file into a SYSROFF object file\n" +msgstr "Converter um ficheiro objecto COFF em ficheiro objecto SYSROFF\n" + +#: srconv.c:1697 +#, c-format +msgid "" +" The options are:\n" +" -q --quick (Obsolete - ignored)\n" +" -n --noprescan Do not perform a scan to convert commons into defs\n" +" -d --debug Display information about what is being done\n" +" @ Read options from \n" +" -h --help Display this information\n" +" -v --version Print the program's version number\n" +msgstr "" +" As opções são:\n" +" -q --quick (Obsoleta - ignorada)\n" +" -n --noprescan Não realiza análise para converter commons em defs\n" +" -d --debug Mostra informação sobre o que está a ser feito\n" +" @ Lê opções de \n" +" -h --help Mostra esta informação\n" +" -v --version Mostra a versão do programa\n" + +#: srconv.c:1844 +#, c-format +msgid "unable to open output file %s" +msgstr "impossível abrir o ficheiro de saída %s" + +#: stabs.c:331 stabs.c:1726 +msgid "numeric overflow" +msgstr "transporte numérico" + +#: stabs.c:341 +#, c-format +msgid "Bad stab: %s\n" +msgstr "Mau stab: %s\n" + +#: stabs.c:349 +#, c-format +msgid "Warning: %s: %s\n" +msgstr "Aviso: %s: %s\n" + +#: stabs.c:459 +#, c-format +msgid "N_LBRAC not within function\n" +msgstr "N_LBRAC não dentro de função\n" + +#: stabs.c:498 +#, c-format +msgid "Too many N_RBRACs\n" +msgstr "Demasiados N_RBRACs\n" + +#: stabs.c:730 +msgid "unknown C++ encoded name" +msgstr "nome C++ codificado desconhecido" + +#. Complain and keep going, so compilers can invent new +#. cross-reference types. +#: stabs.c:1271 +msgid "unrecognized cross reference type" +msgstr "tipo de referência cruzada não reconhecido" + +#. Does this actually ever happen? Is that why we are worrying +#. about dealing with it rather than just calling error_type? +#: stabs.c:1818 +msgid "missing index type" +msgstr "tipo de índice em falta" + +#: stabs.c:2146 +msgid "unknown virtual character for baseclass" +msgstr "carácter virtual desconhecido para baseclass" + +#: stabs.c:2164 +msgid "unknown visibility character for baseclass" +msgstr "carácter de visibilidade desconhecido para baseclass" + +#: stabs.c:2354 +msgid "unnamed $vb type" +msgstr "tipo $vb sem nome" + +#: stabs.c:2360 +msgid "unrecognized C++ abbreviation" +msgstr "abreviatura C++ não reconhecida" + +#: stabs.c:2436 +msgid "unknown visibility character for field" +msgstr "carácter de visibilidade desconhecido para campo" + +#: stabs.c:2696 +msgid "const/volatile indicator missing" +msgstr "indicador constante/volátil em falta" + +#: stabs.c:2938 +#, c-format +msgid "No mangling for \"%s\"\n" +msgstr "Sem polimento para \"%s\"\n" + +#: stabs.c:3238 +msgid "Undefined N_EXCL" +msgstr "N_EXCL indefinido" + +#: stabs.c:3318 +#, c-format +msgid "Type file number %d out of range\n" +msgstr "Número de ficheiro tipo %d fora do intervalo\n" + +#: stabs.c:3323 +#, c-format +msgid "Type index number %d out of range\n" +msgstr "Número de índice tipo %d fora do intervalo\n" + +#: stabs.c:3402 +#, c-format +msgid "Unrecognized XCOFF type %d\n" +msgstr "Tipo XCOFF %d não reconhecido\n" + +#: stabs.c:3695 +#, c-format +msgid "bad mangled name `%s'\n" +msgstr "Mau nome transformado \"%s\"\n" + +#: stabs.c:3790 +#, c-format +msgid "no argument types in mangled string\n" +msgstr "sem tipos de argumento em cadeia transformada\n" + +#: stabs.c:5140 +#, c-format +msgid "Demangled name is not a function\n" +msgstr "Nome descodificado não é uma função\n" + +#: stabs.c:5182 +#, c-format +msgid "Unexpected type in v3 arglist demangling\n" +msgstr "tipo inesperado na descodificação de arglist v3\n" + +#: stabs.c:5254 +#, c-format +msgid "Unrecognized demangle component %d\n" +msgstr "Componente de descodificação %d não reconhecido\n" + +#: stabs.c:5306 +#, c-format +msgid "Failed to print demangled template\n" +msgstr "Falha ao imprimir modelo descodificado\n" + +#: stabs.c:5386 +#, c-format +msgid "Couldn't get demangled builtin type\n" +msgstr "Impossível obter tipo interno descodificado\n" + +#: stabs.c:5435 +#, c-format +msgid "Unexpected demangled varargs\n" +msgstr "varargs descodificado inesperado\n" + +#: stabs.c:5442 +#, c-format +msgid "Unrecognized demangled builtin type\n" +msgstr "Tipo interno descodificado não reconhecido\n" + +#: strings.c:200 strings.c:267 +#, c-format +msgid "invalid integer argument %s" +msgstr "argumento inteiro %s inválido" + +#: strings.c:270 +#, c-format +msgid "invalid minimum string length %d" +msgstr "tamanho mínimo de cadeia %d inválidp" + +#: strings.c:340 +#, c-format +msgid "%s: Reading section %s failed: %s" +msgstr "%s: falha ao ler secção %s: %s" + +#: strings.c:640 +#, c-format +msgid " Display printable strings in [file(s)] (stdin by default)\n" +msgstr "Mostrar cadeias imprimíveis em [ficheiro(s)] (stdin predefinido)\n" + +#: strings.c:644 +#, c-format +msgid "" +" -a - --all Scan the entire file, not just the data section [default]\n" +" -d --data Only scan the data sections in the file\n" +msgstr "" +" -a - --all Analisa todo o ficheiro, não só a secção de dados [predefinição]\n" +" -d --data Analisa só as secções de dados no ficheiro\n" + +#: strings.c:648 +#, c-format +msgid "" +" -a - --all Scan the entire file, not just the data section\n" +" -d --data Only scan the data sections in the file [default]\n" +msgstr "" +" -a - --all Analisa todo o ficheiro, não só a secção de dados\n" +" -d --data Analisa só as secções de dados no ficheiro [predefinição]\n" + +#: strings.c:652 +#, c-format +msgid "" +" -f --print-file-name Print the name of the file before each string\n" +" -n --bytes=[number] Locate & print any NUL-terminated sequence of at\n" +" - least [number] characters (default 4).\n" +" -t --radix={o,d,x} Print the location of the string in base 8, 10 or 16\n" +" -w --include-all-whitespace Include all whitespace as valid string characters\n" +" -o An alias for --radix=o\n" +" -T --target= Specify the binary file format\n" +" -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n" +" s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n" +" -s --output-separator= String used to separate strings in output.\n" +" @ Read options from \n" +" -h --help Display this information\n" +" -v -V --version Print the program's version number\n" +msgstr "" +" -f --print-file-name Imprime o nome do ficheiro antes de cada cadeia\n" +" -n --bytes=[number] Localiza & imprime qualquer sequência terminada em NUL de\n" +" - pelo menos [number] caracteres (predefinição 4).\n" +" -t --radix={o,d,x} Imprime a localização da cadeia em base 8, 10 ou 16\n" +" -w --include-all-whitespace Inclui todos os espaços como cadeias de caracteres válidas\n" +" -o Aliás para --radix=o\n" +" -T --target= Especifica o formato do ficheiro binário\n" +" -e --encoding={s,S,b,l,B,L} Selecciona o tamanho do carácter e endianness:\n" +" s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n" +" -s --output-separator= Cadeia usada para separar cadeias na saída.\n" +" @ Lê opções de \n" +" -h --help Mostra esta informação\n" +" -v -V --version Mostra a versão do programa\n" + +#: sysdump.c:51 +msgid "*undefined*" +msgstr "*indefinido*" + +#: sysdump.c:57 +msgid "*corrupt*" +msgstr "*corrupto*" + +#: sysdump.c:125 +#, c-format +msgid "SUM IS %x\n" +msgstr "SOMA É %x\n" + +#. PR 17512: file: id:000001,src:000002,op:flip1,pos:45. +#. Prevent infinite loops re-reading beyond the end of the buffer. +#: sysdump.c:161 +msgid "ICE: getINT: Out of buffer space" +msgstr "ICE: getINT: sem espaço de buffer" + +#: sysdump.c:185 +#, c-format +msgid "Unsupported read size: %d" +msgstr "Tamanho de leitura não suportado: %d" + +#: sysdump.c:496 +#, c-format +msgid "GOT A %x\n" +msgstr "OBTIDO %x\n" + +#: sysdump.c:514 +#, c-format +msgid "WANTED %x!!\n" +msgstr "ESPERADO %x!!\n" + +#: sysdump.c:532 +msgid "SYMBOL INFO" +msgstr "INFORMAÇÃO DE SÍMBOLO" + +#: sysdump.c:550 +msgid "DERIVED TYPE" +msgstr "TIPO DERIVADO" + +#: sysdump.c:607 +msgid "MODULE***\n" +msgstr "MÓDULO***\n" + +#: sysdump.c:642 +#, c-format +msgid "Print a human readable interpretation of a SYSROFF object file\n" +msgstr "Imprimir uma interpretação legível de um ficheiro objecto SYSROFF\n" + +#: sysdump.c:643 +#, c-format +msgid "" +" The options are:\n" +" -h --help Display this information\n" +" -v --version Print the program's version number\n" +msgstr "" +" As opções são:\n" +" -h --help Mostra esta informação\n" +" -v --version Mostra a versão do programa\n" + +#: sysdump.c:711 +#, c-format +msgid "cannot open input file %s" +msgstr "impossível abrir o ficheiro de entrada %s" + +#: version.c:34 +#, c-format +msgid "Copyright (C) 2018 Free Software Foundation, Inc.\n" +msgstr "Copyright (C) 2018 Free Software Foundation, Inc.\n" + +#: version.c:35 +#, c-format +msgid "" +"This program is free software; you may redistribute it under the terms of\n" +"the GNU General Public License version 3 or (at your option) any later version.\n" +"This program has absolutely no warranty.\n" +msgstr "" +"This program is free software; you may redistribute it under the terms of\n" +"the GNU General Public License version 3 or (at your option) any later version.\n" +"This program has absolutely no warranty.\n" + +#: windmc.c:189 +#, c-format +msgid "can't create %s file `%s' for output.\n" +msgstr "impossível criar o ficheiro %s \"%s\" para saída.\n" + +#: windmc.c:197 +#, c-format +msgid "Usage: %s [option(s)] [input-file]\n" +msgstr "Uso: %s [opções] [ficheiro de entrada]\n" + +#: windmc.c:199 +#, c-format +msgid "" +" The options are:\n" +" -a --ascii_in Read input file as ASCII file\n" +" -A --ascii_out Write binary messages as ASCII\n" +" -b --binprefix .bin filename is prefixed by .mc filename_ for uniqueness.\n" +" -c --customflag Set custom flags for messages\n" +" -C --codepage_in= Set codepage when reading mc text file\n" +" -d --decimal_values Print values to text files decimal\n" +" -e --extension= Set header extension used on export header file\n" +" -F --target Specify output target for endianness.\n" +" -h --headerdir= Set the export directory for headers\n" +" -u --unicode_in Read input file as UTF16 file\n" +" -U --unicode_out Write binary messages as UFT16\n" +" -m --maxlength= Set the maximal allowed message length\n" +" -n --nullterminate Automatic add a zero termination to strings\n" +" -o --hresult_use Use HRESULT definition instead of status code definition\n" +" -O --codepage_out= Set codepage used for writing text file\n" +" -r --rcdir= Set the export directory for rc files\n" +" -x --xdbg= Where to create the .dbg C include file\n" +" that maps message ID's to their symbolic name.\n" +msgstr "" +" As opções são:\n" +" -a --ascii_in Lê o ficheiro de entrada como ASCII\n" +" -A --ascii_out Escreve mensagens binárias como ASCII\n" +" -b --binprefix .nome do ficheiro binário prefixado por .mc para exclusividade.\n" +" -c --customflag Define bandeiras personalizadas para as mensagens\n" +" -C --codepage_in= Define a codepage ao ler um ficheiro de texto mc\n" +" -d --decimal_values Imprime valores para ficheiros de texto decimal\n" +" -e --extension= Define extensão do cabeçalho usada em ficheiro de exportação de cabeçalho\n" +" -F --target Especifica destino de saída para endianness.\n" +" -h --headerdir= Define a pasta de exportação para cabeçalhos\n" +" -u --unicode_in Lê ficheiro de entrada como UTF16\n" +" -U --unicode_out Escreve mensagens binárias como UFT16\n" +" -m --maxlength= Define o tamanho máximo permitido da mensagem\n" +" -n --nullterminate Adicionar final zero a cadeias automaticamente\n" +" -o --hresult_use Usa definição HRESULT em vez da definição de código de estado\n" +" -O --codepage_out= Define a codepage usada para escrever um ficheiro de texto\n" +" -r --rcdir= Define a pasta de exportação para ficheiros rc\n" +" -x --xdbg= Onde criar o ficheiro C include .dbg\n" +" que mapeia IDs de mensagens para o seu nome simbólico.\n" + +#: windmc.c:219 +#, c-format +msgid "" +" -H --help Print this help message\n" +" -v --verbose Verbose - tells you what it's doing\n" +" -V --version Print version information\n" +msgstr "" +" -H --help Mostra esta informação\n" +" -v --verbose Mostra o que está a fazer\n" +" -V --version Mostra a versão do programa\n" + +#: windmc.c:260 windres.c:404 +#, c-format +msgid "%s: warning: " +msgstr "%s: aviso - " + +#: windmc.c:261 +#, c-format +msgid "A codepage was specified switch `%s' and UTF16.\n" +msgstr "Foi especificada uma codepage que muda \"%s\" e UTF16.\n" + +#: windmc.c:262 +#, c-format +msgid "\tcodepage settings are ignored.\n" +msgstr "\tdefinições de codepage são ignoradas.\n" + +#: windmc.c:306 +msgid "try to add a ill language." +msgstr "tentou adicionar um idioma ilógico" + +#: windmc.c:1116 +#, c-format +msgid "unable to open file `%s' for input.\n" +msgstr "impossível abrir o ficheiro \"%s\" para entrada.\n" + +#: windmc.c:1124 +#, c-format +msgid "unable to read contents of %s" +msgstr "impossível ler conteúdo de %s" + +#: windmc.c:1136 +msgid "input file does not seems to be UFT16.\n" +msgstr "o ficheiro de entrada não parece ser UTF16.\n" + +#: windres.c:214 +#, c-format +msgid "can't open %s `%s': %s" +msgstr "impossível abrir %s \"%s\": %s" + +#: windres.c:383 +#, c-format +msgid ": expected to be a directory\n" +msgstr ": esperado como sendo uma pasta\n" + +#: windres.c:395 +#, c-format +msgid ": expected to be a leaf\n" +msgstr ": esperado como sendo uma folha\n" + +#: windres.c:406 +#, c-format +msgid ": duplicate value\n" +msgstr ": valor duplicado\n" + +#: windres.c:556 +#, c-format +msgid "unknown format type `%s'" +msgstr "tipo de formato \"%s\" desconhecido" + +#: windres.c:557 +#, c-format +msgid "%s: supported formats:" +msgstr "%s: formatos suportados:" + +#. Otherwise, we give up. +#: windres.c:640 +#, c-format +msgid "can not determine type of file `%s'; use the -J option" +msgstr "impossível determinar o tipo de ficheiro %s; use a opção -J" + +#: windres.c:652 +#, c-format +msgid "Usage: %s [option(s)] [input-file] [output-file]\n" +msgstr "Uso: %s [opções] [ficheiro de entrada] [ficheiro de saída]\n" + +#: windres.c:654 +#, c-format +msgid "" +" The options are:\n" +" -i --input= Name input file\n" +" -o --output= Name output file\n" +" -J --input-format= Specify input format\n" +" -O --output-format= Specify output format\n" +" -F --target= Specify COFF target\n" +" --preprocessor= Program to use to preprocess rc file\n" +" --preprocessor-arg= Additional preprocessor argument\n" +" -I --include-dir= Include directory when preprocessing rc file\n" +" -D --define [=] Define SYM when preprocessing rc file\n" +" -U --undefine Undefine SYM when preprocessing rc file\n" +" -v --verbose Verbose - tells you what it's doing\n" +" -c --codepage= Specify default codepage\n" +" -l --language= Set language when reading rc file\n" +" --use-temp-file Use a temporary file instead of popen to read\n" +" the preprocessor output\n" +" --no-use-temp-file Use popen (default)\n" +msgstr "" +" As opções são:\n" +" -i --input= Nome do ficheiro de entrada\n" +" -o --output= Nome do ficheiro de saída\n" +" -J --input-format= Especifica o formato de entrada\n" +" -O --output-format= Especifica o formato de saída\n" +" -F --target= Especifica o destino COFF\n" +" --preprocessor= Programa a usar para pré-processar ficheiros rc file\n" +" --preprocessor-arg= Argumento adicional de pré-processamento\n" +" -I --include-dir= Inclui ao pré-processar ficheiros rc\n" +" -D --define [=] Define ao pré-processar ficheiros rc\n" +" -U --undefine Remove definição de ao pré-processar ficheiros rc\n" +" -v --verbose Mostra o que está a fazer\n" +" -c --codepage= Especifica a codepage predefinida\n" +" -l --language= Define o idioma ao ler ficheiros rc\n" +" --use-temp-file Usa um ficheiro temporário em vez de popen para ler\n" +" a saída do pré-processador\n" +" --no-use-temp-file Usa popen (predefinição)\n" + +#: windres.c:672 +#, c-format +msgid " --yydebug Turn on parser debugging\n" +msgstr " --yydebug Liga o depurador do analisador\n" + +#: windres.c:675 +#, c-format +msgid "" +" -r Ignored for compatibility with rc\n" +" @ Read options from \n" +" -h --help Print this help message\n" +" -V --version Print version information\n" +msgstr "" +" -r Ignorada para compatibilidade com rc\n" +" @ Lê opções de \n" +" -h --help Mostra esta informação\n" +" -V --version Mostra a versão do programa\n" + +#: windres.c:680 +#, c-format +msgid "" +"FORMAT is one of rc, res, or coff, and is deduced from the file name\n" +"extension if not specified. A single file name is an input file.\n" +"No input-file is stdin, default rc. No output-file is stdout, default rc.\n" +msgstr "" +"FORMATO é um de rc, res, ou coff e é deduzido da extensão do ficheiro\n" +"se não for especificado. Um único nome de ficheiro é um ficheiro de entrada.\n" +"Sem nome de ficheiro é stdin, predefinição rc. Sem ficheiro de saída é stdout, predefinição rc.\n" + +#: windres.c:844 +msgid "invalid codepage specified.\n" +msgstr "codepage inválida especificada.\n" + +#: windres.c:859 +msgid "invalid option -f\n" +msgstr "opção inválida -f\n" + +#: windres.c:864 +msgid "No filename following the -fo option.\n" +msgstr "Sem nome de ficheiro a seguir à opção -fo\n" + +#: windres.c:953 +#, c-format +msgid "Option -I is deprecated for setting the input format, please use -J instead.\n" +msgstr "A opção -I é obsoleta para definir o formato de entrada, por favor use antes -J.\n" + +#: windres.c:1066 +msgid "no resources" +msgstr "sem recursos" + +#: wrstabs.c:353 wrstabs.c:1914 +#, c-format +msgid "string_hash_lookup failed: %s" +msgstr "falha em string_hash_lookup: %s" + +#: wrstabs.c:636 +#, c-format +msgid "stab_int_type: bad size %u" +msgstr "stab_int_type: mau tamanho %u" + +#: wrstabs.c:1392 +#, c-format +msgid "%s: warning: unknown size for field `%s' in struct" +msgstr "%s: aviso - tamanho desconhecido para o campo \"%s\" em struct" diff --git a/binutils/readelf.c b/binutils/readelf.c index ae1cda9..e3af50a 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -655,7 +655,8 @@ find_section (Filedata * filedata, const char * name) { unsigned int i; - assert (filedata->section_headers != NULL); + if (filedata->section_headers == NULL) + return NULL; for (i = 0; i < filedata->file_header.e_shnum; i++) if (streq (SECTION_NAME (filedata->section_headers + i), name)) @@ -672,6 +673,9 @@ find_section_by_address (Filedata * filedata, bfd_vma addr) { unsigned int i; + if (filedata->section_headers == NULL) + return NULL; + for (i = 0; i < filedata->file_header.e_shnum; i++) { Elf_Internal_Shdr *sec = filedata->section_headers + i; @@ -688,6 +692,9 @@ find_section_by_type (Filedata * filedata, unsigned int type) { unsigned int i; + if (filedata->section_headers == NULL) + return NULL; + for (i = 0; i < filedata->file_header.e_shnum; i++) { Elf_Internal_Shdr *sec = filedata->section_headers + i; @@ -707,6 +714,9 @@ find_section_in_set (Filedata * filedata, const char * name, unsigned int * set) { unsigned int i; + if (filedata->section_headers == NULL) + return NULL; + if (set != NULL) { while ((i = *set++) > 0) diff --git a/binutils/strings.c b/binutils/strings.c index da044ac..7655ab6 100644 --- a/binutils/strings.c +++ b/binutils/strings.c @@ -125,7 +125,7 @@ static struct option long_options[] = {"print-file-name", no_argument, NULL, 'f'}, {"bytes", required_argument, NULL, 'n'}, {"radix", required_argument, NULL, 't'}, - {"include-all-whitespace", required_argument, NULL, 'w'}, + {"include-all-whitespace", no_argument, NULL, 'w'}, {"encoding", required_argument, NULL, 'e'}, {"target", required_argument, NULL, 'T'}, {"output-separator", required_argument, NULL, 's'}, diff --git a/binutils/testsuite/binutils-all/group-7.s b/binutils/testsuite/binutils-all/group-7.s new file mode 100644 index 0000000..5028afc --- /dev/null +++ b/binutils/testsuite/binutils-all/group-7.s @@ -0,0 +1,6 @@ + .section .data.foo,"awG",%progbits,foo,comdat +here: + .dc.a here + + .section .data2.foo,"awG",%progbits,foo,comdat + .dc.a 0 diff --git a/binutils/testsuite/binutils-all/group-7a.d b/binutils/testsuite/binutils-all/group-7a.d new file mode 100644 index 0000000..fa8db60 --- /dev/null +++ b/binutils/testsuite/binutils-all/group-7a.d @@ -0,0 +1,16 @@ +#name: copy removing reloc group member +#source: group-7.s +#PROG: objcopy +#DUMPPROG: readelf +#objcopy: --remove-section .data.foo +#readelf: -Sg --wide + +#... + \[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.* +#... + \[[ 0-9]+\] \.data2\.foo[ \t]+PROGBITS[ \t0-9a-f]+WAG.* +#... +COMDAT group section \[[ 0-9]+\] `\.group' \[foo\] contains 1 section.* + \[Index\] Name + \[[ 0-9]+\] \.data2\.foo +#pass diff --git a/binutils/testsuite/binutils-all/group-7b.d b/binutils/testsuite/binutils-all/group-7b.d new file mode 100644 index 0000000..b674545 --- /dev/null +++ b/binutils/testsuite/binutils-all/group-7b.d @@ -0,0 +1,19 @@ +#name: copy removing non-reloc group member +#source: group-7.s +#PROG: objcopy +#DUMPPROG: readelf +#objcopy: --remove-section .data2.foo +#readelf: -Sg --wide + +#... + \[[ 0-9]+\] \.group[ \t]+GROUP[ \t]+.* +#... + \[[ 0-9]+\] \.data\.foo[ \t]+PROGBITS[ \t0-9a-f]+WAG.* +#... + \[[ 0-9]+\] \.rela?\.data\.foo[ \t]+RELA?[ \t0-9a-f]+IG.* +#... +COMDAT group section \[[ 0-9]+\] `\.group' \[foo\] contains 2 sections: + \[Index\] Name + \[[ 0-9]+\] \.data\.foo + \[[ 0-9]+\] \.rela?\.data\.foo +#pass diff --git a/binutils/testsuite/binutils-all/group-7c.d b/binutils/testsuite/binutils-all/group-7c.d new file mode 100644 index 0000000..83e9115 --- /dev/null +++ b/binutils/testsuite/binutils-all/group-7c.d @@ -0,0 +1,8 @@ +#name: copy removing reloc and non-reloc group member +#source: group-7.s +#PROG: objcopy +#DUMPPROG: readelf +#objcopy: -R .data.foo -R .data2.foo +#readelf: -g --wide + +There are no section groups in this file\. diff --git a/binutils/testsuite/binutils-all/mips/mips-reginfo-n32.d b/binutils/testsuite/binutils-all/mips/mips-reginfo-n32.d new file mode 100644 index 0000000..bb207d29 --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/mips-reginfo-n32.d @@ -0,0 +1,7 @@ +#PROG: objcopy +#name: MIPS objcopy .reginfo section size (n32) +#as: -n32 -mips3 +#objcopy: --rename-section .foo=.reginfo +#source: mips-reginfo.s +#error: \A[^\n]*: incorrect `\.reginfo' section size; expected 24, got 4\n +#error: [^\n]*: bad value\Z diff --git a/binutils/testsuite/binutils-all/mips/mips-reginfo.d b/binutils/testsuite/binutils-all/mips/mips-reginfo.d new file mode 100644 index 0000000..ff86a1e --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/mips-reginfo.d @@ -0,0 +1,6 @@ +#PROG: objcopy +#name: MIPS objcopy .reginfo section size +#as: -32 +#objcopy: --rename-section .foo=.reginfo +#error: \A[^\n]*: incorrect `\.reginfo' section size; expected 24, got 4\n +#error: [^\n]*: bad value\Z diff --git a/binutils/testsuite/binutils-all/mips/mips-reginfo.s b/binutils/testsuite/binutils-all/mips/mips-reginfo.s new file mode 100644 index 0000000..75eaa94 --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/mips-reginfo.s @@ -0,0 +1,2 @@ + .section .foo, "a" + .word 0xdeadbeef diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp index be6e785..2167d4a 100644 --- a/binutils/testsuite/binutils-all/mips/mips.exp +++ b/binutils/testsuite/binutils-all/mips/mips.exp @@ -60,3 +60,8 @@ if $has_newabi { run_dump_test "mips-note-2r-n32" run_dump_test "mips-note-2r-n64" } + +run_dump_test "mips-reginfo" +if $has_newabi { + run_dump_test "mips-reginfo-n32" +} diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp index 377f88c..f7b811c 100644 --- a/binutils/testsuite/binutils-all/objcopy.exp +++ b/binutils/testsuite/binutils-all/objcopy.exp @@ -1051,6 +1051,9 @@ if [is_elf_format] { objcopy_test_readelf "GNU_MBIND section" mbind1.s run_dump_test "group-5" run_dump_test "group-6" + run_dump_test "group-7a" + run_dump_test "group-7b" + run_dump_test "group-7c" run_dump_test "copy-1" run_dump_test "note-1" if [is_elf64 tmpdir/bintest.o] { @@ -1081,6 +1084,8 @@ if [is_elf_format] { run_dump_test "strip-8" run_dump_test "strip-9" run_dump_test "strip-12" + run_dump_test "strip-13" + # This requires STB_GNU_UNIQUE support with OSABI set to GNU. if { [supports_gnu_unique] } { run_dump_test "strip-10" diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp index 6fc5070..45a022a 100644 --- a/binutils/testsuite/binutils-all/readelf.exp +++ b/binutils/testsuite/binutils-all/readelf.exp @@ -324,6 +324,8 @@ if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then { unresolved "readelf -S bintest (failed to assemble)" unresolved "readelf -s bintest (failed to assemble)" unresolved "readelf -r bintest (failed to assemble)" + global readelf_size + set readelf_size "" } else { if ![is_remote host] { diff --git a/binutils/testsuite/binutils-all/strip-13.d b/binutils/testsuite/binutils-all/strip-13.d new file mode 100644 index 0000000..a34e1eb --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-13.d @@ -0,0 +1,9 @@ +#PROG: strip +#strip: -g +#error: .* bad value +#not-target: arm-* d10v-* dlx-* h8300-* hppa*-* ip2k-* rx-* xgate-* +# The D10V, DLX and XGATE targets only support REL relocations but this test uses RELA relocations. +# The ARM target does support both types, but defaults to REL. +# The HPPA targets use reloc 241, which is the value this test uses as its "unknown" reloc. +# The H8300-*, IP2K and RX targets do not complain about unrecognised relocs, unless they are actually used +# (which is what should really happen with the other targets...) diff --git a/binutils/testsuite/binutils-all/strip-13.s b/binutils/testsuite/binutils-all/strip-13.s new file mode 100644 index 0000000..5da2426 --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-13.s @@ -0,0 +1,12 @@ + .text +foo: + .dc.l 0x12345678 + + .section .rela.text + .dc.a 0 + .dc.a 0x000000f1 + .dc.a 0x000000f1 + + .dc.a 0 + .dc.a 0 + .dc.a 0 diff --git a/binutils/testsuite/config/default.exp b/binutils/testsuite/config/default.exp index 3c1b22d..c5acd46 100644 --- a/binutils/testsuite/config/default.exp +++ b/binutils/testsuite/config/default.exp @@ -112,6 +112,7 @@ if {[file isfile tmpdir/gas/as[exe_ext]]} then { # binutils_run # run a program, returning the output # sets binutils_run_failed if the program does not exist +# sets binutils_run_status to the exit status of the program # proc binutils_run { prog progargs } { default_binutils_run $prog $progargs diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp index c827ab1..cb12112 100644 --- a/binutils/testsuite/lib/utils-lib.exp +++ b/binutils/testsuite/lib/utils-lib.exp @@ -51,12 +51,17 @@ proc binutil_version { prog } { # default_binutils_run # run a program, returning the output # sets binutils_run_failed if the program does not exist +# sets binutils_run_status to the exit status of the program # proc default_binutils_run { prog progargs } { global binutils_run_failed + global binutils_run_status global host_triplet set binutils_run_failed 0 + if [info exists binutils_run_status] { + unset binutils_run_status + } if ![is_remote host] { if {[which $prog] == 0} then { @@ -83,6 +88,7 @@ proc default_binutils_run { prog progargs } { regsub -all "\\$" "$progargs" "\\$" progargs set state [remote_exec host $prog $progargs] + set binutils_run_status [lindex $state 0] set exec_output [prune_warnings [lindex $state 1]] if {![string match "" $exec_output]} then { send_log "$exec_output\n" @@ -241,22 +247,22 @@ proc exe_ext {} { # # error: REGEX # An error with message matching REGEX must be emitted for the test -# to pass. The PROG, objdump, nm and objcopy options have no -# meaning and need not supplied if this is present. +# to pass. The DUMPPROG, addr2line, nm, objdump, readelf and size +# options have no meaning and need not supplied if this is present. +# Multiple "error" directives append to the expected error message. # -# warning: REGEX -# Expect a gas warning matching REGEX. It is an error to issue -# both "error" and "warning". +# error_output: FILE +# Means the same as 'error', except the regular expression lines +# are contains in FILE. # -# stderr: FILE -# FILE contains regexp lines to be matched against the diagnostic -# output of the assembler. This does not preclude the use of -# PROG, nm, objdump, or objcopy. +# warning: REGEX +# Expect a warning matching REGEX. It is an error to issue both +# "error" and "warning". Multiple "warning" directives append to +# the expected linker warning message. # -# error-output: FILE -# Means the same as 'stderr', but also indicates that the assembler -# is expected to exit unsuccessfully (therefore PROG, objdump, nm, -# and objcopy have no meaning and should not be supplied). +# warning_output: FILE +# Means the same as 'warning', except the regular expression +# lines are contains in FILE. # # Each option may occur at most once. # @@ -270,6 +276,7 @@ proc run_dump_test { name {extra_options {}} } { global OBJDUMP NM OBJCOPY READELF STRIP global OBJDUMPFLAGS NMFLAGS OBJCOPYFLAGS READELFFLAGS STRIPFLAGS global ELFEDIT ELFEDITFLAGS + global binutils_run_status global host_triplet global env global copyfile @@ -304,6 +311,10 @@ proc run_dump_test { name {extra_options {}} } { set opts(DUMPPROG) {} set opts(source) {} set opts(dump) {} + set opts(error) {} + set opts(warning) {} + set opts(error_output) {} + set opts(warning_output) {} set opts(target) {} set opts(not-target) {} set opts(skip) {} @@ -322,12 +333,18 @@ proc run_dump_test { name {extra_options {}} } { # directory. regsub -all "\\\$srcdir" "$opt_val" "$srcdir/$subdir" opt_val - if [string length $opts($opt_name)] { - perror "option $opt_name multiply set in $file.d" - unresolved $subdir/$name - return + switch -- $opt_name { + warning {} + error {} + default { + if [string length $opts($opt_name)] { + perror "option $opt_name multiply set in $file.d" + unresolved $subdir/$name + return + } + } } - set opts($opt_name) $opt_val + append opts($opt_name) $opt_val } foreach i $extra_options { @@ -345,7 +362,8 @@ proc run_dump_test { name {extra_options {}} } { # add extra option to end of existing option, adding space # if necessary. - if [string length $opts($opt_name)] { + if { ![regexp "warning|error" $opt_name] + && [string length $opts($opt_name)] } { append opts($opt_name) " " } append opts($opt_name) $opt_val @@ -383,28 +401,35 @@ proc run_dump_test { name {extra_options {}} } { } set dumpprogram "" - if { $opts(DUMPPROG) != "" } { - switch -- $opts(DUMPPROG) { - addr2line { set dumpprogram addr2line } - nm { set dumpprogram nm } - objdump { set dumpprogram objdump } - readelf { set dumpprogram readelf } - size { set dumpprogram size } - default { - perror "unrecognized dump program option $opts(DUMPPROG) in $file.d" - unresolved $testname - return } - } - } else { - # Guess which program to run, by seeing which option was specified. - foreach p {addr2line nm objdump readelf size} { - if {$opts($p) != ""} { - if {$dumpprogram != ""} { - perror "more than one possible dump program specified in $file.d" + # It's meaningless to require an output-testing method when we + # expect an error. + if { $opts(error) == "" && $opts(error_output) == "" } { + if { $opts(DUMPPROG) != "" } { + switch -- $opts(DUMPPROG) { + addr2line { set dumpprogram addr2line } + nm { set dumpprogram nm } + objdump { set dumpprogram objdump } + readelf { set dumpprogram readelf } + size { set dumpprogram size } + default { + perror "unrecognized dump program option $opts(DUMPPROG)\ + in $file.d" unresolved $testname return - } else { - set dumpprogram $p + } + } + } else { + # Guess which program to run, by seeing which option was specified. + foreach p {addr2line nm objdump readelf size} { + if {$opts($p) != ""} { + if {$dumpprogram != ""} { + perror "more than one possible dump program specified\ + in $file.d" + unresolved $testname + return + } else { + set dumpprogram $p + } } } } @@ -487,16 +512,95 @@ proc run_dump_test { name {extra_options {}} } { } } + if { (($opts(warning) != "") && ($opts(error) != "")) \ + || (($opts(warning) != "") && ($opts(error_output) != "")) \ + || (($opts(warning) != "") && ($opts(warning_output) != "")) \ + || (($opts(error) != "") && ($opts(warning_output) != "")) \ + || (($opts(error) != "") && ($opts(error_output) != "")) \ + || (($opts(warning_output) != "") && ($opts(error_output) != "")) } { + perror "bad mix of warning, error, warning_output, and error_output\ + test-directives" + unresolved $testname + return + } + + set check_prog(source) "" + set check_prog(terminal) 0 + if { $opts(error) != "" \ + || $opts(warning) != "" \ + || $opts(error_output) != "" \ + || $opts(warning_output) != "" } { + + if { $opts(error) != "" || $opts(error_output) != "" } { + set check_prog(terminal) 1 + } else { + set check_prog(terminal) 0 + } + + if { $opts(error) != "" || $opts(warning) != "" } { + set check_prog(source) "regex" + if { $opts(error) != "" } { + set check_prog(regex) $opts(error) + } else { + set check_prog(regex) $opts(warning) + } + } else { + set check_prog(source) "file" + if { $opts(error_output) != "" } { + set check_prog(file) $opts(error_output) + } else { + set check_prog(file) $opts(warning_output) + } + } + } + set progopts1 $opts($program) eval set progopts \$[string toupper $program]FLAGS eval set binary \$[string toupper $program] set exec_output [binutils_run $binary "$progopts $progopts1 $tempfile $destopt ${copyfile}.o"] - if ![string match "" $exec_output] { - send_log "$exec_output\n" + set cmdret 0 + if [info exists binutils_run_status] { + set cmdret $binutils_run_status + } + + regsub "\n$" $exec_output "" exec_output + if { $cmdret != 0 || $exec_output != "" || $check_prog(source) != "" } { + set exitstat "succeeded" + if { $cmdret != 0 } { + set exitstat "failed" + } + + if { $check_prog(source) == "regex" } { + verbose -log "$exitstat with: <$exec_output>,\ + expected: <$check_prog(regex)>" + } elseif { $check_prog(source) == "file" } { + verbose -log "$exitstat with: <$exec_output>,\ + expected in file $check_prog(file)" + set_file_contents "tmpdir/prog.messages" "$exec_output" + } else { + verbose -log "$exitstat with: <$exec_output>, no expected output" + } + send_log -- "$exec_output\n" verbose "$exec_output" - fail $testname - return + + if { (($check_prog(source) == "") == ($exec_output == "")) \ + && (($cmdret == 0) == ($check_prog(terminal) == 0)) \ + && ((($check_prog(source) == "regex") \ + && ($check_prog(regex) == "") == ($exec_output == "") \ + && [regexp -- $check_prog(regex) $exec_output]) \ + || (($check_prog(source) == "file") \ + && (![regexp_diff "tmpdir/prog.messages" \ + "$srcdir/$subdir/$check_prog(file)"]))) } { + # We have the expected output from prog. + if { $check_prog(terminal) || $program == "" } { + pass $testname + return + } + } else { + fail $testname + return + } } set progopts1 $opts($dumpprogram) diff --git a/config/ChangeLog b/config/ChangeLog index 5e75dc3..721c47e 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2018-02-06 Eric Botcazou + + * gcc-plugin.m4 (GCC_ENABLE_PLUGINS): Remove -q option passed to grep. + 2018-01-10 Nick Clifton * Sync with GCC sources: diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4 index 38b2ae6..8f27871 100644 --- a/config/gcc-plugin.m4 +++ b/config/gcc-plugin.m4 @@ -60,14 +60,14 @@ AC_DEFUN([GCC_ENABLE_PLUGINS], if test "x$export_sym_check" != x; then echo "int main() {return 0;} int foobar() {return 0;}" > conftest.c ${CC} ${CFLAGS} ${LDFLAGS} conftest.c -o conftest$ac_exeext > /dev/null 2>&1 - if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then + if $export_sym_check conftest$ac_exeext | grep foobar > /dev/null; then : # No need to use a flag AC_MSG_RESULT([yes]) else AC_MSG_RESULT([yes]) AC_MSG_CHECKING([for -rdynamic]) ${CC} ${CFLAGS} ${LDFLAGS} -rdynamic conftest.c -o conftest$ac_exeext > /dev/null 2>&1 - if $export_sym_check conftest$ac_exeext | grep -q foobar > /dev/null; then + if $export_sym_check conftest$ac_exeext | grep foobar > /dev/null; then plugin_rdynamic=yes pluginlibs="-rdynamic" else diff --git a/configure b/configure index 2d615a9..0601395 100755 --- a/configure +++ b/configure @@ -3860,6 +3860,9 @@ case "${target}" in vax-*-*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; + wasm32-*-*) + noconfigdirs="$noconfigdirs ld" + ;; esac # If we aren't building newlib, then don't build libgloss, since libgloss diff --git a/configure.ac b/configure.ac index aae9450..c343333 100644 --- a/configure.ac +++ b/configure.ac @@ -1191,6 +1191,9 @@ case "${target}" in vax-*-*) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; + wasm32-*-*) + noconfigdirs="$noconfigdirs ld" + ;; esac # If we aren't building newlib, then don't build libgloss, since libgloss diff --git a/cpu/ChangeLog b/cpu/ChangeLog index 74156f8..5581d87 100644 --- a/cpu/ChangeLog +++ b/cpu/ChangeLog @@ -1,3 +1,10 @@ +2018-03-03 Alan Modra + + * frv.opc: Include opintl.h. + (add_next_to_vliw): Use opcodes_error_handler to print error. + Standardize error message. + (fr500_check_insn_major_constraints, frv_vliw_add_insn): Likewise. + 2018-01-13 Nick Clifton 2.30 branch created. diff --git a/cpu/frv.opc b/cpu/frv.opc index 869155d..1b0b05c 100644 --- a/cpu/frv.opc +++ b/cpu/frv.opc @@ -78,6 +78,7 @@ int spr_valid (long); /* -- */ /* -- opc.c */ +#include "opintl.h" #include "elf/frv.h" #include @@ -500,9 +501,9 @@ add_next_to_vliw (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE unit) if (next <= 0) { - fprintf (stderr, "frv-opc.c line %d: bad vliw->next_slot value.\n", - __LINE__); - abort (); /* Should never happen. */ + /* xgettext:c-format */ + opcodes_error_handler (_("internal error: bad vliw->next_slot value")); + abort (); } /* The table is sorted by units allowed within slots, so vliws with @@ -810,8 +811,8 @@ fr500_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE ma && ! find_major_in_vliw (vliw, FR500_MAJOR_F_6) && ! find_major_in_vliw (vliw, FR500_MAJOR_F_7); default: - fprintf (stderr, "frv-opc.c, line %d: bad major code, aborting.\n", - __LINE__); + /* xgettext:c-format */ + opcodes_error_handler (_("internal error: bad major code")); abort (); break; } @@ -860,9 +861,9 @@ frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn) unit = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_UNIT); if (unit == UNIT_NIL) { - fprintf (stderr, "frv-opc.c line %d: bad insn unit.\n", - __LINE__); - abort (); /* No UNIT specified for this insn in frv.cpu. */ + /* xgettext:c-format */ + opcodes_error_handler (_("internal error: bad insn unit")); + abort (); } switch (vliw->mach) diff --git a/gas/ChangeLog b/gas/ChangeLog index 98a09cd..d8f5892 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,28 +1,534 @@ -2018-01-27 Nick Clifton +2018-03-02 Thomas Preud'homme + + * config/tc-arm.c (md_begin): Add NULL pointer check before + dereferencing march_ext_opt. + +2018-03-01 Thomas Preud'homme + + * config/tc-arm.c (cpu_variant, arm_arch_used, thumb_arch_used, + legacy_cpu, legacy_fpu, mcpu_cpu_opt, dyn_mcpu_ext_opt, + mcpu_fpu_opt, march_cpu_opt, dyn_march_ext_opt, march_fpu_opt, + mfpu_opt, object_arch, selected_cpu): Comment meaning of variables. + (dyn_mcpu_ext_opt): Also rename into ... + (mcpu_ext_opt): This. + (dyn_march_ext_opt): Also rename into ... + (march_ext_opt): This. + (object_arch): Also rename into ... + (selected_object_arch): This and make it a plain arm_feature_set + structure. + (selected_arch, selected_ext, selected_fpu): New static variables. + (mark_feature_used): Fix comments, feature is marked as used iff it is + currently allowed. + (do_bx): Adapt to change in name and type of object_arch. + (md_begin): Set selected_arch rather than mcpu_cpu_opt, selected_ext + rather than dyn_mcpu_ext_opt and selected_fpu rather than mfpu_opt. + Remove dead code to set default FPU if architecture version is greater + than 5. Set all CPU bits of cpu_variant directly in autodection + leaving mcpu_cpu_opt, selected_arch and selected_cpu unset. + (arm_parse_extension): Take extension feature set pointer parameter by + value rather than by pointer. Remove allocation code. Adapt code + accordingly. + (arm_parse_cpu): Adapt to variable renaming and changes in + arm_parse_extension () signature. + (arm_parse_arch): Likewise. + (aeabi_set_public_attributes): Also set selected_arch and selected_ext + in addition to selected_cpu. Set flags_arch and flags_ext from them + instead of selected_cpu. Adapt to variables renaming and type change. + (arm_md_post_relax): Adapt to variable renaming. + (s_arm_cpu): Set selcted_cpu_cpu and selected_ext instead of + mcpu_cpu_opt and dyn_mcpu_ext_opt. Set selected_cpu from them and + cpu_variant from selected_cpu and selected_fpu. + (s_arm_arch): Likewise. + (s_arm_object_arch): Adapt to variable renaming. + (s_arm_arch_extension): Use ARM_CPU_IS_ANY instead of checking feature + set against arm_any. Check selected_arch rather than *mcpu_cpu_opt. + Set selected_ext rather than *dyn_mcpu_ext_opt and remove allocation + code. + (s_arm_fpu): Set selected_fpu instead of mfpu_opt. Set all CPU feature + bits if in autodetection mode. + +2018-03-01 H.J. Lu + + * config/tc-i386.c (optimize_encoding): Optimize AVX256 and + AVX512 vpsub[bwdq] instructions. + * testsuite/gas/i386/optimize-1.s: Add tests for AVX256 and + AVX512 vpsub[bwdq] instructions. + * testsuite/gas/i386/x86-64-optimize-2.s: Likewise. + * testsuite/gas/i386/optimize-1.d: Updated. + * testsuite/gas/i386/x86-64-optimize-2.d: Likewise. + +2018-03-01 Alan Modra + + * configure.ac (ALL_LINGUAS): Add uk. Sort. + * configure: Regenerate. - This is the 2.30 release: +2018-02-27 H.J. Lu + + * NEWS: Rename .nop to .nops. + * doc/as.texinfo: Likewise. + * read.c (potable): Add "nops". Remove "nop". + (s_nop): Renamed to ... + (s_nops): This. + * read.h (s_nop): Renamed to ... + (s_nops): This. + * write.c (cvt_frag_to_fill): Rename .nop to .nops. + (md_generate_nops): Likewise. + (relax_segment): Likewise. + * testsuite/gas/i386/nop-1.d: Updated. + * testsuite/gas/i386/nop-1.s: Likewise. + * testsuite/gas/i386/nop-2.d: Likewise. + * testsuite/gas/i386/nop-2.s: Likewise. + * testsuite/gas/i386/nop-3.d: Likewise. + * testsuite/gas/i386/nop-3.s: Likewise. + * testsuite/gas/i386/nop-4.d: Likewise. + * testsuite/gas/i386/nop-4.s: Likewise. + * testsuite/gas/i386/nop-5.d: Likewise. + * testsuite/gas/i386/nop-5.s: Likewise. + * testsuite/gas/i386/nop-6.d: Likewise. + * testsuite/gas/i386/nop-6.s: Likewise. + * testsuite/gas/i386/nop-bad-1.l: Likewise. + * testsuite/gas/i386/nop-bad-1.s: Likewise. + * testsuite/gas/i386/x86-64-nop-1.d: Likewise. + * testsuite/gas/i386/x86-64-nop-2.d: Likewise. + * testsuite/gas/i386/x86-64-nop-3.d: Likewise. + * testsuite/gas/i386/x86-64-nop-4.d: Likewise. + * testsuite/gas/i386/x86-64-nop-5.d: Likewise. + * testsuite/gas/i386/x86-64-nop-6.d: Likewise. + +2018-02-27 H.J. Lu + + PR gas/22871 + * NEWS: Mention -O[2|s]. + * config/tc-i386.c (_i386_insn): Add no_optimize. + (optimize): New. + (optimize_for_space): Likewise. + (fits_in_imm7): New function. + (fits_in_imm31): Likewise. + (optimize_encoding): Likewise. + (md_assemble): Call optimize_encoding to optimize encoding. + (parse_insn): Handle {nooptimize}. + (md_shortopts): Append "O::". + (md_parse_option): Handle -On. + * doc/c-i386.texi: Document -O0, -O, -O1, -O2 and -Os as well + as {nooptimize}. + * testsuite/gas/cfi/cfi-x86_64.d: Pass -O0 to assembler. + * testsuite/gas/i386/ilp32/cfi/cfi-x86_64.d: Likewise. + * testsuite/gas/i386/i386.exp: Run optimize-1, optimize-2, + optimize-3, x86-64-optimize-1, x86-64-optimize-2, + x86-64-optimize-3 and x86-64-optimize-4. + * testsuite/gas/i386/optimize-1.d: New file. + * testsuite/gas/i386/optimize-1.s: Likewise. + * testsuite/gas/i386/optimize-2.d: Likewise. + * testsuite/gas/i386/optimize-2.s: Likewise. + * testsuite/gas/i386/optimize-3.d: Likewise. + * testsuite/gas/i386/optimize-3.s: Likewise. + * testsuite/gas/i386/x86-64-optimize-1.s: Likewise. + * testsuite/gas/i386/x86-64-optimize-1.d: Likewise. + * testsuite/gas/i386/x86-64-optimize-2.d: Likewise. + * testsuite/gas/i386/x86-64-optimize-2.s: Likewise. + * testsuite/gas/i386/x86-64-optimize-3.d: Likewise. + * testsuite/gas/i386/x86-64-optimize-3.s: Likewise. + * testsuite/gas/i386/x86-64-optimize-4.d: Likewise. + * testsuite/gas/i386/x86-64-optimize-4.s: Likewise. + +2018-02-27 Nick Clifton + + * po/ru.po: Updated Russian translation. + +2018-02-26 Maciej W. Rozycki + + * doc/as.texinfo (Pseudo Ops): Clean up `.dc' and `.ds' + descriptions. + +2018-02-26 Nick Clifton + + * doc/as.texinfo (Dc): Fix typo. + +2018-02-26 Alan Modra + + * testsuite/gas/mips/reginfo-2.l: Update. + +2018-02-23 Alan Modra + + * testsuite/gas/mips/reginfo-2.l: Update. + +2018-02-23 Nick Clifton + + * doc/as.texinfo (Pseudo Ops): Add nodes for .dc, .dcb and .ds. + +2018-02-23 Kuan-Lin Chen + + * config/tc-nds32.c (ict_model): New function. Hook new + directive .ict_model. + (nds32_insert_relax_entry): Tag the bits of entry relocation + for .ict_model. + +2018-02-22 H.J. Lu + + * config/tc-i386.c (_i386_insn): Add rex_encoding. + (md_assemble): When i.rex_encoding is true, generate a REX byte + if possible. + (parse_insn): Set i.rex_encoding for {rex}. + * doc/c-i386.texi: Document {rex}. + * testsuite/gas/i386/x86-64-pseudos.s: Add {rex} tests. + * testsuite/gas/i386/x86-64-pseudos.d: Updated. + +2018-02-22 A. Wilcox + + PR 22014 + * config/tc-mips.c (mips_lookup_insn): Use memmove to strip the + instruction size suffix. + +2018-02-20 Maciej W. Rozycki + + * testsuite/gas/mips/mips16-branch-reloc-4.d: New test. + * testsuite/gas/mips/mips16-branch-reloc-5.d: New test. + * testsuite/gas/mips/mips16-branch-reloc-4.s: New test source. + * testsuite/gas/mips/mips16-branch-reloc-5.s: New test source. + * testsuite/gas/mips/mips.exp: Run the new tests. + +2018-02-20 Max Filippov + + * config/tc-xtensa.c (struct litpool_frag): Add new field + literal_count. + (MAX_AUTO_POOL_LITERALS, MAX_EXPLICIT_POOL_LITERALS) + (MAX_POOL_LITERALS): New macro definitions. + (auto_litpool_limit): Initialize to 0. + (md_parse_option): Set auto_litpool_limit in the presence of + --auto-litpools option. + (xtensa_maybe_create_literal_pool_frag): Zero-initialize + literal_count field. + (xg_find_litpool): New function. Make sure that found literal + pool size is within the limit. + (xtensa_move_literals): Extract literal pool search code into + the new function. + * testsuite/gas/xtensa/all.exp: Add auto-litpools-2 test. + * testsuite/gas/xtensa/auto-litpools-2.d: New file. + * testsuite/gas/xtensa/auto-litpools-2.s: New file. + * testsuite/gas/xtensa/auto-litpools.d: Fix up changed + addresses. + * testsuite/gas/xtensa/auto-litpools.s: Change literal value so + that objdump doesn't get out of sync. + +2018-02-20 Thomas Preud'homme + + * doc/c-arm.texi (.arch_extension): Mention extensions it accepts are + also the same as -march. + +2018-02-17 H.J. Lu + + * NEWS: Mention .nop directive. + * as.h (_relax_state): Add rs_space_nop and rs_fill_nop. + * read.c (potable): Add .nop. + (s_nop): New function. + * read.h (s_nop): New prototype. + * write.c (cvt_frag_to_fill): Handle rs_space_nop and + rs_fill_nop. + (md_generate_nops): New function. + (relax_segment): Likewise. + (write_contents): Use md_generate_nops for rs_fill_nop. + * config/tc-i386.c (alt64_11): New. + (alt64_patt): Likewise. + (md_convert_frag): Handle rs_space_nop. + (i386_output_nops): New function. + (i386_generate_nops): Likewise. + (i386_align_code): Call i386_output_nops. + * config/tc-i386.h (i386_generate_nops): New. + (md_generate_nops): Likewise. + * doc/as.texinfo: Document .nop directive. + * testsuite/gas/i386/i386.exp: Run .nop directive tests. + * testsuite/gas/i386/nop-1.d: New file. + * testsuite/gas/i386/nop-1.s: Likewise. + * testsuite/gas/i386/nop-2.d: Likewise. + * testsuite/gas/i386/nop-2.s: Likewise. + * testsuite/gas/i386/nop-3.d: Likewise. + * testsuite/gas/i386/nop-3.s: Likewise. + * testsuite/gas/i386/nop-4.d: Likewise. + * testsuite/gas/i386/nop-4.s: Likewise. + * testsuite/gas/i386/nop-5.d: Likewise. + * testsuite/gas/i386/nop-5.s: Likewise. + * testsuite/gas/i386/nop-6.d: Likewise. + * testsuite/gas/i386/nop-6.s: Likewise. + * testsuite/gas/i386/nop-bad-1.l: Likewise. + * testsuite/gas/i386/nop-bad-1.s: Likewise. + * testsuite/gas/i386/x86-64-nop-1.d: Likewise. + * testsuite/gas/i386/x86-64-nop-2.d: Likewise. + * testsuite/gas/i386/x86-64-nop-3.d: Likewise. + * testsuite/gas/i386/x86-64-nop-4.d: Likewise. + * testsuite/gas/i386/x86-64-nop-5.d: Likewise. + * testsuite/gas/i386/x86-64-nop-6.d: Likewise. + +2018-02-15 Tamar Christina + + * config/tc-arm.c (cpu_arch_ver): Renumber ARM_ARCH_V8_4A. + * testsuite/gas/arm/attr-march-armv8_4-a.d: New. + +2018-02-13 Max Filippov + + * config/tc-xtensa.c (xg_find_best_trampoline): Skip trampoline + frag that contains source address. + +2018-02-13 Nick Clifton + + PR 22773 + * config/tc-arm.c (md_apply_fix): Test Rn field of Thumb ORR + instruction before assuming that it is a MOV instruction. + * testsuite/gas/arm/pr22773.s: New test. + * testsuite/gas/arm/pr22773.d: New test driver. + * testsuite/gas/arm/pr22773.l: New expected output. + +2018-02-13 H.J. Lu + + PR gas/22791 + * config/tc-i386.c (need_plt32_p): New function. + (output_jump): Generate BFD_RELOC_X86_64_PLT32 if possible. + (md_estimate_size_before_relax): Likewise. + * testsuite/gas/i386/reloc64.d: Updated. + * testsuite/gas/i386/x86-64-jump.d: Likewise. + * testsuite/gas/i386/x86-64-mpx-branch-1.d: Likewise. + * testsuite/gas/i386/x86-64-mpx-branch-2.d: Likewise. + * testsuite/gas/i386/x86-64-relax-2.d: Likewise. + * testsuite/gas/i386/x86-64-relax-3.d: Likewise. + * testsuite/gas/i386/ilp32/reloc64.d: Likewise. + * testsuite/gas/i386/ilp32/x86-64-branch.d: Likewise. + +2018-02-13 Maciej W. Rozycki + + * testsuite/gas/mips/loongson-3a-2.d: Rename test. + +2018-02-13 Nick Clifton + + PR 22823 + * config/obj-elf.c (elf_pseudo_table): Remove now redundant + casts. + (obj_elf_vtable_inherit): Rename to obj_elf_get_vtable_inherit. + (obj_elf_vtable_inherit): New stub function that calls + obj_elf_get_vtable_inherit. + (obj_elf_vtable_entry): Rename to obj_elf_get_vtable_entry. + (obj_elf_vtable_entry): New stub function that calls + obj_elf_get_vtable_entry. + * config/obj-elf.h (obj_elf_vtable_inherit): Update prototype. + (obj_elf_vtable_entry) Likewise. + (obj_elf_get_vtable_inherit) Likewise. + (obj_elf_get_vtable_entry) Likewise. + * config/tc-arm.c (md_pseudo_table): Remove now redundant cast. + * config/tc-i386c (md_pseudo_table): Likewise. + * config/tc-hppa.c (pa_vtable_entry): Call + obj_elf_get_vtable_entry. + (pa_vtable_inherit): Call obj_elf_get_vtable_inherit. + * config/tc-mips.c (s_mips_file): Replace call to dwarf2_get_file + with call to dwarf2_get_filename. + * dwarf2dbg.c (dwarf2_directive_file): Rename to + dwarf2_directive_filename. + (dwarf2_directive_file): New stub function that calls + dwarf2_directive_filename. + * dwarf2dbg.h: Prototype dwarf2_directive_filename. + +2018-02-12 Maciej W. Rozycki + + * testsuite/gas/mips/reginfo-2-n32.d: Add `--no-pad-sections' to + `as' flags. + +2018-02-12 Henry Wong + + * testsuite/gas/mips/r6.d: Update for "sigrie" encoding fix. + * testsuite/gas/mips/r6-n32.d: Likewise. + * testsuite/gas/mips/r6-n64.d: Likewise. + +2018-02-12 Nick Clifton + + * po/ru.po: Updated Russian translation. + +2018-02-08 Alan Modra + + PR 22819 + * config/tc-ppc.c (md_assemble): Rewrite insn alignment checking. + (ppc_frag_check): Likewise. + * testsuite/gas/ppc/misalign.d, + * testsuite/gas/ppc/misalign.l, + * testsuite/gas/ppc/misalign.s: New test. + * testsuite/gas/ppc/misalign2.d, + * testsuite/gas/ppc/misalign2.s: New test. + * testsuite/gas/ppc/ppc.exp: Run them. + +2018-02-05 Maciej W. Rozycki + + * config/tc-riscv.c (riscv_handle_implicit_zero_offset): Rename + `expr' parameter to `ep'. - * configure: Regenerate. +2018-02-05 Maciej W. Rozycki + + * testsuite/gas/mips/reginfo-2.d: New test. + * testsuite/gas/mips/reginfo-2-n32.d: New test. + * testsuite/gas/mips/reginfo-2.l: New test stderr output. + * testsuite/gas/mips/reginfo-2.s: New test source. + * testsuite/gas/mips/mips.exp: Run the new tests. + +2018-02-05 Nick Clifton + + * po/ru.po: Updated Russian translation. + +2018-01-31 Alan Modra + + PR 22714 + * app.c (last_char): New static var. + (struct app_save): Add last_char field. + (app_push, app_pop): Handle it. + (do_scrub_chars): Use last_char in test for "\@". Set last_char. + +2018-01-29 Eric Botcazou + + PR gas/22738 + * config/tc-sparc.h (sparc_mach): Declare. + (TARGET_MACH): Define to above. + * config/tc-sparc.c (sparc_mach): New function. + (sparc_md_end): Minor tweak. + +2018-01-29 Nick Clifton + + * po/ru.po: Updated Russian translation. 2018-01-26 Maciej W. Rozycki + * configure.tgt: Use generic emulation for `mips-*-windiss', + overriding the blanket choice made for `*-*-windiss'. + +2018-01-26 Maciej W. Rozycki + + * configure.tgt: Use `mips-*-sysv4*' rather than + `mips-*-sysv4*MP*'. + +2018-01-24 Renlin Li + + * config/tc-aarch64.c (reloc_table): add entries for + BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + BFD_RELOC_AARCH64_MOVW_PREL_G3. + (process_movw_reloc_info): Supports newly added MOVW_PREL relocations. + (md_apply_fix): Likewise + * testsuite/gas/aarch64/prel_g0.s: New. + * testsuite/gas/aarch64/prel_g0.d: New. + * testsuite/gas/aarch64/prel_g0_nc.s: New. + * testsuite/gas/aarch64/prel_g0_nc.d: New. + * testsuite/gas/aarch64/prel_g1.s: New. + * testsuite/gas/aarch64/prel_g1.d: New. + * testsuite/gas/aarch64/prel_g1_nc.s: New. + * testsuite/gas/aarch64/prel_g1_nc.d: New. + * testsuite/gas/aarch64/prel_g2.s: New. + * testsuite/gas/aarch64/prel_g2.d: New. + * testsuite/gas/aarch64/prel_g2_nc.s: New. + * testsuite/gas/aarch64/prel_g2_nc.d: New. + * testsuite/gas/aarch64/prel_g3.s: New. + * testsuite/gas/aarch64/prel_g3.d: New. + +2018-01-23 Maciej W. Rozycki + * configure.ac: Also set `mips_default_abi' to N32_ABI for `mips64*-ps2-elf*'. * configure: Regenerate. -2018-01-23 Nick Clifton +2018-01-23 Maciej W. Rozycki - * configure: Regenerate. + * config/tc-mips.c (options): Remove OPTION_COMPAT_ARCH_BASE + enum value. + +2018-01-23 Igor Tsimbalist + + * config/tc-i386.c (cpu_arch): Add .pconfig. + * doc/c-i386.texi: Document .pconfig. + * testsuite/gas/i386/i386.exp: Add PCONFIG tests. + * testsuite/gas/i386/pconfig-intel.d: New test. + * testsuite/gas/i386/pconfig.d: Likewise. + * testsuite/gas/i386/pconfig.s: Likewise. + * testsuite/gas/i386/x86-64-pconfig-intel.d: Likewise. + * testsuite/gas/i386/x86-64-pconfig.d: Likewise. + * testsuite/gas/i386/x86-64-pconfig.s: Likewise. + +2018-01-23 Igor Tsimbalist + + * config/tc-i386.c (cpu_arch): Add .wbnoinvd. + * doc/c-i386.texi: Document .wbnoinvd. + * testsuite/gas/i386/i386.exp: Add WBNOINVD tests. + * testsuite/gas/i386/wbnoinvd-intel.d: New test. + * testsuite/gas/i386/wbnoinvd.d: Likewise. + * testsuite/gas/i386/wbnoinvd.s: Likewise. + * testsuite/gas/i386/x86-64-wbnoinvd-intel.d: Likewise. + * testsuite/gas/i386/x86-64-wbnoinvd.d: Likewise. + * testsuite/gas/i386/x86-64-wbnoinvd.s: Likewise. + +2018-01-23 Maciej W. Rozycki + + * config/tc-mips.c (md_show_usage): Correctly indicate the + configuration-specific default ABI. + +2018-01-23 Maciej W. Rozycki + + * config/tc-mips.c (md_show_usage): Report `-mmips16e2' and + `-mno-mips16e2' options. 2018-01-22 Maciej W. Rozycki * doc/c-mips.texi (MIPS ASE Instruction Generation Overrides): Correct syntax of the `.set nomips16e2' directive description. -2018-01-16 Thomas Preud'homme +2018-01-22 Oleg Endo + + PR 22737 + * config/tc-rx.c (rx_start_line): Handle escaped double-quote character. + * testsuite/gas/rx/pr22737.s: New test. + * testsuite/gas/rx/pr22737.d: Likewise. + * testsuite/gas/rx/rx.exp: Run the new test. + +2018-01-19 Thomas Preud'homme + + * config/tc-arm.c (ToC macro): Remove spurious comment. + (ToU macro): Likewise. + +2018-01-17 Jim Wilson - Backport from mainline - 2018-01-15 Thomas Preud'homme + * config/tc-riscv.c (validate_riscv_insn) <'z'>: New. + (riscv_ip) <'z'>: New. + +2018-01-17 Igor Tsimbalist + + * config/tc-i386.c (cpu_arch): Delete .cet. Add .ibt, .shstk. + (cpu_noarch): Add noibt, noshstk. + (parse_insn): Change cpucet to cpuibt. + * doc/c-i386.texi: Delete .cet. Add .ibt, .shstk. + * testsuite/gas/i386/cet-ibt-inval.l: New test. + * testsuite/gas/i386/cet-ibt-inval.s: Likewise. + * testsuite/gas/i386/cet-shstk-inval.l: Likewise. + * testsuite/gas/i386/cet-shstk-inval.s: Likewise. + * testsuite/gas/i386/x86-64-cet-ibt-inval.l: Likewise. + * testsuite/gas/i386/x86-64-cet-ibt-inval.s: Likewise. + * testsuite/gas/i386/x86-64-cet-shstk-inval.l: Likewise. + * testsuite/gas/i386/x86-64-cet-shstk-inval.s: Likewise. + +2018-01-16 Nick Clifton + + * po/fr.po: Updated French translation. + +2018-01-15 Jim Wilson + + * testsuite/gas/riscv/c-zero-imm.s: Test addi that compresses to c.nop. + * testsuite/gas/riscv/c-zero-imm.d: Likewise. + +2018-01-15 Thomas Preud'homme + + * config/tc-arm.c (ToC): Define macro. + (ToU): Likewise. + (insns): Make use of above macros for new instructions introduced in + Armv8-M. + +2018-01-15 Thomas Preud'homme + + * config/tc-arm.c (insns): Make blxns, bxns, tt, ttt, tta, ttat, vlldm + and vlstm conditionally executable and reindent parameters. + * testsuite/gas/arm/archv8m-cmse-main.s: Add conditional version of + aforementionned instructions. + +2018-01-15 Thomas Preud'homme * config/tc-arm.c (it_fsm_post_encode): Do not warn if targeting M profile architecture or if in autodetection mode. Clarify that @@ -34,17 +540,16 @@ * testsuite/gas/arm/udf.l: Likewise. * testsuite/gas/arm/udf.d: Assemble for Armv8-A explicitely. -2018-01-16 Nick Clifton - - * po/fr.po: Updated French translation. - 2018-01-15 Nick Clifton * po/uk.po: Updated Ukranian translation. 2018-01-13 Nick Clifton - * po/gas.pot: Regenerate. + * po/gas.pot: Regenerated. + +2018-01-13 Nick Clifton + * configure: Regenerate. 2018-01-13 Nick Clifton diff --git a/gas/NEWS b/gas/NEWS index a591a7b..8a4b93a 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -1,5 +1,11 @@ -*- text -*- +* Add -O[2|s] command-line options to x86 assembler to enable alternate + shorter instruction encoding. + +* Add support for .nops directive. It is currently supported only for + x86 targets. + Changes in 2.30: * Add support for loaction views in DWARF debug line information. diff --git a/gas/app.c b/gas/app.c index da39421..9cafff0 100644 --- a/gas/app.c +++ b/gas/app.c @@ -55,6 +55,9 @@ static const char mri_pseudo[] = ".mri 0"; static const char symver_pseudo[] = ".symver"; static const char * symver_state; #endif +#ifdef TC_ARM +static char last_char; +#endif static char lex[256]; static const char symbol_chars[] = @@ -242,6 +245,9 @@ struct app_save #if defined TC_ARM && defined OBJ_ELF const char * symver_state; #endif +#ifdef TC_ARM + char last_char; +#endif }; char * @@ -271,6 +277,9 @@ app_push (void) #if defined TC_ARM && defined OBJ_ELF saved->symver_state = symver_state; #endif +#ifdef TC_ARM + saved->last_char = last_char; +#endif /* do_scrub_begin() is not useful, just wastes time. */ @@ -310,6 +319,9 @@ app_pop (char *arg) #if defined TC_ARM && defined OBJ_ELF symver_state = saved->symver_state; #endif +#ifdef TC_ARM + last_char = saved->last_char; +#endif free (arg); } @@ -1285,7 +1297,7 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen) #ifdef TC_ARM /* For the ARM, care is needed not to damage occurrences of \@ by stripping the @ onwards. Yuck. */ - if (to > tostart && *(to - 1) == '\\') + if ((to > tostart ? to[-1] : last_char) == '\\') /* Do not treat the @ as a start-of-comment. */ goto de_fault; #endif @@ -1465,6 +1477,10 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen) fromeof: /* We have reached the end of the input. */ +#ifdef TC_ARM + if (to > tostart) + last_char = to[-1]; +#endif return to - tostart; tofull: @@ -1478,5 +1494,9 @@ do_scrub_chars (size_t (*get) (char *, size_t), char *tostart, size_t tolen) else saved_input = NULL; +#ifdef TC_ARM + if (to > tostart) + last_char = to[-1]; +#endif return to - tostart; } diff --git a/gas/as.h b/gas/as.h index c33353a..d75ff42 100644 --- a/gas/as.h +++ b/gas/as.h @@ -279,6 +279,16 @@ enum _relax_state 1 variable char: fill character */ rs_space, + /* .nop directive with expression operand that needs to be computed + later. Similar to rs_space, but different. It fills with no-op + instructions. + fr_symbol: operand + 1 constant byte: no-op fill control byte. */ + rs_space_nop, + + /* Similar to rs_fill. It is used to implement .nop directive . */ + rs_fill_nop, + /* A DWARF leb128 value; only ELF uses this. The subtype is 0 for unsigned, 1 for signed. */ rs_leb128, diff --git a/gas/config.in b/gas/config.in index 0855179..551434a 100644 --- a/gas/config.in +++ b/gas/config.in @@ -202,6 +202,9 @@ /* Define default value for nds32_audio_ext */ #undef NDS32_DEFAULT_AUDIO_EXT +/* Define default value for nds32_dsp_ext */ +#undef NDS32_DEFAULT_DSP_EXT + /* Define default value for nds32_dx_regs */ #undef NDS32_DEFAULT_DX_REGS @@ -214,6 +217,12 @@ /* Define default value for nds32_string_ext */ #undef NDS32_DEFAULT_STRING_EXT +/* Define default value for nds32_zol_ext */ +#undef NDS32_DEFAULT_ZOL_EXT + +/* Defined for linux toolchain */ +#undef NDS32_LINUX_TOOLCHAIN + /* Define if environ is not declared in system header files. */ #undef NEED_DECLARATION_ENVIRON diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index ae9b2e1..cac3c39 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -117,8 +117,8 @@ static const pseudo_typeS elf_pseudo_table[] = {"subsection", obj_elf_subsection, 0}, /* These are GNU extensions to aid in garbage collecting C++ vtables. */ - {"vtable_inherit", (void (*) (int)) &obj_elf_vtable_inherit, 0}, - {"vtable_entry", (void (*) (int)) &obj_elf_vtable_entry, 0}, + {"vtable_inherit", obj_elf_vtable_inherit, 0}, + {"vtable_entry", obj_elf_vtable_entry, 0}, /* A GNU extension for object attributes. */ {"gnu_attribute", obj_elf_gnu_attribute, 0}, @@ -128,7 +128,7 @@ static const pseudo_typeS elf_pseudo_table[] = {"4byte", cons, 4}, {"8byte", cons, 8}, /* These are used for dwarf2. */ - { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "file", dwarf2_directive_file, 0 }, { "loc", dwarf2_directive_loc, 0 }, { "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 }, @@ -1460,7 +1460,7 @@ obj_elf_symver (int ignore ATTRIBUTE_UNUSED) syntax is ".vtable_inherit CHILDNAME, PARENTNAME". */ struct fix * -obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) +obj_elf_get_vtable_inherit (void) { char *cname, *pname; symbolS *csym, *psym; @@ -1524,12 +1524,21 @@ obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) 0, psym, 0, 0, BFD_RELOC_VTABLE_INHERIT); } +/* This is a version of obj_elf_get_vtable_inherit() that is + suitable for use in struct _pseudo_type tables. */ + +void +obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) +{ + (void) obj_elf_get_vtable_inherit (); +} + /* This handles the .vtable_entry pseudo-op, which is used to indicate to the linker that a vtable slot was used. The syntax is ".vtable_entry tablename, offset". */ struct fix * -obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED) +obj_elf_get_vtable_entry (void) { symbolS *sym; offsetT offset; @@ -1557,6 +1566,15 @@ obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED) BFD_RELOC_VTABLE_ENTRY); } +/* This is a version of obj_elf_get_vtable_entry() that is + suitable for use in struct _pseudo_type tables. */ + +void +obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED) +{ + (void) obj_elf_get_vtable_entry (); +} + #define skip_whitespace(str) do { if (*(str) == ' ') ++(str); } while (0) static inline int diff --git a/gas/config/obj-elf.h b/gas/config/obj-elf.h index 33e0954..96f7cbc 100644 --- a/gas/config/obj-elf.h +++ b/gas/config/obj-elf.h @@ -164,8 +164,10 @@ extern void obj_elf_text (int); extern void obj_elf_change_section (const char *, unsigned int, unsigned int, bfd_vma, int, const char *, int, int); -extern struct fix *obj_elf_vtable_inherit (int); -extern struct fix *obj_elf_vtable_entry (int); +extern void obj_elf_vtable_inherit (int); +extern void obj_elf_vtable_entry (int); +extern struct fix * obj_elf_get_vtable_inherit (void); +extern struct fix * obj_elf_get_vtable_entry (void); extern bfd_boolean obj_elf_seen_attribute (int, unsigned int); extern int obj_elf_vendor_attribute (int); diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 8af3137..3a0cde9 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -2577,6 +2577,69 @@ static struct reloc_table_entry reloc_table[] = { 0, 0}, + /* Most significant bits 0-15 of signed/unsigned address/value: MOVZ */ + {"prel_g0", 1, + 0, /* adr_type */ + 0, + BFD_RELOC_AARCH64_MOVW_PREL_G0, + 0, + 0, + 0}, + + /* Most significant bits 0-15 of signed/unsigned address/value: MOVK */ + {"prel_g0_nc", 1, + 0, /* adr_type */ + 0, + BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, + 0, + 0, + 0}, + + /* Most significant bits 16-31 of signed/unsigned address/value: MOVZ */ + {"prel_g1", 1, + 0, /* adr_type */ + 0, + BFD_RELOC_AARCH64_MOVW_PREL_G1, + 0, + 0, + 0}, + + /* Most significant bits 16-31 of signed/unsigned address/value: MOVK */ + {"prel_g1_nc", 1, + 0, /* adr_type */ + 0, + BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, + 0, + 0, + 0}, + + /* Most significant bits 32-47 of signed/unsigned address/value: MOVZ */ + {"prel_g2", 1, + 0, /* adr_type */ + 0, + BFD_RELOC_AARCH64_MOVW_PREL_G2, + 0, + 0, + 0}, + + /* Most significant bits 32-47 of signed/unsigned address/value: MOVK */ + {"prel_g2_nc", 1, + 0, /* adr_type */ + 0, + BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, + 0, + 0, + 0}, + + /* Most significant bits 48-63 of signed/unsigned address/value: MOVZ */ + {"prel_g3", 1, + 0, /* adr_type */ + 0, + BFD_RELOC_AARCH64_MOVW_PREL_G3, + 0, + 0, + 0}, + /* Get to the page containing GOT entry for a symbol. */ {"got", 1, 0, /* adr_type */ @@ -5079,6 +5142,10 @@ process_movw_reloc_info (void) case BFD_RELOC_AARCH64_MOVW_G0_S: case BFD_RELOC_AARCH64_MOVW_G1_S: case BFD_RELOC_AARCH64_MOVW_G2_S: + case BFD_RELOC_AARCH64_MOVW_PREL_G0: + case BFD_RELOC_AARCH64_MOVW_PREL_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G2: + case BFD_RELOC_AARCH64_MOVW_PREL_G3: case BFD_RELOC_AARCH64_TLSGD_MOVW_G1: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1: @@ -5096,6 +5163,8 @@ process_movw_reloc_info (void) case BFD_RELOC_AARCH64_MOVW_G0_NC: case BFD_RELOC_AARCH64_MOVW_G0_S: case BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G0: + case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC: case BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC: case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC: case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC: @@ -5109,6 +5178,8 @@ process_movw_reloc_info (void) case BFD_RELOC_AARCH64_MOVW_G1_NC: case BFD_RELOC_AARCH64_MOVW_G1_S: case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC: case BFD_RELOC_AARCH64_TLSDESC_OFF_G1: case BFD_RELOC_AARCH64_TLSGD_MOVW_G1: case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1: @@ -5121,6 +5192,8 @@ process_movw_reloc_info (void) case BFD_RELOC_AARCH64_MOVW_G2: case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G2_S: + case BFD_RELOC_AARCH64_MOVW_PREL_G2: + case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC: case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2: case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2: if (is32) @@ -5133,6 +5206,7 @@ process_movw_reloc_info (void) shift = 32; break; case BFD_RELOC_AARCH64_MOVW_G3: + case BFD_RELOC_AARCH64_MOVW_PREL_G3: if (is32) { set_fatal_syntax_error @@ -7608,12 +7682,16 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg) case BFD_RELOC_AARCH64_MOVW_G0_NC: case BFD_RELOC_AARCH64_MOVW_G0_S: case BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC: + case BFD_RELOC_AARCH64_MOVW_PREL_G0: + case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC: scale = 0; goto movw_common; case BFD_RELOC_AARCH64_MOVW_G1: case BFD_RELOC_AARCH64_MOVW_G1_NC: case BFD_RELOC_AARCH64_MOVW_G1_S: case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC: scale = 16; goto movw_common; case BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC: @@ -7635,9 +7713,12 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg) case BFD_RELOC_AARCH64_MOVW_G2: case BFD_RELOC_AARCH64_MOVW_G2_NC: case BFD_RELOC_AARCH64_MOVW_G2_S: + case BFD_RELOC_AARCH64_MOVW_PREL_G2: + case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC: scale = 32; goto movw_common; case BFD_RELOC_AARCH64_MOVW_G3: + case BFD_RELOC_AARCH64_MOVW_PREL_G3: scale = 48; movw_common: if (fixP->fx_done || !seg->use_rela_p) @@ -7669,6 +7750,9 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg) case BFD_RELOC_AARCH64_MOVW_G0_S: case BFD_RELOC_AARCH64_MOVW_G1_S: case BFD_RELOC_AARCH64_MOVW_G2_S: + case BFD_RELOC_AARCH64_MOVW_PREL_G0: + case BFD_RELOC_AARCH64_MOVW_PREL_G1: + case BFD_RELOC_AARCH64_MOVW_PREL_G2: /* NOTE: We can only come here with movz or movn. */ if (signed_overflow (value, scale + 16)) as_bad_where (fixP->fx_file, fixP->fx_line, diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index c07362a..eda9890 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -123,7 +123,12 @@ enum arm_float_abi #define streq(a, b) (strcmp (a, b) == 0) +/* Current set of feature bits available (CPU+FPU). Different from + selected_cpu + selected_fpu in case of autodetection since the CPU + feature bits are then all set. */ static arm_feature_set cpu_variant; +/* Feature bits used in each execution state. Used to set build attribute + (in particular Tag_*_ISA_use) in CPU autodetection mode. */ static arm_feature_set arm_arch_used; static arm_feature_set thumb_arch_used; @@ -143,17 +148,24 @@ bfd_boolean codecomposer_syntax = FALSE; /* Variables that we set while parsing command-line options. Once all options have been read we re-process these values to set the real assembly flags. */ -static const arm_feature_set * legacy_cpu = NULL; -static const arm_feature_set * legacy_fpu = NULL; - -static const arm_feature_set * mcpu_cpu_opt = NULL; -static arm_feature_set * dyn_mcpu_ext_opt = NULL; -static const arm_feature_set * mcpu_fpu_opt = NULL; -static const arm_feature_set * march_cpu_opt = NULL; -static arm_feature_set * dyn_march_ext_opt = NULL; -static const arm_feature_set * march_fpu_opt = NULL; -static const arm_feature_set * mfpu_opt = NULL; -static const arm_feature_set * object_arch = NULL; + +/* CPU and FPU feature bits set for legacy CPU and FPU options (eg. -marm1 + instead of -mcpu=arm1). */ +static const arm_feature_set *legacy_cpu = NULL; +static const arm_feature_set *legacy_fpu = NULL; + +/* CPU, extension and FPU feature bits selected by -mcpu. */ +static const arm_feature_set *mcpu_cpu_opt = NULL; +static arm_feature_set *mcpu_ext_opt = NULL; +static const arm_feature_set *mcpu_fpu_opt = NULL; + +/* CPU, extension and FPU feature bits selected by -march. */ +static const arm_feature_set *march_cpu_opt = NULL; +static arm_feature_set *march_ext_opt = NULL; +static const arm_feature_set *march_fpu_opt = NULL; + +/* Feature bits selected by -mfpu. */ +static const arm_feature_set *mfpu_opt = NULL; /* Constants for known architecture features. */ static const arm_feature_set fpu_default = FPU_DEFAULT; @@ -302,8 +314,20 @@ static const arm_feature_set fpu_neon_ext_dotprod = ARM_FEATURE_COPROC (FPU_NEON_EXT_DOTPROD); static int mfloat_abi_opt = -1; -/* Record user cpu selection for object attributes. */ +/* Architecture feature bits selected by the last -mcpu/-march or .cpu/.arch + directive. */ +static arm_feature_set selected_arch = ARM_ARCH_NONE; +/* Extension feature bits selected by the last -mcpu/-march or .arch_extension + directive. */ +static arm_feature_set selected_ext = ARM_ARCH_NONE; +/* Feature bits selected by the last -mcpu/-march or by the combination of the + last .cpu/.arch directive .arch_extension directives since that + directive. */ static arm_feature_set selected_cpu = ARM_ARCH_NONE; +/* FPU feature bits selected by the last -mfpu or .fpu directive. */ +static arm_feature_set selected_fpu = FPU_NONE; +/* Feature bits selected by the last .object_arch directive. */ +static arm_feature_set selected_object_arch = ARM_ARCH_NONE; /* Must be long enough to hold any of the names in arm_cpus. */ static char selected_cpu_name[20]; @@ -4758,7 +4782,7 @@ const pseudo_typeS md_pseudo_table[] = {"4byte", cons, 4}, {"8byte", cons, 8}, /* These are used for dwarf2. */ - { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "file", dwarf2_directive_file, 0 }, { "loc", dwarf2_directive_loc, 0 }, { "loc_mark_labels", dwarf2_directive_loc_mark_labels, 0 }, #endif @@ -6160,17 +6184,16 @@ record_feature_use (const arm_feature_set *feature) ARM_MERGE_FEATURE_SETS (arm_arch_used, arm_arch_used, *feature); } -/* If the given feature available in the selected CPU, mark it as used. - Returns TRUE iff feature is available. */ +/* If the given feature is currently allowed, mark it as used and return TRUE. + Return FALSE otherwise. */ static bfd_boolean mark_feature_used (const arm_feature_set *feature) { - /* Ensure the option is valid on the current architecture. */ + /* Ensure the option is currently allowed. */ if (!ARM_CPU_HAS_FEATURE (cpu_variant, *feature)) return FALSE; - /* Add the appropriate architecture feature for the barrier option used. - */ + /* Add the appropriate architecture feature for the barrier option used. */ record_feature_use (feature); return TRUE; @@ -8610,7 +8633,8 @@ do_bx (void) /* Output R_ARM_V4BX relocations if is an EABI object that looks like it is for ARMv4t or earlier. */ want_reloc = !ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v5); - if (object_arch && !ARM_CPU_HAS_FEATURE (*object_arch, arm_ext_v5)) + if (!ARM_FEATURE_ZERO (selected_object_arch) + && !ARM_CPU_HAS_FEATURE (selected_object_arch, arm_ext_v5)) want_reloc = TRUE; #ifdef OBJ_ELF @@ -16772,6 +16796,20 @@ do_neon_movhf (void) constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_vfp_ext_armv8), _(BAD_FPU)); + if (inst.cond != COND_ALWAYS) + { + if (thumb_mode) + { + as_warn (_("ARMv8.2 scalar fp16 instruction cannot be conditional," + " the behaviour is UNPREDICTABLE")); + } + else + { + inst.error = BAD_COND; + return; + } + } + do_vfp_sp_monadic (); inst.is_neon = 1; @@ -19413,6 +19451,15 @@ static struct asm_barrier_opt barrier_opt_names[] = #define C3(mnem, op, nops, ops, ae) \ { #mnem, OPS##nops ops, OT_cinfix3, 0x##op, 0x0, ARM_VARIANT, 0, do_##ae, NULL } +/* Thumb-only variants of TCE and TUE. */ +#define ToC(mnem, top, nops, ops, te) \ + { mnem, OPS##nops ops, OT_csuffix, 0x0, 0x##top, 0, THUMB_VARIANT, NULL, \ + do_##te } + +#define ToU(mnem, top, nops, ops, te) \ + { mnem, OPS##nops ops, OT_unconditional, 0x0, 0x##top, 0, THUMB_VARIANT, \ + NULL, do_##te } + /* Legacy mnemonics that always have conditional infix after the third character. */ #define CL(mnem, op, nops, ops, ae) \ @@ -21456,20 +21503,20 @@ static const struct asm_opcode insns[] = #define ARM_VARIANT NULL #undef THUMB_VARIANT #define THUMB_VARIANT & arm_ext_v8m - TUE("sg", 0, e97fe97f, 0, (), 0, noargs), - TUE("blxns", 0, 4784, 1, (RRnpc), 0, t_blx), - TUE("bxns", 0, 4704, 1, (RRnpc), 0, t_bx), - TUE("tt", 0, e840f000, 2, (RRnpc, RRnpc), 0, tt), - TUE("ttt", 0, e840f040, 2, (RRnpc, RRnpc), 0, tt), - TUE("tta", 0, e840f080, 2, (RRnpc, RRnpc), 0, tt), - TUE("ttat", 0, e840f0c0, 2, (RRnpc, RRnpc), 0, tt), + ToU("sg", e97fe97f, 0, (), noargs), + ToC("blxns", 4784, 1, (RRnpc), t_blx), + ToC("bxns", 4704, 1, (RRnpc), t_bx), + ToC("tt", e840f000, 2, (RRnpc, RRnpc), tt), + ToC("ttt", e840f040, 2, (RRnpc, RRnpc), tt), + ToC("tta", e840f080, 2, (RRnpc, RRnpc), tt), + ToC("ttat", e840f0c0, 2, (RRnpc, RRnpc), tt), /* FP for ARMv8-M Mainline. Enabled for ARMv8-M Mainline because the instructions behave as nop if no VFP is present. */ #undef THUMB_VARIANT #define THUMB_VARIANT & arm_ext_v8m_main - TUEc("vlldm", 0, ec300a00, 1, (RRnpc), rn), - TUEc("vlstm", 0, ec200a00, 1, (RRnpc), rn), + ToC("vlldm", ec300a00, 1, (RRnpc), rn), + ToC("vlstm", ec200a00, 1, (RRnpc), rn), }; #undef ARM_VARIANT #undef THUMB_VARIANT @@ -23587,12 +23634,14 @@ md_apply_fix (fixS * fixP, /* MOV accepts both Thumb2 modified immediate (T2 encoding) and UINT16 (T3 encoding), MOVW only accepts UINT16. When disassembling, MOV is preferred when there is no encoding - overlap. - NOTE: MOV is using ORR opcode under Thumb 2 mode. */ + overlap. */ if (((newval >> T2_DATA_OP_SHIFT) & 0xf) == T2_OPCODE_ORR + /* NOTE: MOV uses the ORR opcode in Thumb 2 mode + but with the Rn field [19:16] set to 1111. */ + && (((newval >> 16) & 0xf) == 0xf) && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v6t2_v8m) && !((newval >> T2_SBIT_SHIFT) & 0x1) - && value >= 0 && value <=0xffff) + && value >= 0 && value <= 0xffff) { /* Toggle bit[25] to change encoding from T2 to T3. */ newval ^= 1 << 25; @@ -25327,71 +25376,70 @@ md_begin (void) if (mcpu_cpu_opt || march_cpu_opt) as_bad (_("use of old and new-style options to set CPU type")); - mcpu_cpu_opt = legacy_cpu; + selected_arch = *legacy_cpu; } - else if (!mcpu_cpu_opt) + else if (mcpu_cpu_opt) { - mcpu_cpu_opt = march_cpu_opt; - dyn_mcpu_ext_opt = dyn_march_ext_opt; - /* Avoid double free in arm_md_end. */ - dyn_march_ext_opt = NULL; + selected_arch = *mcpu_cpu_opt; + selected_ext = *mcpu_ext_opt; } + else if (march_cpu_opt) + { + selected_arch = *march_cpu_opt; + selected_ext = *march_ext_opt; + } + ARM_MERGE_FEATURE_SETS (selected_cpu, selected_arch, selected_ext); if (legacy_fpu) { if (mfpu_opt) as_bad (_("use of old and new-style options to set FPU type")); - mfpu_opt = legacy_fpu; + selected_fpu = *legacy_fpu; } - else if (!mfpu_opt) + else if (mfpu_opt) + selected_fpu = *mfpu_opt; + else { #if !(defined (EABI_DEFAULT) || defined (TE_LINUX) \ || defined (TE_NetBSD) || defined (TE_VXWORKS)) /* Some environments specify a default FPU. If they don't, infer it from the processor. */ if (mcpu_fpu_opt) - mfpu_opt = mcpu_fpu_opt; - else - mfpu_opt = march_fpu_opt; + selected_fpu = *mcpu_fpu_opt; + else if (march_fpu_opt) + selected_fpu = *march_fpu_opt; #else - mfpu_opt = &fpu_default; + selected_fpu = fpu_default; #endif } - if (!mfpu_opt) + if (ARM_FEATURE_ZERO (selected_fpu)) { - if (mcpu_cpu_opt != NULL) - mfpu_opt = &fpu_default; - else if (mcpu_fpu_opt != NULL && ARM_CPU_HAS_FEATURE (*mcpu_fpu_opt, arm_ext_v5)) - mfpu_opt = &fpu_arch_vfp_v2; + if (!no_cpu_selected ()) + selected_fpu = fpu_default; else - mfpu_opt = &fpu_arch_fpa; + selected_fpu = fpu_arch_fpa; } #ifdef CPU_DEFAULT - if (!mcpu_cpu_opt) + if (ARM_FEATURE_ZERO (selected_arch)) { - mcpu_cpu_opt = &cpu_default; - selected_cpu = cpu_default; + selected_arch = cpu_default; + selected_cpu = selected_arch; } - else if (dyn_mcpu_ext_opt) - ARM_MERGE_FEATURE_SETS (selected_cpu, *mcpu_cpu_opt, *dyn_mcpu_ext_opt); - else - selected_cpu = *mcpu_cpu_opt; + ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, selected_fpu); #else - if (mcpu_cpu_opt && dyn_mcpu_ext_opt) - ARM_MERGE_FEATURE_SETS (selected_cpu, *mcpu_cpu_opt, *dyn_mcpu_ext_opt); - else if (mcpu_cpu_opt) - selected_cpu = *mcpu_cpu_opt; + /* Autodection of feature mode: allow all features in cpu_variant but leave + selected_cpu unset. It will be set in aeabi_set_public_attributes () + after all instruction have been processed and we can decide what CPU + should be selected. */ + if (ARM_FEATURE_ZERO (selected_arch)) + ARM_MERGE_FEATURE_SETS (cpu_variant, arm_arch_any, selected_fpu); else - mcpu_cpu_opt = &arm_arch_any; + ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, selected_fpu); #endif - ARM_MERGE_FEATURE_SETS (cpu_variant, *mcpu_cpu_opt, *mfpu_opt); - if (dyn_mcpu_ext_opt) - ARM_MERGE_FEATURE_SETS (cpu_variant, cpu_variant, *dyn_mcpu_ext_opt); - autoselect_thumb_from_cpu_variant (); arm_arch_used = thumb_arch_used = arm_arch_none; @@ -26419,7 +26467,7 @@ struct arm_long_option_table static bfd_boolean arm_parse_extension (const char *str, const arm_feature_set *opt_set, - arm_feature_set **ext_set_p) + arm_feature_set *ext_set) { /* We insist on extensions being specified in alphabetical order, and with extensions being added before being removed. We achieve this by having @@ -26431,12 +26479,6 @@ arm_parse_extension (const char *str, const arm_feature_set *opt_set, const arm_feature_set arm_any = ARM_ANY; int adding_value = -1; - if (!*ext_set_p) - { - *ext_set_p = XNEW (arm_feature_set); - **ext_set_p = arm_arch_none; - } - while (str != NULL && *str != 0) { const char *ext; @@ -26514,10 +26556,9 @@ arm_parse_extension (const char *str, const arm_feature_set *opt_set, /* Add or remove the extension. */ if (adding_value) - ARM_MERGE_FEATURE_SETS (**ext_set_p, **ext_set_p, - opt->merge_value); + ARM_MERGE_FEATURE_SETS (*ext_set, *ext_set, opt->merge_value); else - ARM_CLEAR_FEATURE (**ext_set_p, **ext_set_p, opt->clear_value); + ARM_CLEAR_FEATURE (*ext_set, *ext_set, opt->clear_value); /* Allowing Thumb division instructions for ARMv7 in autodetection rely on this break so that duplicate extensions (extensions @@ -26578,9 +26619,9 @@ arm_parse_cpu (const char *str) if (opt->name_len == len && strncmp (opt->name, str, len) == 0) { mcpu_cpu_opt = &opt->value; - if (!dyn_mcpu_ext_opt) - dyn_mcpu_ext_opt = XNEW (arm_feature_set); - *dyn_mcpu_ext_opt = opt->ext; + if (mcpu_ext_opt == NULL) + mcpu_ext_opt = XNEW (arm_feature_set); + *mcpu_ext_opt = opt->ext; mcpu_fpu_opt = &opt->default_fpu; if (opt->canonical_name) { @@ -26600,7 +26641,7 @@ arm_parse_cpu (const char *str) } if (ext != NULL) - return arm_parse_extension (ext, mcpu_cpu_opt, &dyn_mcpu_ext_opt); + return arm_parse_extension (ext, mcpu_cpu_opt, mcpu_ext_opt); return TRUE; } @@ -26631,11 +26672,14 @@ arm_parse_arch (const char *str) if (opt->name_len == len && strncmp (opt->name, str, len) == 0) { march_cpu_opt = &opt->value; + if (march_ext_opt == NULL) + march_ext_opt = XNEW (arm_feature_set); + *march_ext_opt = arm_arch_none; march_fpu_opt = &opt->default_fpu; strcpy (selected_cpu_name, opt->name); if (ext != NULL) - return arm_parse_extension (ext, march_cpu_opt, &dyn_march_ext_opt); + return arm_parse_extension (ext, march_cpu_opt, march_ext_opt); return TRUE; } @@ -26930,7 +26974,7 @@ static const cpu_arch_ver_table cpu_arch_ver[] = {16, ARM_ARCH_V8M_BASE}, {17, ARM_ARCH_V8M_MAIN}, {15, ARM_ARCH_V8R}, - {16, ARM_ARCH_V8_4A}, + {14, ARM_ARCH_V8_4A}, {-1, ARM_ARCH_NONE} }; @@ -27127,26 +27171,31 @@ aeabi_set_public_attributes (void) ARM_MERGE_FEATURE_SETS (flags, flags, arm_ext_v4t); /* Code run during relaxation relies on selected_cpu being set. */ + ARM_CLEAR_FEATURE (flags_arch, flags, fpu_any); + flags_ext = arm_arch_none; + ARM_CLEAR_FEATURE (selected_arch, flags_arch, flags_ext); + selected_ext = flags_ext; selected_cpu = flags; } /* Otherwise, choose the architecture based on the capabilities of the requested cpu. */ else - flags = selected_cpu; - ARM_MERGE_FEATURE_SETS (flags, flags, *mfpu_opt); + { + ARM_MERGE_FEATURE_SETS (flags_arch, selected_arch, selected_ext); + ARM_CLEAR_FEATURE (flags_arch, flags_arch, fpu_any); + flags_ext = selected_ext; + flags = selected_cpu; + } + ARM_MERGE_FEATURE_SETS (flags, flags, selected_fpu); /* Allow the user to override the reported architecture. */ - if (object_arch) + if (!ARM_FEATURE_ZERO (selected_object_arch)) { - ARM_CLEAR_FEATURE (flags_arch, *object_arch, fpu_any); + ARM_CLEAR_FEATURE (flags_arch, selected_object_arch, fpu_any); flags_ext = arm_arch_none; } else - { - ARM_CLEAR_FEATURE (flags_arch, flags, fpu_any); - flags_ext = dyn_mcpu_ext_opt ? *dyn_mcpu_ext_opt : arm_arch_none; - skip_exact_match = ARM_FEATURE_EQUAL (selected_cpu, arm_arch_any); - } + skip_exact_match = ARM_FEATURE_EQUAL (selected_cpu, arm_arch_any); /* When this function is run again after relaxation has happened there is no way to determine whether an architecture or CPU was specified by the user: @@ -27187,7 +27236,7 @@ aeabi_set_public_attributes (void) aeabi_set_attribute_int (Tag_CPU_arch_profile, profile); /* Tag_DSP_extension. */ - if (dyn_mcpu_ext_opt && ARM_CPU_HAS_FEATURE (*dyn_mcpu_ext_opt, arm_ext_dsp)) + if (ARM_CPU_HAS_FEATURE (selected_ext, arm_ext_dsp)) aeabi_set_attribute_int (Tag_DSP_extension, 1); ARM_CLEAR_FEATURE (flags_arch, flags, fpu_any); @@ -27310,10 +27359,10 @@ void arm_md_post_relax (void) { aeabi_set_public_attributes (); - XDELETE (dyn_mcpu_ext_opt); - dyn_mcpu_ext_opt = NULL; - XDELETE (dyn_march_ext_opt); - dyn_march_ext_opt = NULL; + XDELETE (mcpu_ext_opt); + mcpu_ext_opt = NULL; + XDELETE (march_ext_opt); + march_ext_opt = NULL; } /* Add the default contents for the .ARM.attributes section. */ @@ -27347,11 +27396,9 @@ s_arm_cpu (int ignored ATTRIBUTE_UNUSED) for (opt = arm_cpus + 1; opt->name != NULL; opt++) if (streq (opt->name, name)) { - mcpu_cpu_opt = &opt->value; - if (!dyn_mcpu_ext_opt) - dyn_mcpu_ext_opt = XNEW (arm_feature_set); - *dyn_mcpu_ext_opt = opt->ext; - ARM_MERGE_FEATURE_SETS (selected_cpu, *mcpu_cpu_opt, *dyn_mcpu_ext_opt); + selected_arch = opt->value; + selected_ext = opt->ext; + ARM_MERGE_FEATURE_SETS (selected_cpu, selected_arch, selected_ext); if (opt->canonical_name) strcpy (selected_cpu_name, opt->canonical_name); else @@ -27362,9 +27409,8 @@ s_arm_cpu (int ignored ATTRIBUTE_UNUSED) selected_cpu_name[i] = 0; } - ARM_MERGE_FEATURE_SETS (cpu_variant, *mcpu_cpu_opt, *mfpu_opt); - if (dyn_mcpu_ext_opt) - ARM_MERGE_FEATURE_SETS (cpu_variant, cpu_variant, *dyn_mcpu_ext_opt); + ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, selected_fpu); + *input_line_pointer = saved_char; demand_empty_rest_of_line (); return; @@ -27393,12 +27439,11 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED) for (opt = arm_archs + 1; opt->name != NULL; opt++) if (streq (opt->name, name)) { - mcpu_cpu_opt = &opt->value; - XDELETE (dyn_mcpu_ext_opt); - dyn_mcpu_ext_opt = NULL; - selected_cpu = *mcpu_cpu_opt; + selected_arch = opt->value; + selected_ext = arm_arch_none; + selected_cpu = selected_arch; strcpy (selected_cpu_name, opt->name); - ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, *mfpu_opt); + ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, selected_fpu); *input_line_pointer = saved_char; demand_empty_rest_of_line (); return; @@ -27428,7 +27473,7 @@ s_arm_object_arch (int ignored ATTRIBUTE_UNUSED) for (opt = arm_archs + 1; opt->name != NULL; opt++) if (streq (opt->name, name)) { - object_arch = &opt->value; + selected_object_arch = opt->value; *input_line_pointer = saved_char; demand_empty_rest_of_line (); return; @@ -27445,7 +27490,6 @@ static void s_arm_arch_extension (int ignored ATTRIBUTE_UNUSED) { const struct arm_option_extension_value_table *opt; - const arm_feature_set arm_any = ARM_ANY; char saved_char; char *name; int adding_value = 1; @@ -27471,9 +27515,9 @@ s_arm_arch_extension (int ignored ATTRIBUTE_UNUSED) for (i = 0; i < nb_allowed_archs; i++) { /* Empty entry. */ - if (ARM_FEATURE_EQUAL (opt->allowed_archs[i], arm_any)) + if (ARM_CPU_IS_ANY (opt->allowed_archs[i])) continue; - if (ARM_FSET_CPU_SUBSET (opt->allowed_archs[i], *mcpu_cpu_opt)) + if (ARM_FSET_CPU_SUBSET (opt->allowed_archs[i], selected_arch)) break; } @@ -27484,20 +27528,14 @@ s_arm_arch_extension (int ignored ATTRIBUTE_UNUSED) break; } - if (!dyn_mcpu_ext_opt) - { - dyn_mcpu_ext_opt = XNEW (arm_feature_set); - *dyn_mcpu_ext_opt = arm_arch_none; - } if (adding_value) - ARM_MERGE_FEATURE_SETS (*dyn_mcpu_ext_opt, *dyn_mcpu_ext_opt, + ARM_MERGE_FEATURE_SETS (selected_ext, selected_ext, opt->merge_value); else - ARM_CLEAR_FEATURE (*dyn_mcpu_ext_opt, *dyn_mcpu_ext_opt, - opt->clear_value); + ARM_CLEAR_FEATURE (selected_ext, selected_ext, opt->clear_value); - ARM_MERGE_FEATURE_SETS (selected_cpu, *mcpu_cpu_opt, *dyn_mcpu_ext_opt); - ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, *mfpu_opt); + ARM_MERGE_FEATURE_SETS (selected_cpu, selected_arch, selected_ext); + ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, selected_fpu); *input_line_pointer = saved_char; demand_empty_rest_of_line (); /* Allowing Thumb division instructions for ARMv7 in autodetection rely @@ -27532,10 +27570,13 @@ s_arm_fpu (int ignored ATTRIBUTE_UNUSED) for (opt = arm_fpus; opt->name != NULL; opt++) if (streq (opt->name, name)) { - mfpu_opt = &opt->value; - ARM_MERGE_FEATURE_SETS (cpu_variant, *mcpu_cpu_opt, *mfpu_opt); - if (dyn_mcpu_ext_opt) - ARM_MERGE_FEATURE_SETS (cpu_variant, cpu_variant, *dyn_mcpu_ext_opt); + selected_fpu = opt->value; +#ifndef CPU_DEFAULT + if (no_cpu_selected ()) + ARM_MERGE_FEATURE_SETS (cpu_variant, arm_arch_any, selected_fpu); + else +#endif + ARM_MERGE_FEATURE_SETS (cpu_variant, selected_cpu, selected_fpu); *input_line_pointer = saved_char; demand_empty_rest_of_line (); return; diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c index f18aab6..e69fdb2 100644 --- a/gas/config/tc-hppa.c +++ b/gas/config/tc-hppa.c @@ -8528,7 +8528,7 @@ pa_vtable_entry (int ignore ATTRIBUTE_UNUSED) { struct fix *new_fix; - new_fix = obj_elf_vtable_entry (0); + new_fix = obj_elf_get_vtable_entry (); if (new_fix) { @@ -8549,7 +8549,7 @@ pa_vtable_inherit (int ignore ATTRIBUTE_UNUSED) { struct fix *new_fix; - new_fix = obj_elf_vtable_inherit (0); + new_fix = obj_elf_get_vtable_inherit (); if (new_fix) { diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 5cd83da..4174d19 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -369,6 +369,12 @@ struct _i386_insn disp_encoding_32bit } disp_encoding; + /* Prefer the REX byte in encoding. */ + bfd_boolean rex_encoding; + + /* Disable instruction size optimization. */ + bfd_boolean no_optimize; + /* How to encode vector instructions. */ enum { @@ -597,6 +603,22 @@ static enum check_kind } sse_check, operand_check = check_warning; +/* Optimization: + 1. Clear the REX_W bit with register operand if possible. + 2. Above plus use 128bit vector instruction to clear the full vector + register. + */ +static int optimize = 0; + +/* Optimization: + 1. Clear the REX_W bit with register operand if possible. + 2. Above plus use 128bit vector instruction to clear the full vector + register. + 3. Above plus optimize "test{q,l,w} $imm8,%r{64,32,16}" to + "testb $imm7,%r8". + */ +static int optimize_for_space = 0; + /* Register prefix used for error message. */ static const char *register_prefix = "%"; @@ -997,14 +1019,20 @@ static const arch_entry cpu_arch[] = CPU_RDPID_FLAGS, 0 }, { STRING_COMMA_LEN (".ptwrite"), PROCESSOR_UNKNOWN, CPU_PTWRITE_FLAGS, 0 }, - { STRING_COMMA_LEN (".cet"), PROCESSOR_UNKNOWN, - CPU_CET_FLAGS, 0 }, + { STRING_COMMA_LEN (".ibt"), PROCESSOR_UNKNOWN, + CPU_IBT_FLAGS, 0 }, + { STRING_COMMA_LEN (".shstk"), PROCESSOR_UNKNOWN, + CPU_SHSTK_FLAGS, 0 }, { STRING_COMMA_LEN (".gfni"), PROCESSOR_UNKNOWN, CPU_GFNI_FLAGS, 0 }, { STRING_COMMA_LEN (".vaes"), PROCESSOR_UNKNOWN, CPU_VAES_FLAGS, 0 }, { STRING_COMMA_LEN (".vpclmulqdq"), PROCESSOR_UNKNOWN, CPU_VPCLMULQDQ_FLAGS, 0 }, + { STRING_COMMA_LEN (".wbnoinvd"), PROCESSOR_UNKNOWN, + CPU_WBNOINVD_FLAGS, 0 }, + { STRING_COMMA_LEN (".pconfig"), PROCESSOR_UNKNOWN, + CPU_PCONFIG_FLAGS, 0 }, }; static const noarch_entry cpu_noarch[] = @@ -1038,6 +1066,8 @@ static const noarch_entry cpu_noarch[] = { STRING_COMMA_LEN ("noavx512_vbmi2"), CPU_ANY_AVX512_VBMI2_FLAGS }, { STRING_COMMA_LEN ("noavx512_vnni"), CPU_ANY_AVX512_VNNI_FLAGS }, { STRING_COMMA_LEN ("noavx512_bitalg"), CPU_ANY_AVX512_BITALG_FLAGS }, + { STRING_COMMA_LEN ("noibt"), CPU_ANY_IBT_FLAGS }, + { STRING_COMMA_LEN ("noshstk"), CPU_ANY_SHSTK_FLAGS }, }; #ifdef I386COFF @@ -1119,7 +1149,7 @@ const pseudo_typeS md_pseudo_table[] = #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) {"largecomm", handle_large_common, 0}, #else - {"file", (void (*) (int)) dwarf2_directive_file, 0}, + {"file", dwarf2_directive_file, 0}, {"loc", dwarf2_directive_loc, 0}, {"loc_mark_labels", dwarf2_directive_loc_mark_labels, 0}, #endif @@ -1138,105 +1168,174 @@ static struct hash_control *op_hash; /* Hash table for register lookup. */ static struct hash_control *reg_hash; -void -i386_align_code (fragS *fragP, int count) -{ /* Various efficient no-op patterns for aligning code labels. Note: Don't try to assemble the instructions in the comments. 0L and 0w are not legal. */ - static const unsigned char f32_1[] = - {0x90}; /* nop */ - static const unsigned char f32_2[] = - {0x66,0x90}; /* xchg %ax,%ax */ - static const unsigned char f32_3[] = - {0x8d,0x76,0x00}; /* leal 0(%esi),%esi */ - static const unsigned char f32_4[] = - {0x8d,0x74,0x26,0x00}; /* leal 0(%esi,1),%esi */ - static const unsigned char f32_5[] = - {0x90, /* nop */ - 0x8d,0x74,0x26,0x00}; /* leal 0(%esi,1),%esi */ - static const unsigned char f32_6[] = - {0x8d,0xb6,0x00,0x00,0x00,0x00}; /* leal 0L(%esi),%esi */ - static const unsigned char f32_7[] = - {0x8d,0xb4,0x26,0x00,0x00,0x00,0x00}; /* leal 0L(%esi,1),%esi */ - static const unsigned char f32_8[] = - {0x90, /* nop */ - 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00}; /* leal 0L(%esi,1),%esi */ - static const unsigned char f32_9[] = - {0x89,0xf6, /* movl %esi,%esi */ - 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ - static const unsigned char f32_10[] = - {0x8d,0x76,0x00, /* leal 0(%esi),%esi */ - 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ - static const unsigned char f32_11[] = - {0x8d,0x74,0x26,0x00, /* leal 0(%esi,1),%esi */ - 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ - static const unsigned char f32_12[] = - {0x8d,0xb6,0x00,0x00,0x00,0x00, /* leal 0L(%esi),%esi */ - 0x8d,0xbf,0x00,0x00,0x00,0x00}; /* leal 0L(%edi),%edi */ - static const unsigned char f32_13[] = - {0x8d,0xb6,0x00,0x00,0x00,0x00, /* leal 0L(%esi),%esi */ - 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ - static const unsigned char f32_14[] = - {0x8d,0xb4,0x26,0x00,0x00,0x00,0x00, /* leal 0L(%esi,1),%esi */ - 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ - static const unsigned char f16_3[] = - {0x8d,0x74,0x00}; /* lea 0(%esi),%esi */ - static const unsigned char f16_4[] = - {0x8d,0xb4,0x00,0x00}; /* lea 0w(%si),%si */ - static const unsigned char f16_5[] = - {0x90, /* nop */ - 0x8d,0xb4,0x00,0x00}; /* lea 0w(%si),%si */ - static const unsigned char f16_6[] = - {0x89,0xf6, /* mov %si,%si */ - 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */ - static const unsigned char f16_7[] = - {0x8d,0x74,0x00, /* lea 0(%si),%si */ - 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */ - static const unsigned char f16_8[] = - {0x8d,0xb4,0x00,0x00, /* lea 0w(%si),%si */ - 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */ - static const unsigned char jump_31[] = - {0xeb,0x1d,0x90,0x90,0x90,0x90,0x90, /* jmp .+31; lotsa nops */ - 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, - 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, - 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90}; - static const unsigned char *const f32_patt[] = { - f32_1, f32_2, f32_3, f32_4, f32_5, f32_6, f32_7, f32_8, - f32_9, f32_10, f32_11, f32_12, f32_13, f32_14 - }; - static const unsigned char *const f16_patt[] = { - f32_1, f32_2, f16_3, f16_4, f16_5, f16_6, f16_7, f16_8 - }; - /* nopl (%[re]ax) */ - static const unsigned char alt_3[] = - {0x0f,0x1f,0x00}; - /* nopl 0(%[re]ax) */ - static const unsigned char alt_4[] = - {0x0f,0x1f,0x40,0x00}; - /* nopl 0(%[re]ax,%[re]ax,1) */ - static const unsigned char alt_5[] = - {0x0f,0x1f,0x44,0x00,0x00}; - /* nopw 0(%[re]ax,%[re]ax,1) */ - static const unsigned char alt_6[] = - {0x66,0x0f,0x1f,0x44,0x00,0x00}; - /* nopl 0L(%[re]ax) */ - static const unsigned char alt_7[] = - {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00}; - /* nopl 0L(%[re]ax,%[re]ax,1) */ - static const unsigned char alt_8[] = - {0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; - /* nopw 0L(%[re]ax,%[re]ax,1) */ - static const unsigned char alt_9[] = - {0x66,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; - /* nopw %cs:0L(%[re]ax,%[re]ax,1) */ - static const unsigned char alt_10[] = - {0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; - static const unsigned char *const alt_patt[] = { - f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8, - alt_9, alt_10 - }; +static const unsigned char f32_1[] = + {0x90}; /* nop */ +static const unsigned char f32_2[] = + {0x66,0x90}; /* xchg %ax,%ax */ +static const unsigned char f32_3[] = + {0x8d,0x76,0x00}; /* leal 0(%esi),%esi */ +static const unsigned char f32_4[] = + {0x8d,0x74,0x26,0x00}; /* leal 0(%esi,1),%esi */ +static const unsigned char f32_5[] = + {0x90, /* nop */ + 0x8d,0x74,0x26,0x00}; /* leal 0(%esi,1),%esi */ +static const unsigned char f32_6[] = + {0x8d,0xb6,0x00,0x00,0x00,0x00}; /* leal 0L(%esi),%esi */ +static const unsigned char f32_7[] = + {0x8d,0xb4,0x26,0x00,0x00,0x00,0x00}; /* leal 0L(%esi,1),%esi */ +static const unsigned char f32_8[] = + {0x90, /* nop */ + 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00}; /* leal 0L(%esi,1),%esi */ +static const unsigned char f32_9[] = + {0x89,0xf6, /* movl %esi,%esi */ + 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ +static const unsigned char f32_10[] = + {0x8d,0x76,0x00, /* leal 0(%esi),%esi */ + 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ +static const unsigned char f32_11[] = + {0x8d,0x74,0x26,0x00, /* leal 0(%esi,1),%esi */ + 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ +static const unsigned char f32_12[] = + {0x8d,0xb6,0x00,0x00,0x00,0x00, /* leal 0L(%esi),%esi */ + 0x8d,0xbf,0x00,0x00,0x00,0x00}; /* leal 0L(%edi),%edi */ +static const unsigned char f32_13[] = + {0x8d,0xb6,0x00,0x00,0x00,0x00, /* leal 0L(%esi),%esi */ + 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ +static const unsigned char f32_14[] = + {0x8d,0xb4,0x26,0x00,0x00,0x00,0x00, /* leal 0L(%esi,1),%esi */ + 0x8d,0xbc,0x27,0x00,0x00,0x00,0x00}; /* leal 0L(%edi,1),%edi */ +static const unsigned char f16_3[] = + {0x8d,0x74,0x00}; /* lea 0(%esi),%esi */ +static const unsigned char f16_4[] = + {0x8d,0xb4,0x00,0x00}; /* lea 0w(%si),%si */ +static const unsigned char f16_5[] = + {0x90, /* nop */ + 0x8d,0xb4,0x00,0x00}; /* lea 0w(%si),%si */ +static const unsigned char f16_6[] = + {0x89,0xf6, /* mov %si,%si */ + 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */ +static const unsigned char f16_7[] = + {0x8d,0x74,0x00, /* lea 0(%si),%si */ + 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */ +static const unsigned char f16_8[] = + {0x8d,0xb4,0x00,0x00, /* lea 0w(%si),%si */ + 0x8d,0xbd,0x00,0x00}; /* lea 0w(%di),%di */ +static const unsigned char jump_31[] = + {0xeb,0x1d,0x90,0x90,0x90,0x90,0x90, /* jmp .+31; lotsa nops */ + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, + 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90}; +/* 32-bit NOPs patterns. */ +static const unsigned char *const f32_patt[] = { + f32_1, f32_2, f32_3, f32_4, f32_5, f32_6, f32_7, f32_8, + f32_9, f32_10, f32_11, f32_12, f32_13, f32_14 +}; +/* 16-bit NOPs patterns. */ +static const unsigned char *const f16_patt[] = { + f32_1, f32_2, f16_3, f16_4, f16_5, f16_6, f16_7, f16_8 +}; +/* nopl (%[re]ax) */ +static const unsigned char alt_3[] = + {0x0f,0x1f,0x00}; +/* nopl 0(%[re]ax) */ +static const unsigned char alt_4[] = + {0x0f,0x1f,0x40,0x00}; +/* nopl 0(%[re]ax,%[re]ax,1) */ +static const unsigned char alt_5[] = + {0x0f,0x1f,0x44,0x00,0x00}; +/* nopw 0(%[re]ax,%[re]ax,1) */ +static const unsigned char alt_6[] = + {0x66,0x0f,0x1f,0x44,0x00,0x00}; +/* nopl 0L(%[re]ax) */ +static const unsigned char alt_7[] = + {0x0f,0x1f,0x80,0x00,0x00,0x00,0x00}; +/* nopl 0L(%[re]ax,%[re]ax,1) */ +static const unsigned char alt_8[] = + {0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; +/* nopw 0L(%[re]ax,%[re]ax,1) */ +static const unsigned char alt_9[] = + {0x66,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; +/* nopw %cs:0L(%[re]ax,%[re]ax,1) */ +static const unsigned char alt_10[] = + {0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; +/* 32-bit and 64-bit NOPs patterns. */ +static const unsigned char *const alt_patt[] = { + f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8, + alt_9, alt_10 +}; +/* 64-bit only: nopw %cs:0L(%eax,%eax,1) */ +static const unsigned char alt64_11[] = + {0x67,0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00}; +/* 64-bit NOPs patterns. */ +static const unsigned char *const alt64_patt[] = { + f32_1, f32_2, alt_3, alt_4, alt_5, alt_6, alt_7, alt_8, + alt_9, alt_10, alt64_11 +}; + +/* Genenerate COUNT bytes of NOPs to WHERE from PATT with the maximum + size of a single NOP instruction MAX_SINGLE_NOP_SIZE. */ +static void +i386_output_nops (char *where, const unsigned char *const *patt, + int count, int max_single_nop_size) + +{ + while (count > max_single_nop_size) + { + count -= max_single_nop_size; + memcpy (where + count, patt[max_single_nop_size - 1], + max_single_nop_size); + } + + if (count) + memcpy (where, patt[count - 1], count); +} + + +/* Genenerate COUNT bytes of NOPs to WHERE with the maximum size of a + single NOP instruction LIMIT. */ + +void +i386_generate_nops (fragS *f, char *where, offsetT count, int limit) +{ + /* Output NOPs for .nop directive. */ + int max_single_nop_size; + const unsigned char *const *patt; + + if (flag_code == CODE_16BIT) + { + patt = f16_patt; + max_single_nop_size = sizeof (f16_patt) / sizeof (f16_patt[0]); + } + else if (flag_code == CODE_64BIT) + { + patt = alt64_patt; + max_single_nop_size = sizeof (alt64_patt) / sizeof (alt64_patt[0]); + } + else + { + patt = alt_patt; + max_single_nop_size = sizeof (alt_patt) / sizeof (alt_patt[0]); + } + if (limit == 0) + limit = max_single_nop_size; + else if (limit > max_single_nop_size) + { + as_bad_where (f->fr_file, f->fr_line, + _("invalide single nop size: %d (expect within [0, %d])"), + limit, max_single_nop_size); + return; + } + + i386_output_nops (where, patt, count, limit); +} + +void +i386_align_code (fragS *fragP, int count) +{ /* Only align for at least a positive non-zero boundary. */ if (count <= 0 || count > MAX_MEM_FOR_RS_ALIGN_CODE) return; @@ -1389,17 +1488,8 @@ i386_align_code (fragS *fragP, int count) /* Maximum length of an instruction is 10 byte. If the padding is greater than 10 bytes and we don't use jump, we have to break it into smaller pieces. */ - int padding = count; - while (padding > 10) - { - padding -= 10; - memcpy (fragP->fr_literal + fragP->fr_fix + padding, - patt [9], 10); - } - - if (padding) - memcpy (fragP->fr_literal + fragP->fr_fix, - patt [padding - 1], padding); + i386_output_nops (fragP->fr_literal + fragP->fr_fix, + patt, count, 10); } } fragP->fr_var = count; @@ -2114,6 +2204,18 @@ fits_in_imm4 (offsetT num) return (num & 0xf) == num; } +static INLINE int +fits_in_imm7 (offsetT num) +{ + return (num & 0x7f) == num; +} + +static INLINE int +fits_in_imm31 (offsetT num) +{ + return (num & 0x7fffffff) == num; +} + static i386_operand_type smallest_imm_type (offsetT num) { @@ -3641,6 +3743,184 @@ check_hle (void) } } +/* Try the shortest encoding by shortening operand size. */ + +static void +optimize_encoding (void) +{ + int j; + + if (optimize_for_space + && i.reg_operands == 1 + && i.imm_operands == 1 + && !i.types[1].bitfield.byte + && i.op[0].imms->X_op == O_constant + && fits_in_imm7 (i.op[0].imms->X_add_number) + && ((i.tm.base_opcode == 0xa8 + && i.tm.extension_opcode == None) + || (i.tm.base_opcode == 0xf6 + && i.tm.extension_opcode == 0x0))) + { + /* Optimize: -Os: + test $imm7, %r64/%r32/%r16 -> test $imm7, %r8 + */ + unsigned int base_regnum = i.op[1].regs->reg_num; + if (flag_code == CODE_64BIT || base_regnum < 4) + { + i.types[1].bitfield.byte = 1; + /* Ignore the suffix. */ + i.suffix = 0; + if (base_regnum >= 4 + && !(i.op[1].regs->reg_flags & RegRex)) + { + /* Handle SP, BP, SI and DI registers. */ + if (i.types[1].bitfield.word) + j = 16; + else if (i.types[1].bitfield.dword) + j = 32; + else + j = 48; + i.op[1].regs -= j; + } + } + } + else if (flag_code == CODE_64BIT + && ((i.reg_operands == 1 + && i.imm_operands == 1 + && i.op[0].imms->X_op == O_constant + && ((i.tm.base_opcode == 0xb0 + && i.tm.extension_opcode == None + && fits_in_unsigned_long (i.op[0].imms->X_add_number)) + || (fits_in_imm31 (i.op[0].imms->X_add_number) + && (((i.tm.base_opcode == 0x24 + || i.tm.base_opcode == 0xa8) + && i.tm.extension_opcode == None) + || (i.tm.base_opcode == 0x80 + && i.tm.extension_opcode == 0x4) + || ((i.tm.base_opcode == 0xf6 + || i.tm.base_opcode == 0xc6) + && i.tm.extension_opcode == 0x0))))) + || (i.reg_operands == 2 + && i.op[0].regs == i.op[1].regs + && ((i.tm.base_opcode == 0x30 + || i.tm.base_opcode == 0x28) + && i.tm.extension_opcode == None))) + && i.types[1].bitfield.qword) + { + /* Optimize: -O: + andq $imm31, %r64 -> andl $imm31, %r32 + testq $imm31, %r64 -> testl $imm31, %r32 + xorq %r64, %r64 -> xorl %r32, %r32 + subq %r64, %r64 -> subl %r32, %r32 + movq $imm31, %r64 -> movl $imm31, %r32 + movq $imm32, %r64 -> movl $imm32, %r32 + */ + i.tm.opcode_modifier.norex64 = 1; + if (i.tm.base_opcode == 0xb0 || i.tm.base_opcode == 0xc6) + { + /* Handle + movq $imm31, %r64 -> movl $imm31, %r32 + movq $imm32, %r64 -> movl $imm32, %r32 + */ + i.tm.operand_types[0].bitfield.imm32 = 1; + i.tm.operand_types[0].bitfield.imm32s = 0; + i.tm.operand_types[0].bitfield.imm64 = 0; + i.types[0].bitfield.imm32 = 1; + i.types[0].bitfield.imm32s = 0; + i.types[0].bitfield.imm64 = 0; + i.types[1].bitfield.dword = 1; + i.types[1].bitfield.qword = 0; + if (i.tm.base_opcode == 0xc6) + { + /* Handle + movq $imm31, %r64 -> movl $imm31, %r32 + */ + i.tm.base_opcode = 0xb0; + i.tm.extension_opcode = None; + i.tm.opcode_modifier.shortform = 1; + i.tm.opcode_modifier.modrm = 0; + } + } + } + else if (optimize > 1 + && i.reg_operands == 3 + && i.op[0].regs == i.op[1].regs + && !i.types[2].bitfield.xmmword + && (i.tm.opcode_modifier.vex + || (!i.mask + && !i.rounding + && i.tm.opcode_modifier.evex + && cpu_arch_flags.bitfield.cpuavx512vl)) + && ((i.tm.base_opcode == 0x55 + || i.tm.base_opcode == 0x6655 + || i.tm.base_opcode == 0x66df + || i.tm.base_opcode == 0x57 + || i.tm.base_opcode == 0x6657 + || i.tm.base_opcode == 0x66ef + || i.tm.base_opcode == 0x66f8 + || i.tm.base_opcode == 0x66f9 + || i.tm.base_opcode == 0x66fa + || i.tm.base_opcode == 0x66fb) + && i.tm.extension_opcode == None)) + { + /* Optimize: -O2: + VOP, one of vandnps, vandnpd, vxorps, vxorpd, vpsubb, vpsubd, + vpsubq and vpsubw: + EVEX VOP %zmmM, %zmmM, %zmmN + -> VEX VOP %xmmM, %xmmM, %xmmN (M and N < 16) + -> EVEX VOP %xmmM, %xmmM, %xmmN (M || N >= 16) + EVEX VOP %ymmM, %ymmM, %ymmN + -> VEX VOP %xmmM, %xmmM, %xmmN (M and N < 16) + -> EVEX VOP %xmmM, %xmmM, %xmmN (M || N >= 16) + VEX VOP %ymmM, %ymmM, %ymmN + -> VEX VOP %xmmM, %xmmM, %xmmN + VOP, one of vpandn and vpxor: + VEX VOP %ymmM, %ymmM, %ymmN + -> VEX VOP %xmmM, %xmmM, %xmmN + VOP, one of vpandnd and vpandnq: + EVEX VOP %zmmM, %zmmM, %zmmN + -> VEX vpandn %xmmM, %xmmM, %xmmN (M and N < 16) + -> EVEX VOP %xmmM, %xmmM, %xmmN (M || N >= 16) + EVEX VOP %ymmM, %ymmM, %ymmN + -> VEX vpandn %xmmM, %xmmM, %xmmN (M and N < 16) + -> EVEX VOP %xmmM, %xmmM, %xmmN (M || N >= 16) + VOP, one of vpxord and vpxorq: + EVEX VOP %zmmM, %zmmM, %zmmN + -> VEX vpxor %xmmM, %xmmM, %xmmN (M and N < 16) + -> EVEX VOP %xmmM, %xmmM, %xmmN (M || N >= 16) + EVEX VOP %ymmM, %ymmM, %ymmN + -> VEX vpxor %xmmM, %xmmM, %xmmN (M and N < 16) + -> EVEX VOP %xmmM, %xmmM, %xmmN (M || N >= 16) + */ + if (i.tm.opcode_modifier.evex) + { + /* If only lower 16 vector registers are used, we can use + VEX encoding. */ + for (j = 0; j < 3; j++) + if (register_number (i.op[j].regs) > 15) + break; + + if (j < 3) + i.tm.opcode_modifier.evex = EVEX128; + else + { + i.tm.opcode_modifier.vex = VEX128; + i.tm.opcode_modifier.vexw = VEXW0; + i.tm.opcode_modifier.evex = 0; + } + } + else + i.tm.opcode_modifier.vex = VEX128; + + if (i.tm.opcode_modifier.vex) + for (j = 0; j < 3; j++) + { + i.types[j].bitfield.xmmword = 1; + i.types[j].bitfield.ymmword = 0; + } + } +} + /* This is the guts of the machine-dependent assembler. LINE points to a machine dependent instruction. This function is supposed to emit the frags/bytes it assembles to. */ @@ -3806,6 +4086,9 @@ md_assemble (char *line) i.disp_operands = 0; } + if (optimize && !i.no_optimize && i.tm.opcode_modifier.optimize) + optimize_encoding (); + if (!process_suffix ()) return; @@ -3924,6 +4207,26 @@ md_assemble (char *line) } } + if (i.rex == 0 && i.rex_encoding) + { + /* Check if we can add a REX_OPCODE byte. Look for 8 bit operand + that uses legacy register. If it is "hi" register, don't add + the REX_OPCODE byte. */ + int x; + for (x = 0; x < 2; x++) + if (i.types[x].bitfield.reg + && i.types[x].bitfield.byte + && (i.op[x].regs->reg_flags & RegRex64) == 0 + && i.op[x].regs->reg_num > 3) + { + i.rex_encoding = FALSE; + break; + } + + if (i.rex_encoding) + i.rex = REX_OPCODE; + } + if (i.rex != 0) add_prefix (REX_OPCODE | i.rex); @@ -4036,6 +4339,14 @@ parse_insn (char *line, char *mnemonic) /* {evex} */ i.vec_encoding = vex_encoding_evex; break; + case 0x7: + /* {rex} */ + i.rex_encoding = TRUE; + break; + case 0x8: + /* {nooptimize} */ + i.no_optimize = TRUE; + break; default: abort (); } @@ -4048,7 +4359,7 @@ parse_insn (char *line, char *mnemonic) case PREFIX_EXIST: return NULL; case PREFIX_DS: - if (current_templates->start->cpu_flags.bitfield.cpucet) + if (current_templates->start->cpu_flags.bitfield.cpuibt) i.notrack_prefix = current_templates->start->name; break; case PREFIX_REP: @@ -7015,12 +7326,46 @@ output_branch (void) frag_var (rs_machine_dependent, 5, i.reloc[0], subtype, sym, off, p); } +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) +/* Return TRUE iff PLT32 relocation should be used for branching to + symbol S. */ + +static bfd_boolean +need_plt32_p (symbolS *s) +{ + /* PLT32 relocation is ELF only. */ + if (!IS_ELF) + return FALSE; + + /* Since there is no need to prepare for PLT branch on x86-64, we + can generate R_X86_64_PLT32, instead of R_X86_64_PC32, which can + be used as a marker for 32-bit PC-relative branches. */ + if (!object_64bit) + return FALSE; + + /* Weak or undefined symbol need PLT32 relocation. */ + if (S_IS_WEAK (s) || !S_IS_DEFINED (s)) + return TRUE; + + /* Non-global symbol doesn't need PLT32 relocation. */ + if (! S_IS_EXTERNAL (s)) + return FALSE; + + /* Other global symbols need PLT32 relocation. NB: Symbol with + non-default visibilities are treated as normal global symbol + so that PLT32 relocation can be used as a marker for 32-bit + PC-relative branches. It is useful for linker relaxation. */ + return TRUE; +} +#endif + static void output_jump (void) { char *p; int size; fixS *fixP; + bfd_reloc_code_real_type jump_reloc = i.reloc[0]; if (i.tm.opcode_modifier.jumpbyte) { @@ -7088,8 +7433,17 @@ output_jump (void) abort (); } +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) + if (size == 4 + && jump_reloc == NO_RELOC + && need_plt32_p (i.op[0].disps->X_add_symbol)) + jump_reloc = BFD_RELOC_X86_64_PLT32; +#endif + + jump_reloc = reloc (size, 1, 1, jump_reloc); + fixP = fix_new_exp (frag_now, p - frag_now->fr_literal, size, - i.op[0].disps, 1, reloc (size, 1, 1, i.reloc[0])); + i.op[0].disps, 1, jump_reloc); /* All jumps handled here are signed, but don't use a signed limit check for 32 and 16 bit jumps as we want to allow wrap around at @@ -9307,6 +9661,10 @@ md_estimate_size_before_relax (fragS *fragP, segT segment) reloc_type = (enum bfd_reloc_code_real) fragP->fr_var; else if (size == 2) reloc_type = BFD_RELOC_16_PCREL; +#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) + else if (need_plt32_p (fragP->fr_symbol)) + reloc_type = BFD_RELOC_X86_64_PLT32; +#endif else reloc_type = BFD_RELOC_32_PCREL; @@ -9932,9 +10290,9 @@ md_operand (expressionS *e) #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) -const char *md_shortopts = "kVQ:sqn"; +const char *md_shortopts = "kVQ:sqnO::"; #else -const char *md_shortopts = "qn"; +const char *md_shortopts = "qnO::"; #endif #define OPTION_32 (OPTION_MD_BASE + 0) @@ -10371,6 +10729,27 @@ md_parse_option (int c, const char *arg) intel64 = 1; break; + case 'O': + if (arg == NULL) + { + optimize = 1; + /* Turn off -Os. */ + optimize_for_space = 0; + } + else if (*arg == 's') + { + optimize_for_space = 1; + /* Turn on all encoding optimizations. */ + optimize = -1; + } + else + { + optimize = atoi (arg); + /* Turn off -Os. */ + optimize_for_space = 0; + } + break; + default: return 0; } diff --git a/gas/config/tc-i386.h b/gas/config/tc-i386.h index 6e4f440..1250bc2 100644 --- a/gas/config/tc-i386.h +++ b/gas/config/tc-i386.h @@ -281,6 +281,11 @@ extern void sco_id (void); #define WORKING_DOT_WORD 1 +/* How to generate NOPs for .nop direct directive. */ +extern void i386_generate_nops (fragS *, char *, offsetT, int); +#define md_generate_nops(frag, where, amount, control) \ + i386_generate_nops ((frag), (where), (amount), (control)) + /* We want .cfi_* pseudo-ops for generating unwind info. */ #define TARGET_USE_CFIPOP 1 diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 97c9109..6c68395 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -1460,7 +1460,6 @@ enum options OPTION_NO_MCU, OPTION_MIPS16E2, OPTION_NO_MIPS16E2, - OPTION_COMPAT_ARCH_BASE, OPTION_M4650, OPTION_NO_M4650, OPTION_M4010, @@ -13956,7 +13955,7 @@ mips_lookup_insn (struct hash_control *hash, const char *start, suffix = 0; if (suffix) { - memcpy (name + opend - 2, name + opend, length - opend + 1); + memmove (name + opend - 2, name + opend, length - opend + 1); insn = (struct mips_opcode *) hash_find (hash, name); if (insn) { @@ -19325,7 +19324,7 @@ s_mips_file (int x ATTRIBUTE_UNUSED) { char *filename; - filename = dwarf2_directive_file (0); + filename = dwarf2_directive_filename (); /* Versions of GCC up to 3.1 start files with a ".file" directive even for stabs output. Make sure that this @@ -19958,6 +19957,9 @@ MIPS options:\n\ -mips16 generate mips16 instructions\n\ -no-mips16 do not generate mips16 instructions\n")); fprintf (stream, _("\ +-mmips16e2 generate MIPS16e2 instructions\n\ +-mno-mips16e2 do not generate MIPS16e2 instructions\n")); + fprintf (stream, _("\ -mmicromips generate microMIPS instructions\n\ -mno-micromips do not generate microMIPS instructions\n")); fprintf (stream, _("\ @@ -20044,9 +20046,14 @@ MIPS options:\n\ fputc ('\n', stream); fprintf (stream, _("\ --32 create o32 ABI object file (default)\n\ --n32 create n32 ABI object file\n\ --64 create 64 ABI object file\n")); +-32 create o32 ABI object file%s\n"), + MIPS_DEFAULT_ABI == O32_ABI ? _(" (default)") : ""); + fprintf (stream, _("\ +-n32 create n32 ABI object file%s\n"), + MIPS_DEFAULT_ABI == N32_ABI ? _(" (default)") : ""); + fprintf (stream, _("\ +-64 create 64 ABI object file%s\n"), + MIPS_DEFAULT_ABI == N64_ABI ? _(" (default)") : ""); } #ifdef TE_IRIX diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c index b2741b8..f8cbd80 100644 --- a/gas/config/tc-nds32.c +++ b/gas/config/tc-nds32.c @@ -19,6 +19,8 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#pragma GCC diagnostic ignored "-Wstack-usage=" + #include "as.h" #include "safe-ctype.h" #include "subsegs.h" @@ -35,6 +37,8 @@ #include "opcode/nds32.h" #include +#include +#include /* GAS definitions. */ @@ -66,6 +70,8 @@ struct nds32_relocs_pattern struct nds32_opcode *opcode; char *where; struct nds32_relocs_pattern *next; + /* Assembled instruction bytes. */ + uint32_t insn; }; /* Suffix name and relocation. */ @@ -73,7 +79,6 @@ struct suffix_name { const char *suffix; short unsigned int reloc; - int pic; }; static int vec_size = 0; /* If the assembly code is generated by compiler, it is supposed to have @@ -87,11 +92,7 @@ static struct hash_control *nds32_hint_hash; /* Generate relocation for relax or not, and the default is true. */ static int enable_relax_relocs = 1; -/* The value will be used in RELAX_ENTRY. */ -static int enable_relax_ex9 = 0; -/* The value will be used in RELAX_ENTRY. */ -static int enable_relax_ifc = 0; -/* Save option -O for performance. */ +/* Save option -O for perfomance. */ static int optimize = 0; /* Save option -Os for code size. */ static int optimize_for_space = 0; @@ -99,1768 +100,1798 @@ static int optimize_for_space = 0; static int label_exist = 0; /* Flag to save state in omit_fp region. */ static int in_omit_fp = 0; -extern struct nds32_keyword keyword_gpr[]; +extern keyword_t keyword_gpr[]; /* Tag there is relax relocation having to link. */ static bfd_boolean relaxing = FALSE; +/* Save security status. */ +static bfd_boolean crcing = FALSE; +/* Inline asm status. */ +static bfd_boolean inline_asm = FALSE; +/* v3 is compatiable with v3f/v3s. */ +static bfd_boolean compatible_abi = FALSE; +/* ICT model. */ +enum ict_option { + ICT_NONE = 0, + ICT_SMALL, + ICT_LARGE +}; +static enum ict_option ict_flag = ICT_NONE; +/* True if ICT existed. */ +static bfd_boolean ict_exist = FALSE; static struct hash_control *nds32_relax_info_hash; +/* Branch pattern. */ static relax_info_t relax_table[] = { - { - "jal", /* opcode */ - BR_RANGE_S16M, /* br_range */ - {{0, 0, 0, FALSE}}, /* cond_field */ - { - { - INSN_JAL /* jal label */ - }, /* BR_RANGE_S256 */ - { - INSN_JAL /* jal label */ - }, /* BR_RANGE_S16K */ - { - INSN_JAL /* jal label */ - }, /* BR_RANGE_S64K */ - { - INSN_JAL /* jal label */ - }, /* BR_RANGE_S16M */ - { - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JRAL_TA - }, /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - {{0, 0, 0, FALSE}}, /* BR_RANGE_S256 */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S64K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16M */ - {{0, 0, 0, FALSE}} /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 4, 12}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, 0, BFD_RELOC_NDS32_HI20}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL4}, - {4, 4, NDS32_HINT | NDS32_FIX, BFD_RELOC_NDS32_LO12S0_ORI}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {8, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {8, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bltzal", /* opcode */ - BR_RANGE_S64K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BLTZAL /* bltzal $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BLTZAL /* bltzal $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BLTZAL /* bltzal $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BGEZ, /* bgez $rt, $1 */ - INSN_JAL /* jal label */ - }, /* BR_RANGE_S16M */ - { - INSN_BGEZ, /* bgez $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JRAL_TA /* jral $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bgezal", /* opcode */ - BR_RANGE_S64K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BGEZAL /* bgezal $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BGEZAL /* bgezal $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BGEZAL /* bgezal $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BLTZ, /* bltz $rt, $1 */ - INSN_JAL /* jal label */ - }, /* BR_RANGE_S16M */ - { - INSN_BLTZ, /* bltz $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JRAL_TA /* jral $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "j", /* opcode */ - BR_RANGE_S16M, /* br_range */ - {{0, 0, 0, FALSE}}, /* cond_field */ - { - { - (INSN_J8 << 16) /* j8 label */ - }, /* BR_RANGE_S256 */ - { - INSN_J /* j label */ - }, /* BR_RANGE_S16K */ - { - INSN_J /* j label */ - }, /* BR_RANGE_S64K */ - { - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - }, /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - {{0, 0, 0, FALSE}}, /* BR_RANGE_S256 */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S64K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16M */ - {{0, 0, 0, FALSE}} /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {2, 4, 4, 4, 12}, /* relax_code_size */ - {2, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, 0, BFD_RELOC_NDS32_HI20}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP4}, - {4, 4, NDS32_HINT | NDS32_FIX, BFD_RELOC_NDS32_LO12S0_ORI}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {8, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {8, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "j8", /* opcode */ - BR_RANGE_S256, /* br_range */ - {{0, 0, 0, FALSE}}, /* cond_field */ - { - { - (INSN_J8 << 16) /* j8 label */ - }, /* BR_RANGE_S256 */ - { - INSN_J /* j label */ - }, /* BR_RANGE_S16K */ - { - INSN_J /* j label */ - }, /* BR_RANGE_S64K */ - { - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - }, /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - {{0, 0, 0, FALSE}}, /* BR_RANGE_S256 */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S64K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16M */ - {{0, 0, 0, FALSE}} /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {2, 4, 4, 4, 12}, /* relax_code_size */ - {2, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, 0, BFD_RELOC_NDS32_HI20}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP4}, - {4, 4, NDS32_HINT | NDS32_FIX, BFD_RELOC_NDS32_LO12S0_ORI}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {8, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {8, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "beqz", /* opcode */ - BR_RANGE_S64K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BEQZ /* beqz $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BEQZ /* beqz $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BEQZ /* beqz $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BNEZ, /* bnez $rt, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BNEZ, /* bnez $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 4, NDS32_INSN16 , BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bgez", /* opcode */ - BR_RANGE_S64K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BGEZ /* bgez $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BGEZ /* bgez $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BGEZ /* bgez $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BLTZ, /* bltz $rt, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BLTZ, /* bltz $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bnez", /* opcode */ - BR_RANGE_S64K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BNEZ /* bnez $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BNEZ /* bnez $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BNEZ /* bnez $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BEQZ, /* beqz $rt, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BEQZ, /* beqz $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 4, NDS32_INSN16 , BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bgtz", /* opcode */ - BR_RANGE_S64K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BGTZ /* bgtz $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BGTZ /* bgtz $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BGTZ /* bgtz $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BLEZ, /* blez $rt, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BLEZ, /* blez $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "blez", /* opcode */ - BR_RANGE_S64K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BLEZ /* blez $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BLEZ /* blez $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BLEZ /* blez $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BGTZ, /* bgtz $rt, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BGTZ, /* bgtz $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bltz", /* opcode */ - BR_RANGE_S64K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BLTZ /* bltz $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BLTZ /* bltz $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BLTZ /* bltz $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BGEZ, /* bgez $rt, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BGEZ, /* bgez $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 4, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "beq", /* opcode */ - BR_RANGE_S16K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BEQ /* beq $rt, $ra, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BEQ /* beq $rt, $ra, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BNE, /* bne $rt, $ra, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S64K */ - { - INSN_BNE, /* bne $rt, $ra, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BNE, /* bne $rt, $ra, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 8, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_ABS, BFD_RELOC_NDS32_EMPTY}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bne", /* opcode */ - BR_RANGE_S16K, /* br_range */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BNE /* bne $rt, $ra, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BNE /* bne $rt, $ra, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BEQ, /* beq $rt, $ra, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S64K */ - { - INSN_BEQ, /* beq $rt, $ra, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BEQ, /* beq $rt, $ra, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 15, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 4, 8, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "beqz38", /* opcode */ - BR_RANGE_S256, /* br_range */ - { - {0, 8, 0x7, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BEQZ38 << 16 /* beqz $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BEQZ /* beqz $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BEQZ /* beqz $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BNEZ, /* bnez $rt, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BNEZ, /* bnez $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - { - {0, 8, 0x7, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {2, 4, 4, 8, 16}, /* relax_code_size */ - {2, 4, 4, 4, 4}, /* relax_branch_isize */ - { - { - {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bnez38", /* opcode */ - BR_RANGE_S256, /* br_range */ - { - {0, 8, 0x7, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ - { - { - INSN_BNEZ38 << 16 /* bnez $rt, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BNEZ /* bnez $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BNEZ /* bnez $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BEQZ, /* beqz $rt, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BEQZ, /* beqz $rt, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ { - { - {0, 8, 0x7, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {2, 4, 4, 8, 16}, /* relax_code_size */ - {2, 4, 4, 4, 4}, /* relax_branch_isize */ + .opcode = "jal", + .br_range = BR_RANGE_S16M, + .cond_field = { + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_JAL}, /* jal label */ + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_JAL}, /* jal label */ + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_JAL}, /* jal label */ + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_JAL}, /* jal label */ + .relax_code_size[BR_RANGE_S16M] = 4, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JRAL_TA}, /* jral $ta */ + .relax_code_size[BR_RANGE_U4G] = 12, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, 0, BFD_RELOC_NDS32_HI20}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL4}, + {4, 4, NDS32_HINT | NDS32_FIX, BFD_RELOC_NDS32_LO12S0_ORI}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {8, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "beqzs8", /* opcode */ - BR_RANGE_S256, /* br_range */ - {{0, 0, 0, FALSE}}, /* cond_field */ + .opcode = "bgezal", + .br_range = BR_RANGE_S64K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BGEZAL}, /* bgezal $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BGEZAL}, /* bgezal $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BGEZAL}, /* bgezal $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BLTZ, /* bltz $rt, $1 */ + INSN_JAL}, /* jal label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BLTZ, /* bltz $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JRAL_TA}, /* jral $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - INSN_BEQZS8 << 16 /* beqz $r15, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BEQZ_TA /* bnez $rt, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BEQZ_TA /* bnez $rt, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BNEZ_TA, /* bnez $r15, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BNEZ_TA, /* bnez $r15, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - {{0, 0, 0, FALSE}}, /* BR_RANGE_S256 */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S64K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16M */ - {{0, 0, 0, FALSE}} /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {2, 4, 4, 8, 16}, /* relax_code_size */ - {2, 4, 4, 4, 4}, /* relax_branch_isize */ + .opcode = "bltzal", + .br_range = BR_RANGE_S64K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BLTZAL}, /* bltzal $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BLTZAL}, /* bltzal $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BLTZAL}, /* bltzal $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BGEZ, /* bgez $rt, $1 */ + INSN_JAL}, /* jal label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BGEZ, /* bgez $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JRAL_TA}, /* jral $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bnezs8", /* opcode */ - BR_RANGE_S256, /* br_range */ - {{0, 0, 0, FALSE}}, /* cond_field */ + .opcode = "j", + .br_range = BR_RANGE_S16M, + .cond_field = { + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + (INSN_J8 << 16)}, /* j8 label */ + .relax_code_size[BR_RANGE_S256] = 2, + .relax_branch_isize[BR_RANGE_S256] = 2, + .relax_fixup[BR_RANGE_S256] = { + {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_J}, /* j label */ + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_J}, /* j label */ + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_J}, /* j label */ + .relax_code_size[BR_RANGE_S16M] = 4, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_size[BR_RANGE_U4G] = 12, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, 0, BFD_RELOC_NDS32_HI20}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP4}, + {4, 4, NDS32_HINT | NDS32_FIX, BFD_RELOC_NDS32_LO12S0_ORI}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {8, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - INSN_BNEZS8 << 16 /* bnez $r15, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BNEZ_TA /* bnez $r15, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BNEZ_TA /* bnez $r15, label */ - }, /* BR_RANGE_S64K */ - { - INSN_BEQZ_TA, /* beqz $r15, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BEQZ_TA, /* beqz $r15, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ - { - {{0, 0, 0, FALSE}}, /* BR_RANGE_S256 */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S64K */ - {{0, 0, 0, FALSE}}, /* BR_RANGE_S16M */ - {{0, 0, 0, FALSE}} /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {2, 4, 4, 8, 16}, /* relax_code_size */ - {2, 4, 4, 4, 4}, /* relax_branch_isize */ + .opcode = "j8", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + (INSN_J8 << 16)}, /* j8 label */ + .relax_code_size[BR_RANGE_S256] = 2, + .relax_branch_isize[BR_RANGE_S256] = 2, + .relax_fixup[BR_RANGE_S256] = { + {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_J}, /* j label */ + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_J}, /* j label */ + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_J}, /* j label */ + .relax_code_size[BR_RANGE_S16M] = 4, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_size[BR_RANGE_U4G] = 12, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, 0, BFD_RELOC_NDS32_HI20}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP4}, + {4, 4, NDS32_HINT | NDS32_FIX, BFD_RELOC_NDS32_LO12S0_ORI}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {8, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bnes38", /* opcode */ - BR_RANGE_S256, /* br_range */ + .opcode = "beqz", + .br_range = BR_RANGE_S64K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + /* We do not use beqz38 and beqzs8 here directly because we + don't want to check register number for specail condition. */ + .relax_code_seq[BR_RANGE_S256] = { + INSN_BEQZ}, /* beqz $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 4, NDS32_INSN16 , BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BEQZ}, /* beqz $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BEQZ}, /* beqz $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BNEZ, /* bnez $rt, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + /* bnez range is 17 pcrel, but it use 15 pcrel here since link time + relaxtion. If 17 pcrel can reach, it do not have to + use S16M. Therefore, 15 pcrel is just for linker to + distinguish LONGJUMP5 and LONGJUMP6. */ + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BNEZ, /* bnez $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - {0, 8, 0x7, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ + .opcode = "bgez", + .br_range = BR_RANGE_S64K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BGEZ}, /* bgez $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BGEZ}, /* bgez $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BGEZ}, /* bgez $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BLTZ, /* bltz $rt, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BLTZ, /* bltz $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - INSN_BNES38 << 16 /* bne $rt, $R5, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BNE_R5 /* bne $rt, $R5, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BEQ_R5, /* beq $rt, $R5, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S64K */ - { - INSN_BEQ_R5, /* beq $rt, $R5, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BEQ_R5, /* beq $rt, $R5, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ + .opcode = "bnez", + .br_range = BR_RANGE_S64K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BNEZ}, /* bnez $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BNEZ}, /* bnez $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BNEZ}, /* bnez $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BEQZ, /* beqz $rt, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BEQZ, /* beqz $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 8, 0x7, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {2, 4, 8, 8, 16}, /* relax_code_size */ - {2, 4, 4, 4, 4}, /* relax_branch_isize */ + .opcode = "bgtz", + .br_range = BR_RANGE_S64K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BGTZ}, /* bgtz $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BGTZ}, /* bgtz $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BGTZ}, /* bgtz $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BLEZ, /* blez $rt, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BLEZ, /* blez $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "beqs38", /* opcode */ - BR_RANGE_S256, /* br_range */ + .opcode = "blez", + .br_range = BR_RANGE_S64K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BLEZ}, /* blez $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BLEZ}, /* blez $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BLEZ}, /* blez $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BGTZ, /* bgtz $rt, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BGTZ, /* bgtz $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - {0, 8, 0x7, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ + .opcode = "bltz", + .br_range = BR_RANGE_S64K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BLTZ}, /* bltz $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BLTZ}, /* bltz $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BLTZ}, /* bltz $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BGEZ, /* bgez $rt, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BGEZ, /* bgez $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE}, + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - INSN_BEQS38 << 16 /* beq $rt, $R5, label */ - }, /* BR_RANGE_S256 */ - { - INSN_BEQ_R5 /* beq $rt, $R5, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BNE_R5, /* bne $rt, $R5, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S64K */ - { - INSN_BNE_R5, /* bne $rt, $R5, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BNE_R5, /* bne $rt, $R5, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ + .opcode = "beq", + .br_range = BR_RANGE_S16K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BEQ}, /* beq $rt, $ra, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BEQ}, /* beq $rt, $ra, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BNE, /* bne $rt, $ra, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S64K] = 8, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BNE, /* bne $rt, $ra, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BNE, /* bne $rt, $ra, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 8, 0x7, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {2, 4, 8, 8, 16}, /* relax_code_size */ - {2, 4, 4, 4, 4}, /* relax_branch_isize */ + .opcode = "bne", + .br_range = BR_RANGE_S16K, + .cond_field = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BNE}, /* bne $rt, $ra, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BNE}, /* bne $rt, $ra, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BEQ, /* beq $rt, $ra, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S64K] = 8, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BEQ, /* beq $rt, $ra, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BEQ, /* beq $rt, $ra, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 15, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, - {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, - {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, - {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, - {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "beqc", /* opcode */ - BR_RANGE_S256, /* br_range */ + .opcode = "beqz38", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 8, 0x7, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BEQZ38 << 16}, /* beqz $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 8, 0x7, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S256] = 2, + .relax_branch_isize[BR_RANGE_S256] = 2, + .relax_fixup[BR_RANGE_S256] = { + {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BEQZ}, /* beqz $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BEQZ}, /* beqz $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BNEZ, /* bnez $rt, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BNEZ, /* bnez $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ta */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - {0, 8, 0x7FF, TRUE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ + .opcode = "bnez38", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 8, 0x7, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BNEZ38 << 16}, /* bnez $rt, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 8, 0x7, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S256] = 2, + .relax_branch_isize[BR_RANGE_S256] = 2, + .relax_fixup[BR_RANGE_S256] = { + {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BNEZ}, /* bnez $rt, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BNEZ}, /* bnez $rt, label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BEQZ, /* beqz $rt, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BEQZ, /* beqz $rt, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ a */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - INSN_BEQC /* beqc $rt, imm11s, label */ - }, /* BR_RANGE_S256 */ - { - INSN_MOVI_TA, /* movi $ta, imm11s */ - INSN_BEQ_TA /* beq $rt, $ta, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BNEC, /* bnec $rt, imm11s, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S64K */ - { - INSN_BNEC, /* bnec $rt, imm11s, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BNEC, /* bnec $rt, imm11s, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ + .opcode = "beqzs8", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BEQZS8 << 16}, /* beqz $r15, label */ + .relax_code_size[BR_RANGE_S256] = 2, + .relax_branch_isize[BR_RANGE_S256] = 2, + .relax_fixup[BR_RANGE_S256] = { + {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BEQZ_TA}, /* beqz $r15, label */ + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BEQZ_TA}, /* beqz $r15, label */ + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BNEZ_TA, /* bnez $r15, $1 */ + INSN_J}, /* j label */ + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BNEZ_TA, /* bnez $r15, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ a */ + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 8, 0x7FF, TRUE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 0, 0xFFFFF, FALSE}, - {4, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 8, 0x7FF, FALSE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 8, 0x7FF, FALSE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 8, 0x7FF, FALSE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 8, 8, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ + .opcode = "bnezs8", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BNEZS8 << 16}, /* bnez $r15, label */ + .relax_code_size[BR_RANGE_S256] = 2, + .relax_branch_isize[BR_RANGE_S256] = 2, + .relax_fixup[BR_RANGE_S256] = { + {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BNEZ_TA}, /* bnez $r15, label */ + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BNEZ_TA}, /* bnez $r15, label */ + .relax_code_size[BR_RANGE_S64K] = 4, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BEQZ_TA, /* beqz $r15, $1 */ + INSN_J}, /* j label */ + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BEQZ_TA, /* beqz $r15, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ a */ + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP7}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {8, 4, 0, BFD_RELOC_NDS32_LO12S0_ORI}, - {12, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - }, - { - "bnec", /* opcode */ - BR_RANGE_S256, /* br_range */ + .opcode = "bnes38", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 8, 0x7, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BNES38 << 16}, /* bne $rt, $r5, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 8, 0x7, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S256] = 2, + .relax_branch_isize[BR_RANGE_S256] = 2, + .relax_fixup[BR_RANGE_S256] = { + {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BNE_R5}, /* bne $rt, $r5, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BEQ_R5, /* beq $rt, $r5, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S64K] = 8, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BEQ_R5, /* beq $rt, $r5, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BEQ_R5, /* beq $rt, $r5, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ a */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - {0, 8, 0x7FF, TRUE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* cond_field */ + .opcode = "beqs38", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 8, 0x7, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BEQS38 << 16}, /* beq $rt, $r5, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 8, 0x7, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S256] = 2, + .relax_branch_isize[BR_RANGE_S256] = 2, + .relax_fixup[BR_RANGE_S256] = { + {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_BEQ_R5}, /* beq $rt, $r5, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16K] = 4, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BNE_R5, /* bne $rt, $r5, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S64K] = 8, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BNE_R5, /* bne $rt, $r5, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BNE_R5, /* bne $rt, $r5, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ a */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_FIX | NDS32_HINT, BFD_RELOC_NDS32_LO12S0_ORI}, + {8, 4, NDS32_PTR |NDS32_HINT, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_ABS | NDS32_HINT, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_SYM | NDS32_HINT, BFD_RELOC_NDS32_EMPTY}, + {12, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - INSN_BNEC /* bnec $rt, imm11s, label */ - }, /* BR_RANGE_S256 */ - { - INSN_MOVI_TA, /* movi $ta, imm11s */ - INSN_BNE_TA /* bne $rt, $ta, label */ - }, /* BR_RANGE_S16K */ - { - INSN_BEQC, /* beqc $rt, imm11s, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S64K */ - { - INSN_BEQC, /* beqc $rt, imm11s, $1 */ - INSN_J /* j label */ - }, /* BR_RANGE_S16M */ - { - INSN_BEQC, /* beqc $rt, imm11s, $1 */ - INSN_SETHI_TA, /* sethi $ta, label */ - INSN_ORI_TA, /* ori $ta, $ta, label */ - INSN_JR_TA /* jr $ta */ - } /* BR_RANGE_U4G */ - }, /* relax_code_seq */ + .opcode = "beqc", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 8, 0x7FF, TRUE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BEQC}, /* beqc $rt, imm11s, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 8, 0x7FF, FALSE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_MOVI_TA, /* movi $ta, imm11s */ + INSN_BEQ_TA}, /* beq $rt, $ta, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 0, 0xFFFFF, FALSE}, + {4, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16K] = 8, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP7}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BNEC, /* bnec $rt, imm11s, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 8, 0x7FF, FALSE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S64K] = 8, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BNEC, /* bnec $rt, imm11s, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 8, 0x7FF, FALSE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BNEC, /* bnec $rt, imm11s, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ a */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 8, 0x7FF, FALSE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {8, 4, 0, BFD_RELOC_NDS32_LO12S0_ORI}, + {12, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 8, 0x7FF, TRUE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S256 */ - { - {0, 0, 0xFFFFF, FALSE}, - {4, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16K */ - { - {0, 8, 0x7FF, FALSE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S64K */ - { - {0, 8, 0x7FF, FALSE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - }, /* BR_RANGE_S16M */ - { - {0, 8, 0x7FF, FALSE}, - {0, 20, 0x1F, FALSE}, - {0, 0, 0, FALSE} - } /* BR_RANGE_U4G */ - }, /* relax_code_condition */ - {4, 8, 8, 8, 16}, /* relax_code_size */ - {4, 4, 4, 4, 4}, /* relax_branch_isize */ + .opcode = "bnec", + .br_range = BR_RANGE_S256, + .cond_field = { + {0, 8, 0x7FF, TRUE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_seq[BR_RANGE_S256] = { + INSN_BNEC}, /* bnec $rt, imm11s, label */ + .relax_code_condition[BR_RANGE_S256] = { + {0, 8, 0x7FF, FALSE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S256] = 4, + .relax_branch_isize[BR_RANGE_S256] = 4, + .relax_fixup[BR_RANGE_S256] = { + {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16K] = { + INSN_MOVI_TA, /* movi $ta, imm11s */ + INSN_BNE_TA}, /* bne $rt, $ta, label */ + .relax_code_condition[BR_RANGE_S16K] = { + {0, 0, 0xFFFFF, FALSE}, + {4, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16K] = 8, + .relax_branch_isize[BR_RANGE_S16K] = 4, + .relax_fixup[BR_RANGE_S16K] = { + {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, + {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP7}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S64K] = { + INSN_BEQC, /* beqc $rt, imm11s, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S64K] = { + {0, 8, 0x7FF, FALSE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S64K] = 8, + .relax_branch_isize[BR_RANGE_S64K] = 4, + .relax_fixup[BR_RANGE_S64K] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_S16M] = { + INSN_BEQC, /* beqc $rt, imm11s, $1 */ + INSN_J}, /* j label */ + .relax_code_condition[BR_RANGE_S16M] = { + {0, 8, 0x7FF, FALSE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_S16M] = 8, + .relax_branch_isize[BR_RANGE_S16M] = 4, + .relax_fixup[BR_RANGE_S16M] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, + {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, + {0, 0, 0, 0} + }, + + .relax_code_seq[BR_RANGE_U4G] = { + INSN_BEQC, /* beqc $rt, imm11s, $1 */ + INSN_SETHI_TA, /* sethi $ta, label */ + INSN_ORI_TA, /* ori $ta, $ta, label */ + INSN_JR_TA}, /* jr $ a */ + .relax_code_condition[BR_RANGE_U4G] = { + {0, 8, 0x7FF, FALSE}, + {0, 20, 0x1F, FALSE}, + {0, 0, 0, FALSE} + }, + .relax_code_size[BR_RANGE_U4G] = 16, + .relax_branch_isize[BR_RANGE_U4G] = 4, + .relax_fixup[BR_RANGE_U4G] = { + {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, + {4, 4, 0, BFD_RELOC_NDS32_HI20}, + {8, 4, 0, BFD_RELOC_NDS32_LO12S0_ORI}, + {12, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + }, + }, { - { - {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S256 */ - { - {0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16}, - {0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP7}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S64K */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, - {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL}, - {0, 0, 0, 0} - }, /* BR_RANGE_S16M */ - { - {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL}, - {4, 4, 0, BFD_RELOC_NDS32_HI20}, - {8, 4, 0, BFD_RELOC_NDS32_LO12S0_ORI}, - {12, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, - {0, 0, 0, 0} - } /* BR_RANGE_U4G */ - } /* relax_fixup */ - } + .opcode = NULL, + }, }; + /* GAS definitions for command-line options. */ enum options @@ -1901,9 +1932,9 @@ size_t md_longopts_size = sizeof (md_longopts); struct nds32_parse_option_table { - const char *name; /* Option string. */ - const char *help; /* Help description. */ - int (*func) (const char *arg); /* How to parse it. */ + const char *name; /* Option string. */ + const char *help; /* Help description. */ + int (*func) (const char *arg); /* How to parse it. */ }; @@ -1920,7 +1951,7 @@ static int nds32_fpu_dp_ext = -1; static int nds32_freg = -1; static int nds32_abi = -1; -/* Record ELF flags */ +/* Record ELF flags. */ static int nds32_elf_flags = 0; static int nds32_fpu_com = 0; @@ -1929,34 +1960,49 @@ static int nds32_parse_baseline (const char *str); static int nds32_parse_freg (const char *str); static int nds32_parse_abi (const char *str); +static void add_mapping_symbol (enum mstate state, + unsigned int padding_byte, unsigned int align); + static struct nds32_parse_option_table parse_opts [] = { + {"ace=", N_("\t Support user defined instruction extension"), + nds32_parse_udi}, + {"cop0=", N_("\t Support coprocessor 0 extension"), + nds32_parse_cop0}, + {"cop1=", N_("\t Support coprocessor 1 extension"), + nds32_parse_cop1}, + {"cop2=", N_("\t Support coprocessor 2 extension"), + nds32_parse_cop2}, + {"cop3=", N_("\t Support coprocessor 3 extension"), + nds32_parse_cop3}, {"arch=", N_("\t Assemble for architecture \n\ could be\n\ - v3, v3j, v3m, v3f, v3s, "\ + v3, v3j, v3m, v3m+ v3f, v3s, "\ "v2, v2j, v2f, v2s"), nds32_parse_arch}, {"baseline=", N_("\t Assemble for baseline \n\ could be v2, v3, v3m"), nds32_parse_baseline}, {"fpu-freg=", N_("\t Specify a FPU configuration\n\ \n\ - 0: 8 SP / 4 DP registers\n\ - 1: 16 SP / 8 DP registers\n\ - 2: 32 SP / 16 DP registers\n\ - 3: 32 SP / 32 DP registers"), nds32_parse_freg}, + 0/4: 8 SP / 4 DP registers\n\ + 1/5: 16 SP / 8 DP registers\n\ + 2/6: 32 SP / 16 DP registers\n\ + 3/7: 32 SP / 32 DP registers"), nds32_parse_freg}, {"abi=", N_("\t Specify a abi version\n\ - could be v1, v2, v2fp, v2fpp"), nds32_parse_abi}, + could be v1, v2, v2fp, v2fp+"), nds32_parse_abi}, {NULL, NULL, NULL} }; static int nds32_mac = 1; static int nds32_div = 1; static int nds32_16bit_ext = 1; -static int nds32_dx_regs = 1; -static int nds32_perf_ext = 1; -static int nds32_perf_ext2 = 1; -static int nds32_string_ext = 1; -static int nds32_audio_ext = 1; +static int nds32_dx_regs = NDS32_DEFAULT_DX_REGS; +static int nds32_perf_ext = NDS32_DEFAULT_PERF_EXT; +static int nds32_perf_ext2 = NDS32_DEFAULT_PERF_EXT2; +static int nds32_string_ext = NDS32_DEFAULT_STRING_EXT; +static int nds32_audio_ext = NDS32_DEFAULT_AUDIO_EXT; +static int nds32_dsp_ext = NDS32_DEFAULT_DSP_EXT; +static int nds32_zol_ext = NDS32_DEFAULT_ZOL_EXT; static int nds32_fpu_fma = 0; static int nds32_pic = 0; static int nds32_relax_fp_as_gp = 1; @@ -1965,7 +2011,7 @@ static int nds32_relax_all = 1; struct nds32_set_option_table { const char *name; /* Option string. */ - const char *help; /* Help description. */ + const char *help; /* Help description. */ int *var; /* Variable to be set. */ int value; /* Value to set. */ }; @@ -1987,6 +2033,8 @@ static struct nds32_set_option_table toggle_opts [] = {"fpu-sp-ext", N_("FPU SP extension"), &nds32_fpu_sp_ext, 1}, {"fpu-dp-ext", N_("FPU DP extension"), &nds32_fpu_dp_ext, 1}, {"fpu-fma", N_("FPU fused-multiply-add instructions"), &nds32_fpu_fma, 1}, + {"dsp-ext", N_("DSP extension"), &nds32_dsp_ext, 1}, + {"zol-ext", N_("hardware loop extension"), &nds32_zol_ext, 1}, {NULL, NULL, NULL, 0} }; @@ -2000,7 +2048,7 @@ nds32_asm_parse_operand (struct nds32_asm_desc *pdesc, char **pstr, int64_t *value); -struct nds32_asm_desc asm_desc; +static struct nds32_asm_desc asm_desc; /* md_after_parse_args () @@ -2086,11 +2134,9 @@ nds32_start_line_hook (void) { } -/* - * Pseudo opcodes - */ +/* Pseudo opcodes. */ -typedef void (*nds32_pseudo_opcode_func) (int argc, char *argv[], unsigned int pv); +typedef void (*nds32_pseudo_opcode_func) (int argc, char *argv[], int pv); struct nds32_pseudo_opcode { const char *opcode; @@ -2183,13 +2229,12 @@ static void do_pseudo_li_internal (const char *rt, int imm32s); static void do_pseudo_move_reg_internal (char *dst, char *src); static void -do_pseudo_b (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_b (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { char *arg_label = argv[0]; relaxing = TRUE; /* b label */ - if (nds32_pic && strstr (arg_label, "@PLT")) + if (nds32_pic) { md_assemblef ("sethi $ta,hi20(%s)", arg_label); md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label); @@ -2204,18 +2249,16 @@ do_pseudo_b (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_bal (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_bal (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { char *arg_label = argv[0]; relaxing = TRUE; /* bal|call label */ - if (nds32_pic - && (strstr (arg_label, "@GOT") || strstr (arg_label, "@PLT"))) + if (nds32_pic) { md_assemblef ("sethi $ta,hi20(%s)", arg_label); md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label); - md_assemble ((char *) "add $ta,$ta,$gp"); + md_assemble ((char *) "add $ta,$ta,$gp"); md_assemble ((char *) "jral $ta"); } else @@ -2226,8 +2269,7 @@ do_pseudo_bal (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_bge (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_bge (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* rt5, ra5, label */ md_assemblef ("slt $ta,%s,%s", argv[0], argv[1]); @@ -2235,8 +2277,7 @@ do_pseudo_bge (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_bges (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_bges (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* rt5, ra5, label */ md_assemblef ("slts $ta,%s,%s", argv[0], argv[1]); @@ -2244,8 +2285,7 @@ do_pseudo_bges (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_bgt (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_bgt (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* bgt rt5, ra5, label */ md_assemblef ("slt $ta,%s,%s", argv[1], argv[0]); @@ -2253,8 +2293,7 @@ do_pseudo_bgt (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_bgts (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_bgts (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* bgt rt5, ra5, label */ md_assemblef ("slts $ta,%s,%s", argv[1], argv[0]); @@ -2262,8 +2301,7 @@ do_pseudo_bgts (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_ble (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_ble (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* bgt rt5, ra5, label */ md_assemblef ("slt $ta,%s,%s", argv[1], argv[0]); @@ -2271,8 +2309,7 @@ do_pseudo_ble (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_bles (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_bles (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* bgt rt5, ra5, label */ md_assemblef ("slts $ta,%s,%s", argv[1], argv[0]); @@ -2280,8 +2317,7 @@ do_pseudo_bles (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_blt (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_blt (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* rt5, ra5, label */ md_assemblef ("slt $ta,%s,%s", argv[0], argv[1]); @@ -2289,8 +2325,7 @@ do_pseudo_blt (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_blts (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_blts (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* rt5, ra5, label */ md_assemblef ("slts $ta,%s,%s", argv[0], argv[1]); @@ -2298,15 +2333,13 @@ do_pseudo_blts (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_br (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_br (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { md_assemblef ("jr %s", argv[0]); } static void -do_pseudo_bral (int argc, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_bral (int argc, char *argv[], int pv ATTRIBUTE_UNUSED) { if (argc == 1) md_assemblef ("jral $lp,%s", argv[0]); @@ -2329,19 +2362,24 @@ do_pseudo_la_internal (const char *arg_reg, char *arg_label, relaxing = TRUE; /* rt, label */ - if (!nds32_pic && !strstr(arg_label, "@")) + if (!nds32_pic && !strstr (arg_label, "@")) + { + md_assemblef ("sethi %s,hi20(%s)", arg_reg, arg_label); + md_assemblef ("ori %s,%s,lo12(%s)", arg_reg, arg_reg, arg_label); + } + else if (strstr (arg_label, "@ICT")) { md_assemblef ("sethi %s,hi20(%s)", arg_reg, arg_label); md_assemblef ("ori %s,%s,lo12(%s)", arg_reg, arg_reg, arg_label); } else if (strstr (arg_label, "@TPOFF")) { - /* la $rt, sym@TPOFF */ + /* la $rt, sym@TPOFF */ md_assemblef ("sethi $ta,hi20(%s)", arg_label); md_assemblef ("ori $ta,$ta,lo12(%s)", arg_label); md_assemblef ("add %s,$ta,%s", arg_reg, TLS_REG); } - else if (strstr(arg_label, "@GOTTPOFF")) + else if (strstr (arg_label, "@GOTTPOFF")) { /* la $rt, sym@GOTTPOFF*/ md_assemblef ("sethi $ta,hi20(%s)", arg_label); @@ -2381,8 +2419,7 @@ do_pseudo_la_internal (const char *arg_reg, char *arg_label, } static void -do_pseudo_la (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_la (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { do_pseudo_la_internal (argv[0], argv[1], argv[argc]); } @@ -2404,8 +2441,7 @@ do_pseudo_li_internal (const char *rt, int imm32s) } static void -do_pseudo_li (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_li (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* Validate argv[1] for constant expression. */ expressionS exp; @@ -2421,8 +2457,7 @@ do_pseudo_li (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_ls_bhw (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv) +do_pseudo_ls_bhw (int argc ATTRIBUTE_UNUSED, char *argv[], int pv) { char ls = 'r'; char size = 'x'; @@ -2451,14 +2486,14 @@ do_pseudo_ls_bhw (int argc ATTRIBUTE_UNUSED, char *argv[], relaxing = TRUE; if (strstr (argv[1], "@TPOFF")) { - /* ls.w $rt, sym@TPOFF */ + /* ls.w $rt, sym@TPOFF */ md_assemblef ("sethi $ta,hi20(%s)", argv[1]); md_assemblef ("ori $ta,$ta,lo12(%s)", argv[1]); md_assemblef ("%c%c%s %s,[$ta+%s]", ls, size, sign, argv[0], TLS_REG); } else if (strstr (argv[1], "@GOTTPOFF")) { - /* ls.w $rt, sym@GOTTPOFF */ + /* ls.w $rt, sym@GOTTPOFF */ md_assemblef ("sethi $ta,hi20(%s)", argv[1]); md_assemblef ("lwi $ta,[$ta+lo12(%s)]", argv[1]); md_assemblef ("%c%c%s %s,[$ta+%s]", ls, size, sign, argv[0], TLS_REG); @@ -2509,8 +2544,7 @@ do_pseudo_ls_bhw (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_ls_bhwp (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv) +do_pseudo_ls_bhwp (int argc ATTRIBUTE_UNUSED, char *argv[], int pv) { char *arg_rt = argv[0]; char *arg_label = argv[1]; @@ -2537,8 +2571,7 @@ do_pseudo_ls_bhwp (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_ls_bhwpc (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv) +do_pseudo_ls_bhwpc (int argc ATTRIBUTE_UNUSED, char *argv[], int pv) { char *arg_rt = argv[0]; char *arg_inc = argv[1]; @@ -2563,8 +2596,7 @@ do_pseudo_ls_bhwpc (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_ls_bhwi (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv) +do_pseudo_ls_bhwi (int argc ATTRIBUTE_UNUSED, char *argv[], int pv) { char ls = 'r'; char size = 'x'; @@ -2597,8 +2629,7 @@ do_pseudo_move_reg_internal (char *dst, char *src) } static void -do_pseudo_move (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_move (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { expressionS exp; @@ -2617,23 +2648,20 @@ do_pseudo_move (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_neg (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_neg (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* Instead of "subri". */ md_assemblef ("subri %s,%s,0", argv[0], argv[1]); } static void -do_pseudo_not (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_not (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { md_assemblef ("nor %s,%s,%s", argv[0], argv[1], argv[1]); } static void -do_pseudo_pushpopm (int argc, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_pushpopm (int argc, char *argv[], int pv ATTRIBUTE_UNUSED) { /* posh/pop $ra, $rb */ /* SMW.{b | a}{i | d}{m?} Rb, [Ra], Re, Enable4 */ @@ -2683,11 +2711,11 @@ do_pseudo_pushpopm (int argc, char *argv[], /* Reduce register. */ if (nds32_gpr16 && re > 10 && !(rb == 31 && re == 31)) { - if (re >= 15 && strstr(opc, "smw") != NULL) + if (re >= 15 && strstr (opc, "smw") != NULL) md_assemblef ("%s $r15,[$sp],$r15,%d", opc, en4); if (rb <= 10) md_assemblef ("%s $r%d,[$sp],$r10, 0x0", opc, rb); - if (re >= 15 && strstr(opc, "lmw") != NULL) + if (re >= 15 && strstr (opc, "lmw") != NULL) md_assemblef ("%s $r15,[$sp],$r15,%d", opc, en4); } else @@ -2695,10 +2723,9 @@ do_pseudo_pushpopm (int argc, char *argv[], } static void -do_pseudo_pushpop (int argc, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_pushpop (int argc, char *argv[], int pv ATTRIBUTE_UNUSED) { - /* push/pop $ra5, $label=$sp */ + /* push/pop $ra5, $label=$sp */ char *argvm[3]; if (argc == 2) @@ -2712,15 +2739,13 @@ do_pseudo_pushpop (int argc, char *argv[], } static void -do_pseudo_v3push (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_v3push (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { md_assemblef ("push25 %s,%s", argv[0], argv[1]); } static void -do_pseudo_v3pop (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_v3pop (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { md_assemblef ("pop25 %s,%s", argv[0], argv[1]); } @@ -2729,11 +2754,10 @@ do_pseudo_v3pop (int argc ATTRIBUTE_UNUSED, char *argv[], pv != 0, parsing "pop.s" pseudo instruction operands. */ static void -do_pseudo_pushpop_stack (int argc, char *argv[], - unsigned int pv) +do_pseudo_pushpop_stack (int argc, char *argv[], int pv) { - /* push.s Rb,Re,{$fp $gp $lp $sp} ==> smw.adm Rb,[$sp],Re,Eable4 */ - /* pop.s Rb,Re,{$fp $gp $lp $sp} ==> lmw.bim Rb,[$sp],Re,Eable4 */ + /* push.s Rb,Re,{$fp $gp $lp $sp} ==> smw.adm Rb,[$sp],Re,Eable4 */ + /* pop.s Rb,Re,{$fp $gp $lp $sp} ==> lmw.bim Rb,[$sp],Re,Eable4 */ int rb, re; int en4; @@ -2794,8 +2818,7 @@ do_pseudo_pushpop_stack (int argc, char *argv[], } static void -do_pseudo_push_bhwd (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_push_bhwd (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { char size = 'x'; /* If users omit push location, use $sp as default value. */ @@ -2818,7 +2841,7 @@ do_pseudo_push_bhwd (int argc ATTRIBUTE_UNUSED, char *argv[], md_assemblef ("l.%c $ta,%s", size, argv[0]); md_assemblef ("smw.adm $ta,[%s],$ta", location); - if ((pv & 0x3) == 0x3) /* double-word */ + if ((pv & 0x3) == 0x3) /* double-word */ { md_assemblef ("l.w $ta,%s+4", argv[0]); md_assemblef ("smw.adm $ta,[%s],$ta", location); @@ -2826,8 +2849,7 @@ do_pseudo_push_bhwd (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_pop_bhwd (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_pop_bhwd (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { char size = 'x'; /* If users omit pop location, use $sp as default value. */ @@ -2847,7 +2869,7 @@ do_pseudo_pop_bhwd (int argc ATTRIBUTE_UNUSED, char *argv[], location[7] = '\0'; } - if ((pv & 0x3) == 0x3) /* double-word */ + if ((pv & 0x3) == 0x3) /* double-word */ { md_assemblef ("lmw.bim %s,[%s],%s", argv[1], location, argv[1]); md_assemblef ("s.w %s,%s+4", argv[1], argv[0]); @@ -2858,8 +2880,7 @@ do_pseudo_pop_bhwd (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_pusha (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_pusha (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* If users omit push location, use $sp as default value. */ char location[8] = "$sp"; /* 8 is enough for register name. */ @@ -2875,8 +2896,7 @@ do_pseudo_pusha (int argc ATTRIBUTE_UNUSED, char *argv[], } static void -do_pseudo_pushi (int argc ATTRIBUTE_UNUSED, char *argv[], - unsigned int pv ATTRIBUTE_UNUSED) +do_pseudo_pushi (int argc ATTRIBUTE_UNUSED, char *argv[], int pv ATTRIBUTE_UNUSED) { /* If users omit push location, use $sp as default value. */ char location[8] = "$sp"; /* 8 is enough for register name. */ @@ -2891,8 +2911,7 @@ do_pseudo_pushi (int argc ATTRIBUTE_UNUSED, char *argv[], md_assemblef ("smw.adm $ta,[%s],$ta", location); } -struct nds32_pseudo_opcode nds32_pseudo_opcode_table[] = -{ +static struct nds32_pseudo_opcode nds32_pseudo_opcode_table[] = { {"b", 1, do_pseudo_b, 0, 0}, {"bal", 1, do_pseudo_bal, 0, 0}, @@ -2967,8 +2986,8 @@ struct nds32_pseudo_opcode nds32_pseudo_opcode_table[] = {"v3pop", 2, do_pseudo_v3pop, 0, 0}, /* Support pseudo instructions of pushing/poping registers into/from stack - push.s Rb, Re, { $fp $gp $lp $sp } ==> smw.adm Rb,[$sp],Re,Enable4 - pop.s Rb, Re, { $fp $gp $lp $sp } ==> lmw.bim Rb,[$sp],Re,Enable4 */ + push.s Rb, Re, { $fp $gp $lp $sp } ==> smw.adm Rb,[$sp],Re,Enable4 + pop.s Rb, Re, { $fp $gp $lp $sp } ==> lmw.bim Rb,[$sp],Re,Enable4 */ { "push.s", 3, do_pseudo_pushpop_stack, 0, 0 }, { "pop.s", 3, do_pseudo_pushpop_stack, 1, 0 }, { "push.b", 2, do_pseudo_push_bhwd, 0, 0 }, @@ -3009,18 +3028,16 @@ static struct nds32_pseudo_opcode * nds32_lookup_pseudo_opcode (const char *str) { int i = 0; - /* Assume pseudo-opcode are less than 16-char in length. */ - char op[16] = {0}; + /* *op = first word of current source line (*str) */ + int maxlen = strlen (str); + char *op = alloca (maxlen + 1); - for (i = 0; i < (int)ARRAY_SIZE (op); i++) + for (i = 0; i < maxlen; i++) { if (ISSPACE (op[i] = str[i])) break; } - if (i >= (int)ARRAY_SIZE (op)) - return NULL; - op[i] = '\0'; return hash_find (nds32_pseudo_opcode_hash, op); @@ -3081,6 +3098,7 @@ nds32_parse_arch (const char *str) } archs[] = { {"v3m", ISA_V3M, 1, 0, 0, E_NDS32_FPU_REG_32SP_16DP, E_NDS_ABI_AABI}, + {"v3m+",ISA_V3M, 1, 0, 0, E_NDS32_FPU_REG_32SP_16DP, E_NDS_ABI_AABI}, {"v3j", ISA_V3, 1, 0, 0, E_NDS32_FPU_REG_32SP_16DP, E_NDS_ABI_AABI}, {"v3s", ISA_V3, 0, 1, 0, E_NDS32_FPU_REG_32SP_16DP, E_NDS_ABI_V2FP_PLUS}, {"v3f", ISA_V3, 0, 1, 1, E_NDS32_FPU_REG_32SP_16DP, E_NDS_ABI_V2FP_PLUS}, @@ -3119,11 +3137,11 @@ nds32_parse_arch (const char *str) static int nds32_parse_baseline (const char *str) { - if (strcmp (str, "v3") == 0) + if (strcasecmp (str, "v3") == 0) nds32_baseline = ISA_V3; - else if (strcmp (str, "v3m") == 0) + else if (strcasecmp (str, "v3m") == 0) nds32_baseline = ISA_V3M; - else if (strcmp (str, "v2") == 0) + else if (strcasecmp (str, "v2") == 0) nds32_baseline = ISA_V2; else { @@ -3140,13 +3158,13 @@ nds32_parse_baseline (const char *str) static int nds32_parse_freg (const char *str) { - if (strcmp (str, "2") == 0) + if (strcmp (str, "2") == 0 || strcmp (str, "6") == 0) nds32_freg = E_NDS32_FPU_REG_32SP_16DP; - else if (strcmp (str, "3") == 0) + else if (strcmp (str, "3") == 0 || strcmp (str, "7") == 0) nds32_freg = E_NDS32_FPU_REG_32SP_32DP; - else if (strcmp (str, "1") == 0) + else if (strcmp (str, "1") == 0 || strcmp (str, "5") == 0) nds32_freg = E_NDS32_FPU_REG_16SP_8DP; - else if (strcmp (str, "0") == 0) + else if (strcmp (str, "0") == 0 || strcmp (str, "4") == 0) nds32_freg = E_NDS32_FPU_REG_8SP_4DP; else { @@ -3170,13 +3188,19 @@ nds32_parse_abi (const char *str) nds32_abi = E_NDS_ABI_V2FP; else if (strcmp (str, "v1") == 0) nds32_abi = E_NDS_ABI_V1; - else if (strcmp (str,"v2fpp") == 0) + else if (strcmp (str,"v2fpp") == 0 || strcmp (str,"v2fp+") == 0) nds32_abi = E_NDS_ABI_V2FP_PLUS; else { - /* Logic here rejects the input abi version. */ - as_bad (_("unknown ABI version`%s'\n"), str); - return 0; + /* bug-10880, decided to accept any other versions but drop them. */ + if (TRUE) + return 1; + else + { + /* Logic here rejects the input abi version. */ + as_bad (_("unknown ABI version`%s'\n"), str); + return 0; + } } return 1; @@ -3198,6 +3222,10 @@ nds32_all_ext (void) nds32_fpu_fma = 1; nds32_fpu_sp_ext = 1; nds32_fpu_dp_ext = 1; + nds32_dsp_ext = 1; + nds32_zol_ext = 1; + /* Turn off reduced register. */ + nds32_gpr16 = 0; return 1; } @@ -3295,7 +3323,7 @@ nds32_parse_option (int c, const char *arg) return 1; } -/* tc_check_label */ +/* tc_check_label */ void nds32_check_label (symbolS *label ATTRIBUTE_UNUSED) @@ -3342,8 +3370,7 @@ typedef struct nds32_seg_entryT flagword flags; } nds32_seg_entry; -nds32_seg_entry nds32_seg_table[] = -{ +static nds32_seg_entry nds32_seg_table[] = { {NULL, ".sdata_f", SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA | SEC_HAS_CONTENTS | SEC_SMALL_DATA}, {NULL, ".sdata_b", SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_DATA @@ -3409,24 +3436,40 @@ nds32_seg (int i) } /* Set if label adjustment is needed. I should not adjust .xbyte in dwarf. */ -static symbolS *nds32_last_label; /* Last label for alignment. */ +static symbolS *nds32_last_label; /* Last label for aligment. */ + +static void +add_mapping_symbol_for_align (int shift, valueT addr, int is_data_align) +{ + if ((shift > 1) && (addr & 1)) + { + int n = (1 << shift) - 1; + if (!is_data_align) + add_mapping_symbol (MAP_CODE, 1, 0); + else if ((int) (addr & n) != n) + add_mapping_symbol (MAP_CODE, 1, 0); + } + else if ((shift > 1) && ((int) (addr & 1) == 0)) + add_mapping_symbol (MAP_CODE, 0, 0); -/* This code is referred from D30V for adjust label to be with pending - alignment. For example, +} + +/* This code is referred from D30V for adjust label to be with pedning + aligment. For example, LBYTE: .byte 0x12 LHALF: .half 0x12 LWORD: .word 0x12 - Without this, the above label will not attach to incoming data. */ + Without this, the above label will not attatch to incoming data. */ static void nds32_adjust_label (int n) { - /* FIXME: I think adjust label and alignment is - the programmer's obligation. Sadly, VLSI team doesn't + /* FIXME: I think adjust lable and alignment is + the programmer's obligation. Saddly, VLSI team doesn't properly use .align for their test cases. So I re-implement cons_align and auto adjust labels, again. - I think d30v's implementation is simple and good enough. */ + I think d30v's implmentation is simple and good enough. */ symbolS *label = nds32_last_label; nds32_last_label = NULL; @@ -3441,10 +3484,14 @@ nds32_adjust_label (int n) /* Only frag by alignment when needed. Otherwise, it will fail to optimize labels on 4-byte boundary. (bug8454) See md_convert_frag () and RELAX_SET_RELAXABLE (frag) for details. */ + if (frag_now_fix () & ((1 << n) -1 )) { if (subseg_text_p (now_seg)) - frag_align_code (n, 0); + { + add_mapping_symbol_for_align (n, frag_now_fix (), 1); + frag_align_code (n, 0); + } else frag_align (n, 0, 0); @@ -3474,7 +3521,7 @@ nds32_adjust_label (int n) if (symbol_get_frag (sym) == old_frag && S_GET_VALUE (sym) == old_value) { - /* Warning HERE! */ + /* Warning HERE! */ label_seen = TRUE; symbol_set_frag (sym, frag_now); S_SET_VALUE (sym, new_value); @@ -3493,7 +3540,7 @@ nds32_cons_align (int size ATTRIBUTE_UNUSED) There are two things should be done for auto-adjust-label. 1. Align data/instructions and adjust label to be attached to them. - 2. Clear auto-adjust state, so incoming data/instructions will not + 2. Clear auto-adjust state, so incommng data/instructions will not adjust the label. For example, @@ -3510,15 +3557,67 @@ nds32_cons_align (int size ATTRIBUTE_UNUSED) } static void +make_mapping_symbol (enum mstate state, valueT value, fragS * frag, unsigned int align) +{ + symbolS *symbol_p = NULL; + const char *symbol_name = NULL; + switch (state) + { + case MAP_DATA: + if (align == 0) { + symbol_name = "$d0"; + } + else if (align == 1) { + symbol_name = "$d1"; + } + else if (align == 2) + symbol_name = "$d2"; + else if (align == 3) + symbol_name = "$d3"; + else if (align == 4) + symbol_name = "$d4"; + break; + case MAP_CODE: + symbol_name = "$c"; + break; + default: + abort (); + } + + symbol_p = symbol_new (symbol_name, now_seg, value, frag); + /* local scope attribute */ + symbol_get_bfdsym (symbol_p)->flags |= BSF_NO_FLAGS | BSF_LOCAL; +} + +static void +add_mapping_symbol (enum mstate state, unsigned int padding_byte, unsigned int align) +{ + enum mstate current_mapping_state = + seg_info (now_seg)->tc_segment_info_data.mapstate; + + if (state == MAP_CODE && current_mapping_state == state) + return; + + if (!SEG_NORMAL (now_seg) || !subseg_text_p (now_seg)) + return; + + /* start adding mapping symbol */ + seg_info (now_seg)->tc_segment_info_data.mapstate = state; + make_mapping_symbol (state, (valueT) frag_now_fix () + padding_byte, + frag_now, align); +} + +static void nds32_aligned_cons (int idx) { nds32_adjust_label (idx); + add_mapping_symbol (MAP_DATA, 0, idx); /* Call default handler. */ cons (1 << idx); if (now_seg->flags & SEC_CODE && now_seg->flags & SEC_ALLOC && now_seg->flags & SEC_RELOC) { - /* Use BFD_RELOC_NDS32_DATA to avoid EX9 optimization replacing data. */ + /* Use BFD_RELOC_NDS32_DATA to avoid linker optimization replacing data. */ expressionS exp; exp.X_add_number = 0; @@ -3578,7 +3677,7 @@ nds32_relax_relocs (int relax) char *name; int i; const char *subtype_relax[] = - {"", "", "ex9", "ifc"}; + {"", "",}; name = input_line_pointer; while (*input_line_pointer && !ISSPACE (*input_line_pointer)) @@ -3595,14 +3694,6 @@ nds32_relax_relocs (int relax) case 0: case 1: enable_relax_relocs = relax & enable_relax_relocs; - enable_relax_ex9 = relax & enable_relax_ex9; - enable_relax_ifc = relax & enable_relax_ifc; - break; - case 2: - enable_relax_ex9 = relax; - break; - case 3: - enable_relax_ifc = relax; break; default: break; @@ -3652,51 +3743,36 @@ nds32_omit_fp_begin (int mode) } } -/* Insert relocations to mark the begin and end of ex9 region, - for further relaxation use. - bit[i] for $ri */ - static void -nds32_no_ex9_begin (int mode) +nds32_loop_begin (int mode) { + /* Insert loop region relocation here. */ expressionS exp; exp.X_op = O_symbol; exp.X_add_symbol = abs_section_sym; if (mode == 1) { - exp.X_add_number = R_NDS32_RELAX_REGION_NO_EX9_FLAG; + exp.X_add_number = R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG; fix_new_exp (frag_now, frag_now_fix (), 0, &exp, 0, BFD_RELOC_NDS32_RELAX_REGION_BEGIN); } else { - exp.X_add_number = R_NDS32_RELAX_REGION_NO_EX9_FLAG; + exp.X_add_number = R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG; fix_new_exp (frag_now, frag_now_fix (), 0, &exp, 0, BFD_RELOC_NDS32_RELAX_REGION_END); } } +/* Record if in the inline assembly code segment. */ static void -nds32_loop_begin (int mode) +nds32_inline_asm (int mode) { - /* Insert loop region relocation here. */ - expressionS exp; - - exp.X_op = O_symbol; - exp.X_add_symbol = abs_section_sym; - if (mode == 1) - { - exp.X_add_number = R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG; - fix_new_exp (frag_now, frag_now_fix (), 0, &exp, 0, - BFD_RELOC_NDS32_RELAX_REGION_BEGIN); - } + if (mode) + inline_asm = TRUE; else - { - exp.X_add_number = R_NDS32_RELAX_REGION_INNERMOST_LOOP_FLAG; - fix_new_exp (frag_now, frag_now_fix (), 0, &exp, 0, - BFD_RELOC_NDS32_RELAX_REGION_END); - } + inline_asm = FALSE; } struct nds32_relocs_group @@ -3706,16 +3782,49 @@ struct nds32_relocs_group }; static struct nds32_relocs_group *nds32_relax_hint_current = NULL; +/* Used to reorder the id for ".relax_hint id". */ +static int relax_hint_bias = 0; +/* Record current relax hint id. */ +static int relax_hint_id_current = -1; +int reset_bias = 0; +/* If ".relax_hint begin" is triggered? */ +int relax_hint_begin = 0; + +/* Record the reordered relax hint id. */ + +struct relax_hint_id +{ + int old_id; + int new_id; + struct relax_hint_id *next; +}; + +/* FIXME: Need to find somewhere to free the list. */ +struct relax_hint_id *record_id_head = NULL; + +/* Is the buffer large enough? */ +#define MAX_BUFFER 12 + +static char *nds_itoa (int n); + +static char * +nds_itoa (int n) +{ + char *buf = xmalloc (MAX_BUFFER * sizeof (char)); + snprintf (buf, MAX_BUFFER, "%d", n); + return buf; +} /* Insert a relax hint. */ static void nds32_relax_hint (int mode ATTRIBUTE_UNUSED) { - char *name; + char *name = NULL; char saved_char; struct nds32_relocs_pattern *relocs = NULL; struct nds32_relocs_group *group, *new; + struct relax_hint_id *record_id; name = input_line_pointer; while (*input_line_pointer && !ISSPACE (*input_line_pointer)) @@ -3724,20 +3833,66 @@ nds32_relax_hint (int mode ATTRIBUTE_UNUSED) *input_line_pointer = 0; name = strdup (name); + if (name && strcmp (name, "begin") == 0) + { + if (relax_hint_id_current == -1) + reset_bias = 1; + relax_hint_bias++; + relax_hint_id_current++; + relax_hint_begin = 1; + } + + /* Original case ".relax_hint id". It's id may need to be reordered. */ + if (!relax_hint_begin) + { + int tmp = strtol (name, NULL, 10); + record_id = record_id_head; + while (record_id) + { + if (record_id->old_id == tmp) + { + name = nds_itoa (record_id->new_id); + goto reordered_id; + } + record_id = record_id->next; + } + if (reset_bias) + { + relax_hint_bias = relax_hint_id_current - atoi (name) + 1; + reset_bias = 0; + } + relax_hint_id_current = tmp + relax_hint_bias; + + /* Insert the element to the head of the link list. */ + struct relax_hint_id *tmp_id = malloc (sizeof (struct relax_hint_id)); + tmp_id->old_id = tmp; + tmp_id->new_id = relax_hint_id_current; + tmp_id->next = record_id_head; + record_id_head = tmp_id; + } + + if (name && strcmp (name, "end") == 0) + relax_hint_begin = 0; + name = nds_itoa (relax_hint_id_current); + +reordered_id: + /* Find relax hint entry for next instruction, and all member will be initialized at that time. */ relocs = hash_find (nds32_hint_hash, name); if (relocs == NULL) { - relocs = XNEW (struct nds32_relocs_pattern); + relocs = malloc (sizeof (struct nds32_relocs_pattern)); + memset (relocs, 0, sizeof (struct nds32_relocs_pattern)); hash_insert (nds32_hint_hash, name, relocs); } else { while (relocs->next) relocs=relocs->next; - relocs->next = XNEW (struct nds32_relocs_pattern); + relocs->next = malloc (sizeof (struct nds32_relocs_pattern)); relocs = relocs->next; + memset (relocs, 0, sizeof (struct nds32_relocs_pattern)); } relocs->next = NULL; @@ -3749,7 +3904,8 @@ nds32_relax_hint (int mode ATTRIBUTE_UNUSED) /* It has to build this list because there are maybe more than one instructions relative to the same instruction. It to connect to next instruction after md_assemble. */ - new = XNEW (struct nds32_relocs_group); + new = malloc (sizeof (struct nds32_relocs_group)); + memset (new, 0, sizeof (struct nds32_relocs_group)); new->pattern = relocs; new->next = NULL; group = nds32_relax_hint_current; @@ -3764,6 +3920,27 @@ nds32_relax_hint (int mode ATTRIBUTE_UNUSED) relaxing = TRUE; } +/* This is directive generated for compiler to estimate branch target + alignment. But assembler does not use the info currently. */ + +static void +nds32_maybe_align (int mode ATTRIBUTE_UNUSED) +{ + /* Ignore the reset of line. */ + ignore_rest_of_line (); +} + +/* The end of security. It must check if there is any branch + between begin and end. */ +static void +nds32_security_end (int mode ATTRIBUTE_UNUSED) +{ + if (crcing == FALSE) + as_bad (_("Found unexpected branches inside the " + "signature protected region.")); + +} + /* Decide the size of vector entries, only accepts 4 or 16 now. */ static void @@ -3819,7 +3996,7 @@ nds32_flag (int ignore ATTRIBUTE_UNUSED) switch (i) { case 0: - /* flag: verbatim */ + /* flag: verbatim */ verbatim = 1; break; default: @@ -3835,6 +4012,54 @@ nds32_flag (int ignore ATTRIBUTE_UNUSED) } static void +ict_model (int ignore ATTRIBUTE_UNUSED) +{ + char *name; + char saved_char; + int i; + const char *possible_flags[] = { "small", "large" }; + + /* Skip whitespaces. */ + name = input_line_pointer; + while (*input_line_pointer && !ISSPACE (*input_line_pointer)) + input_line_pointer++; + saved_char = *input_line_pointer; + *input_line_pointer = 0; + + for (i = 0; i < (int) ARRAY_SIZE (possible_flags); i++) + { + if (strcmp (name, possible_flags[i]) == 0) + { + switch (i) + { + case 0: + /* flag: verbatim */ + ict_flag = ICT_SMALL; + break; + case 1: + ict_flag = ICT_LARGE; + break; + default: + break; + } + /* Already found the flag, no need to continue next loop. */ + break; + } + } + + *input_line_pointer = saved_char; + ignore_rest_of_line (); +} + +/* Create .note.v2abi_compatible section if the object is compatible with v3f/v3s. + Do it at the md_end(). */ +static void +nds32_compatible_abi (int mode ATTRIBUTE_UNUSED) +{ + compatible_abi = TRUE; +} + +static void nds32_n12hc (int ignore ATTRIBUTE_UNUSED) { /* N1213HC core is used. */ @@ -3842,8 +4067,7 @@ nds32_n12hc (int ignore ATTRIBUTE_UNUSED) /* The target specific pseudo-ops which we support. */ -const pseudo_typeS md_pseudo_table[] = -{ +const pseudo_typeS md_pseudo_table[] = { /* Forced alignment if declared these ways. */ {"ascii", stringer, 8 + 0}, {"asciz", stringer, 8 + 1}, @@ -3894,13 +4118,17 @@ const pseudo_typeS md_pseudo_table[] = {"hint_func_args", nds32_set_hint_func_args, 0}, /* Abandon?? */ {"omit_fp_begin", nds32_omit_fp_begin, 1}, {"omit_fp_end", nds32_omit_fp_begin, 0}, - {"no_ex9_begin", nds32_no_ex9_begin, 1}, - {"no_ex9_end", nds32_no_ex9_begin, 0}, {"vec_size", nds32_vec_size, 0}, {"flag", nds32_flag, 0}, {"innermost_loop_begin", nds32_loop_begin, 1}, {"innermost_loop_end", nds32_loop_begin, 0}, {"relax_hint", nds32_relax_hint, 0}, + {"maybe_align", nds32_maybe_align, 0}, + {"signature_end", nds32_security_end, 0}, + {"inline_asm_begin", nds32_inline_asm, 1}, + {"inline_asm_end", nds32_inline_asm, 0}, + {"ict_model", ict_model, 0}, + {"v2abi_compatible", nds32_compatible_abi, 0}, {NULL, NULL, 0} }; @@ -3917,9 +4145,10 @@ nds32_pre_do_align (int n, char *fill, int len, int max) { dwarf2_emit_insn (0); fragP = frag_now; + add_mapping_symbol_for_align (n, frag_now_fix (), 0); frag_align_code (n, max); - /* Tag this alignment when there is a label before it. */ + /* Tag this alignment when there is a lable before it. */ if (label_exist) { fragP->tc_frag_data.flag = NDS32_FRAG_LABEL; @@ -4003,24 +4232,26 @@ void md_begin (void) { struct nds32_keyword *k; - unsigned int i; + relax_info_t *relax_info; + int flags = 0; bfd_set_arch_mach (stdoutput, TARGET_ARCH, nds32_baseline); nds32_init_nds32_pseudo_opcodes (); asm_desc.parse_operand = nds32_asm_parse_operand; - nds32_asm_init (&asm_desc, 0); + if (nds32_gpr16) + flags |= NASM_OPEN_REDUCED_REG; + nds32_asm_init (&asm_desc, flags); - /* Initial general purpose registers hash table. */ + /* Initial general pupose registers hash table. */ nds32_gprs_hash = hash_new (); for (k = keyword_gpr; k->name; k++) hash_insert (nds32_gprs_hash, k->name, k); /* Initial branch hash table. */ nds32_relax_info_hash = hash_new (); - for (i = 0; i < ARRAY_SIZE (relax_table); i++) - hash_insert (nds32_relax_info_hash, relax_table[i].opcode, - &relax_table[i]); + for (relax_info = relax_table; relax_info->opcode; relax_info++) + hash_insert (nds32_relax_info_hash, relax_info->opcode, relax_info); /* Initial relax hint hash table. */ nds32_hint_hash = hash_new (); @@ -4138,13 +4369,14 @@ get_range_type (const struct nds32_field *field) /* Save pseudo instruction relocation list. */ static struct nds32_relocs_pattern* -nds32_elf_save_pseudo_pattern (fixS* fixP, struct nds32_opcode *opcode, +nds32_elf_save_pseudo_pattern (fixS* fixP, struct nds32_asm_insn *insn, char *out, symbolS *sym, struct nds32_relocs_pattern *reloc_ptr, fragS *fragP) { + struct nds32_opcode *opcode = insn->opcode; if (!reloc_ptr) - reloc_ptr = XNEW (struct nds32_relocs_pattern); + reloc_ptr = malloc (sizeof (struct nds32_relocs_pattern)); reloc_ptr->seg = now_seg; reloc_ptr->sym = sym; reloc_ptr->frag = fragP; @@ -4152,6 +4384,7 @@ nds32_elf_save_pseudo_pattern (fixS* fixP, struct nds32_opcode *opcode, reloc_ptr->fixP = fixP; reloc_ptr->opcode = opcode; reloc_ptr->where = out; + reloc_ptr->insn = insn->insn; reloc_ptr->next = NULL; return reloc_ptr; } @@ -4193,10 +4426,21 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, reloc = BFD_RELOC_NDS32_TLS_LE_HI20; break; case BFD_RELOC_NDS32_GOTTPOFF: /* @GOTTPOFF */ - reloc = BFD_RELOC_NDS32_TLS_IE_HI20; + reloc = nds32_pic ? BFD_RELOC_NDS32_TLS_IEGP_HI20 : BFD_RELOC_NDS32_TLS_IE_HI20; + break; + case BFD_RELOC_NDS32_TLS_DESC: /* @TLSDESC */ + reloc = BFD_RELOC_NDS32_TLS_DESC_HI20; + break; + case BFD_RELOC_NDS32_ICT: + reloc = BFD_RELOC_NDS32_ICT_HI20; break; default: /* No suffix. */ - reloc = BFD_RELOC_NDS32_HI20; + if (nds32_pic) + /* When the file is pic, the address must be offset to gp. + It may define another relocation or use GOTOFF. */ + reloc = BFD_RELOC_NDS32_PLT_GOTREL_HI20; + else + reloc = BFD_RELOC_NDS32_HI20; break; } fixP = fix_new_exp (fragP, out - fragP->fr_literal, insn->opcode->isize, @@ -4228,8 +4472,22 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, case BFD_RELOC_NDS32_TPOFF: /* @TPOFF */ reloc = BFD_RELOC_NDS32_TLS_LE_LO12; break; + case BFD_RELOC_NDS32_GOTTPOFF: /* @GOTTPOFF */ + reloc = nds32_pic ? BFD_RELOC_NDS32_TLS_IEGP_LO12 : BFD_RELOC_NDS32_TLS_IE_LO12; + break; + case BFD_RELOC_NDS32_TLS_DESC: /* @TLSDESC */ + reloc = BFD_RELOC_NDS32_TLS_DESC_LO12; + break; + case BFD_RELOC_NDS32_ICT: + reloc = BFD_RELOC_NDS32_ICT_LO12; + break; default: /* No suffix. */ - reloc = BFD_RELOC_NDS32_LO12S0; + if (nds32_pic) + /* When the file is pic, the address must be offset to gp. + It may define another relocation or use GOTOFF. */ + reloc = BFD_RELOC_NDS32_PLT_GOTREL_LO12; + else + reloc = BFD_RELOC_NDS32_LO12S0; break; } } @@ -4237,11 +4495,14 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, reloc = BFD_RELOC_NDS32_LO12S1; /* [ls]hi */ else if (fld->bitsize == 15 && fld->shift == 2) { - /* [ls]wi */ + /* [ls]wi */ switch (pexp->X_md) { case BFD_RELOC_NDS32_GOTTPOFF: /* @GOTTPOFF */ - reloc = BFD_RELOC_NDS32_TLS_IE_LO12S2; + reloc = nds32_pic ? BFD_RELOC_NDS32_TLS_IEGP_LO12S2 : BFD_RELOC_NDS32_TLS_IE_LO12S2; + break; + case BFD_RELOC_NDS32_ICT: + reloc = BFD_RELOC_NDS32_ICT_LO12S2; break; default: /* No suffix. */ reloc = BFD_RELOC_NDS32_LO12S2; @@ -4251,7 +4512,7 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, else if (fld->bitsize == 15 && fld->shift == 3) reloc = BFD_RELOC_NDS32_LO12S3; /* [ls]di */ else if (fld->bitsize == 12 && fld->shift == 2) - reloc = R_NDS32_LO12S2_SP_RELA; /* f[ls][sd]i */ + reloc = BFD_RELOC_NDS32_LO12S2_SP; /* f[ls][sd]i */ fixP = fix_new_exp (fragP, out - fragP->fr_literal, insn->opcode->isize, insn->info, 0 /* pcrel */, reloc); @@ -4261,7 +4522,12 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, { /* Relocation for 32-bit branch instructions. */ if (fld->bitsize == 24 && fld->shift == 1) - reloc = BFD_RELOC_NDS32_25_PCREL; + { + if (pexp->X_md == BFD_RELOC_NDS32_ICT) + reloc = BFD_RELOC_NDS32_ICT_25PC; + else + reloc = BFD_RELOC_NDS32_25_PCREL; + } else if (fld->bitsize == 16 && fld->shift == 1) reloc = BFD_RELOC_NDS32_17_PCREL; else if (fld->bitsize == 14 && fld->shift == 1) @@ -4272,7 +4538,7 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, abort (); fixP = fix_new_exp (fragP, out - fragP->fr_literal, insn->opcode->isize, - insn->info, 1 /* pcrel */, reloc); + insn->info, 1 /* pcrel */, reloc); } else if (fld && fld->bitpos == 0 && insn->opcode->isize == 4 && (insn->attr & NASM_ATTR_GPREL)) @@ -4288,7 +4554,7 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, abort (); fixP = fix_new_exp (fragP, out - fragP->fr_literal, insn->opcode->isize, - insn->info, 0 /* pcrel */, reloc); + insn->info, 0 /* pcrel */, reloc); /* Insert INSN16 for converting fp_as_gp. */ exp.X_op = O_symbol; exp.X_add_symbol = abs_section_sym; @@ -4310,20 +4576,6 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, fixP = fix_new_exp (fragP, out - fragP->fr_literal, insn->opcode->isize, insn->info, 1 /* pcrel */, reloc); } - else if (fld && fld->bitpos == 0 && (insn->attr & NASM_ATTR_IFC_EXT)) - { - /* Relocation for ifcall instruction. */ - if (insn->opcode->isize == 2 && fld->bitsize == 9 && fld->shift == 1) - reloc = BFD_RELOC_NDS32_10IFCU_PCREL; - else if (insn->opcode->isize == 4 && fld->bitsize == 16 - && fld->shift == 1) - reloc = BFD_RELOC_NDS32_17IFC_PCREL; - else - abort (); - - fixP = fix_new_exp (fragP, out - fragP->fr_literal, insn->opcode->isize, - insn->info, 1 /* pcrel */, reloc); - } else if (fld) as_bad (_("Don't know how to handle this field. %s"), str); @@ -4335,8 +4587,9 @@ nds32_elf_record_fixup_exp (fragS *fragP, const char *str, static void nds32_elf_build_relax_relation (fixS *fixP, expressionS *pexp, char* out, - struct nds32_opcode *opcode, fragS *fragP, - const struct nds32_field *fld) + struct nds32_asm_insn *insn, fragS *fragP, + const struct nds32_field *fld, + bfd_boolean pseudo_hint) { struct nds32_relocs_pattern *reloc_ptr; struct nds32_relocs_group *group; @@ -4346,10 +4599,32 @@ nds32_elf_build_relax_relation (fixS *fixP, expressionS *pexp, char* out, if (fld) sym = pexp->X_add_symbol; - if (pseudo_opcode) + if (pseudo_hint) + { + /* We cannot know how many instructions will be expanded for + the pseudo instruction here. The first expanded instruction fills + the memory created by relax_hint. The follower will created and link + here. */ + group = nds32_relax_hint_current; + while (group) + { + if (group->pattern->opcode == NULL) + nds32_elf_save_pseudo_pattern (fixP, insn, out, sym, + group->pattern, fragP); + else + { + group->pattern->next = + nds32_elf_save_pseudo_pattern (fixP, insn, out, sym, + NULL, fragP); + group->pattern = group->pattern->next; + } + group = group->next; + } + } + else if (pseudo_opcode) { /* Save instruction relation for pseudo instruction expanding pattern. */ - reloc_ptr = nds32_elf_save_pseudo_pattern (fixP, opcode, out, sym, + reloc_ptr = nds32_elf_save_pseudo_pattern (fixP, insn, out, sym, NULL, fragP); if (!relocs_list) relocs_list = reloc_ptr; @@ -4367,7 +4642,7 @@ nds32_elf_build_relax_relation (fixS *fixP, expressionS *pexp, char* out, group = nds32_relax_hint_current; while (group) { - nds32_elf_save_pseudo_pattern (fixP, opcode, out, sym, + nds32_elf_save_pseudo_pattern (fixP, insn, out, sym, group->pattern, fragP); group = group->next; free (nds32_relax_hint_current); @@ -4383,40 +4658,214 @@ nds32_elf_build_relax_relation (fixS *fixP, expressionS *pexp, char* out, #define N32_MEM_EXT(insn) ((N32_OP6_MEM << 25) | insn) /* Relax pattern for link time relaxation. */ +/* relaxation types only! relocation types are not necessary */ +/* refer to nds32_elf_record_fixup_exp() */ static struct nds32_relax_hint_table relax_ls_table[] = { { - /* Set address: la -> sethi ori. */ - NDS32_RELAX_HINT_LA, /* main_type */ - 8, /* relax_code_size */ - { - OP6 (SETHI), - OP6 (ORI), - }, /* relax_code_seq */ - { - {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, - {4, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_INSN16} - } /* relax_fixup */ + /* For bug-12566, LA and Floating LSI. */ + .main_type = NDS32_RELAX_HINT_LA_FLSI, + .relax_code_size = 12, + .relax_code_seq = + { + OP6 (SETHI), + OP6 (ORI), + OP6 (LBI), + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_PTR, BFD_RELOC_NDS32_PTR}, + {4, 4, NDS32_HINT | NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {8, 4, NDS32_HINT | NDS32_SYM, BFD_RELOC_NDS32_LSI}, + {8, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_HINT | NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + } }, { - /* Set address: l.w -> sethi ori. */ - NDS32_RELAX_HINT_LS, /* main_type */ - 8, /* relax_code_size */ - { - OP6 (SETHI), - OP6 (LBI), - }, /* relax_code_seq */ - { - {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, - {4, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_INSN16} - } /* relax_fixup */ + /* Load Address / Load-Store (LALS). */ + .main_type = NDS32_RELAX_HINT_LALS, + .relax_code_size = 12, + .relax_code_seq = + { + OP6 (SETHI), + OP6 (ORI), + OP6 (LBI), + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {8, 4, NDS32_HINT | NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + } }, { - 0, - 0, - {0}, - {{0, 0 , 0, 0}} + /* B(AL) symbol@PLT */ + .main_type = NDS32_RELAX_HINT_LA_PLT, + .relax_code_size = 16, + .relax_code_seq = + { + OP6 (SETHI), + OP6 (ORI), + OP6 (ALU1), + OP6 (JREG), + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_PTR, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_HINT | NDS32_PTR, BFD_RELOC_NDS32_PTR}, + {12, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PLT_GOT_SUFF}, + {12, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_HINT | NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + } + }, + { + /* LA (@GOT). */ + .main_type = NDS32_RELAX_HINT_LA_GOT, + .relax_code_size = 12, + .relax_code_seq = + { + OP6 (SETHI), + OP6 (ORI), + OP6 (MEM), + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_PTR, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_GOT_SUFF}, + {0, 0, 0, 0} + } + }, + { + /* LA (@GOTOFF). */ + .main_type = NDS32_RELAX_HINT_LA_GOTOFF, + .relax_code_size = 16, + .relax_code_seq = + { + OP6 (SETHI), + OP6 (ORI), + OP6 (ALU1), + OP6 (MEM), + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_PTR, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_GOTOFF_SUFF}, + {12, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_GOTOFF_SUFF}, + {0, 0, 0, 0} + } + }, + { + /* TLS LE LS|LA */ + .main_type = NDS32_RELAX_HINT_TLS_LE_LS, + .relax_code_size = 16, + .relax_code_seq = + { + OP6(SETHI), + OP6(ORI), + OP6(MEM), + OP6(ALU1), + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_PTR_MULTIPLE, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_HINT | NDS32_SYM, BFD_RELOC_NDS32_TLS_LE_LS}, + {12, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {12, 4, NDS32_HINT | NDS32_SYM, BFD_RELOC_NDS32_TLS_LE_ADD}, + {0, 0, 0, 0} + } + }, + { + /* TLS IE LA */ + .main_type = NDS32_RELAX_HINT_TLS_IE_LA, + .relax_code_size = 8, + .relax_code_seq = + { + OP6(SETHI), + OP6(LBI), + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_INSN16, BFD_RELOC_NDS32_INSN16}, + {0, 0, 0, 0} + } + }, + { + /* TLS IEGP LA */ + .main_type = NDS32_RELAX_HINT_TLS_IEGP_LA, + .relax_code_size = 12, + .relax_code_seq = + { + OP6 (SETHI), + OP6 (ORI), + OP6 (MEM), + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_PTR_PATTERN, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_HINT | NDS32_SYM, BFD_RELOC_NDS32_TLS_IEGP_LW}, + {0, 0, 0, 0} + } + }, + { + /* TLS DESC LS: */ + .main_type = NDS32_RELAX_HINT_TLS_DESC_LS, + .relax_code_size = 24, + .relax_code_seq = + { + OP6 (SETHI), + OP6 (ORI), + OP6 (ALU1), + OP6 (LBI), /* load argument */ + OP6 (JREG), + OP6 (MEM), /* load/store variable or load argument */ + }, + .relax_fixup = + { + {0, 4, NDS32_HINT | NDS32_ADDEND, BFD_RELOC_NDS32_LOADSTORE}, + {4, 4, NDS32_HINT | NDS32_PTR_PATTERN, BFD_RELOC_NDS32_PTR}, + {8, 4, NDS32_HINT | NDS32_ABS, BFD_RELOC_NDS32_PTR_RESOLVED}, + {8, 4, NDS32_HINT | NDS32_SYM, BFD_RELOC_NDS32_TLS_DESC_ADD}, + {12, 4, NDS32_HINT | NDS32_SYM, BFD_RELOC_NDS32_TLS_DESC_FUNC}, + {16, 4, NDS32_HINT | NDS32_SYM, BFD_RELOC_NDS32_TLS_DESC_CALL}, + {20, 4, NDS32_HINT | NDS32_SYM_DESC_MEM, BFD_RELOC_NDS32_TLS_DESC_MEM}, + {0, 0, 0, 0} + } + }, + { + /* Load Address of ICT. */ + .main_type = NDS32_RELAX_HINT_ICT_LA, + .relax_code_size = 8, + .relax_code_seq = + { + OP6 (SETHI), + OP6 (ORI), + }, + .relax_fixup = + { + /* TODO: insert relocations to do relax. */ + {0, 0, 0, 0} + } + }, + { + .main_type = 0, + .relax_code_seq = {0}, + .relax_fixup = {{0, 0 , 0, 0}} } }; @@ -4481,118 +4930,189 @@ nds32_elf_sethi_range (struct nds32_relocs_pattern *pattern) (((size) & 0xff) | ((convertible) ? 1 << 31 : 0) \ | ((optimize) ? 1<< 30 : 0) | (insn16_on ? 1 << 29 : 0)) +#define MAC_COMBO (E_NDS32_HAS_FPU_MAC_INST|E_NDS32_HAS_MAC_DX_INST) static void nds32_set_elf_flags_by_insn (struct nds32_asm_insn * insn) { - /* Set E_NDS32_HAS_EXT_INST. */ - if (insn->opcode->attr & NASM_ATTR_PERF_EXT) - { - if (nds32_perf_ext) - nds32_elf_flags |= E_NDS32_HAS_EXT_INST; - else - as_bad (_("instruction %s requires enabling performance extension"), - insn->opcode->opcode); - } - else if (insn->opcode->attr & NASM_ATTR_PERF2_EXT) - { - if (nds32_perf_ext2) - nds32_elf_flags |= E_NDS32_HAS_EXT2_INST; - else - as_bad (_("instruction %s requires enabling performance extension II"), - insn->opcode->opcode); - } - else if (insn->opcode->attr & NASM_ATTR_AUDIO_ISAEXT) - { - if (nds32_audio_ext) - nds32_elf_flags |= E_NDS32_HAS_AUDIO_INST; - else - as_bad (_("instruction %s requires enabling AUDIO extension"), - insn->opcode->opcode); - } - else if (insn->opcode->attr & NASM_ATTR_STR_EXT) - { - if (nds32_string_ext) - nds32_elf_flags |= E_NDS32_HAS_STRING_INST; - else - as_bad (_("instruction %s requires enabling STRING extension"), - insn->opcode->opcode); - } - else if ((insn->opcode->attr & NASM_ATTR_DIV) - && (insn->opcode->attr & NASM_ATTR_DXREG)) - { - if (nds32_div && nds32_dx_regs) - nds32_elf_flags |= E_NDS32_HAS_DIV_DX_INST; - else - as_bad (_("instruction %s requires enabling DIV & DX_REGS extension"), - insn->opcode->opcode); - } - else if (insn->opcode->attr & NASM_ATTR_FPU) - { - if (nds32_fpu_sp_ext || nds32_fpu_dp_ext) - { - if (!(nds32_elf_flags & (E_NDS32_HAS_FPU_INST | E_NDS32_HAS_FPU_DP_INST))) - nds32_fpu_com = 1; - } - else - as_bad (_("instruction %s requires enabling FPU extension"), - insn->opcode->opcode); - } - else if (insn->opcode->attr & NASM_ATTR_FPU_SP_EXT) - { - if (nds32_fpu_sp_ext) - nds32_elf_flags |= E_NDS32_HAS_FPU_INST; - else - as_bad (_("instruction %s requires enabling FPU_SP extension"), - insn->opcode->opcode); - } - else if ((insn->opcode->attr & NASM_ATTR_FPU_SP_EXT) - && (insn->opcode->attr & NASM_ATTR_MAC)) - { - if (nds32_fpu_sp_ext && nds32_mac) - { - nds32_elf_flags |= E_NDS32_HAS_FPU_MAC_INST; - nds32_elf_flags |= E_NDS32_HAS_FPU_INST; - } - else - as_bad (_("instruction %s requires enabling FPU_MAC extension"), - insn->opcode->opcode); - } - else if (insn->opcode->attr & NASM_ATTR_FPU_DP_EXT) - { - if (nds32_fpu_dp_ext) - nds32_elf_flags |= E_NDS32_HAS_FPU_DP_INST; - else - as_bad (_("instruction %s requires enabling FPU_DP extension"), - insn->opcode->opcode); - } - else if ((insn->opcode->attr & NASM_ATTR_FPU_DP_EXT) - && (insn->opcode->attr & NASM_ATTR_MAC)) + static int skip_flags = NASM_ATTR_EX9_EXT | NASM_ATTR_FPU_FMA + | NASM_ATTR_BRANCH | NASM_ATTR_SATURATION_EXT | NASM_ATTR_GPREL + | NASM_ATTR_DXREG | NASM_ATTR_ISA_V1 | NASM_ATTR_ISA_V2 | NASM_ATTR_ISA_V3 + | NASM_ATTR_ISA_V3M | NASM_ATTR_PCREL; + + int new_flags = insn->opcode->attr & ~skip_flags; + while (new_flags) { - if (nds32_fpu_dp_ext && nds32_mac) + int next = 1 << (ffs (new_flags) - 1); + new_flags &= ~next; + switch (next) { - nds32_elf_flags |= E_NDS32_HAS_FPU_MAC_INST; - nds32_elf_flags |= E_NDS32_HAS_FPU_DP_INST; + case NASM_ATTR_PERF_EXT: + { + if (nds32_perf_ext) + { + nds32_elf_flags |= E_NDS32_HAS_EXT_INST; + skip_flags |= NASM_ATTR_PERF_EXT; + } + else + as_bad (_("instruction %s requires enabling performance " + "extension"), insn->opcode->opcode); + } + break; + case NASM_ATTR_PERF2_EXT: + { + if (nds32_perf_ext2) + { + nds32_elf_flags |= E_NDS32_HAS_EXT2_INST; + skip_flags |= NASM_ATTR_PERF2_EXT; + } + else + as_bad (_("instruction %s requires enabling performance " + "extension II"), insn->opcode->opcode); + } + break; + case NASM_ATTR_AUDIO_ISAEXT: + { + if (nds32_audio_ext) + { + nds32_elf_flags |= E_NDS32_HAS_AUDIO_INST; + skip_flags |= NASM_ATTR_AUDIO_ISAEXT; + } + else + as_bad (_("instruction %s requires enabling AUDIO extension"), + insn->opcode->opcode); + } + break; + case NASM_ATTR_STR_EXT: + { + if (nds32_string_ext) + { + nds32_elf_flags |= E_NDS32_HAS_STRING_INST; + skip_flags |= NASM_ATTR_STR_EXT; + } + else + as_bad (_("instruction %s requires enabling STRING extension"), + insn->opcode->opcode); + } + break; + case NASM_ATTR_DIV: + { + if (insn->opcode->attr & NASM_ATTR_DXREG) + { + if (nds32_div && nds32_dx_regs) + { + nds32_elf_flags |= E_NDS32_HAS_DIV_DX_INST; + skip_flags |= NASM_ATTR_DIV; + } + else + as_bad (_("instruction %s requires enabling DIV & DX_REGS " + "extension"), insn->opcode->opcode); + } + } + break; + case NASM_ATTR_FPU: + { + if (nds32_fpu_sp_ext || nds32_fpu_dp_ext) + { + if (!(nds32_elf_flags + & (E_NDS32_HAS_FPU_INST | E_NDS32_HAS_FPU_DP_INST))) + nds32_fpu_com = 1; + skip_flags |= NASM_ATTR_FPU; + } + else + as_bad (_("instruction %s requires enabling FPU extension"), + insn->opcode->opcode); + } + break; + case NASM_ATTR_FPU_SP_EXT: + { + if (nds32_fpu_sp_ext) + { + nds32_elf_flags |= E_NDS32_HAS_FPU_INST; + skip_flags |= NASM_ATTR_FPU_SP_EXT; + } + else + as_bad (_("instruction %s requires enabling FPU_SP extension"), + insn->opcode->opcode); + } + break; + case NASM_ATTR_FPU_DP_EXT: + { + if (nds32_fpu_dp_ext) + { + nds32_elf_flags |= E_NDS32_HAS_FPU_DP_INST; + skip_flags |= NASM_ATTR_FPU_DP_EXT; + } + else + as_bad (_("instruction %s requires enabling FPU_DP extension"), + insn->opcode->opcode); + } + break; + case NASM_ATTR_MAC: + { + if (insn->opcode->attr & NASM_ATTR_FPU_SP_EXT) + { + if (nds32_fpu_sp_ext && nds32_mac) + nds32_elf_flags |= E_NDS32_HAS_FPU_MAC_INST; + else + as_bad (_("instruction %s requires enabling FPU_MAC " + "extension"), insn->opcode->opcode); + } + else if (insn->opcode->attr & NASM_ATTR_FPU_DP_EXT) + { + if (nds32_fpu_dp_ext && nds32_mac) + nds32_elf_flags |= E_NDS32_HAS_FPU_MAC_INST; + else + as_bad (_("instruction %s requires enabling FPU_MAC " + "extension"), insn->opcode->opcode); + } + else if (insn->opcode->attr & NASM_ATTR_DXREG) + { + if (nds32_dx_regs && nds32_mac) + nds32_elf_flags |= E_NDS32_HAS_MAC_DX_INST; + else + as_bad (_("instruction %s requires enabling DX_REGS " + "extension"), insn->opcode->opcode); + } + + if (MAC_COMBO == (MAC_COMBO & nds32_elf_flags)) + skip_flags |= NASM_ATTR_MAC; + } + break; + case NASM_ATTR_IFC_EXT: + { + nds32_elf_flags |= E_NDS32_HAS_IFC_INST; + skip_flags |= NASM_ATTR_IFC_EXT; + } + break; + case NASM_ATTR_DSP_ISAEXT: + { + if (nds32_dsp_ext) + { + nds32_elf_flags |= E_NDS32_HAS_DSP_INST; + skip_flags |= NASM_ATTR_DSP_ISAEXT; + } + else + as_bad (_("instruction %s requires enabling dsp extension"), + insn->opcode->opcode); + } + break; + case NASM_ATTR_ZOL: + { + if (nds32_zol_ext) + { + nds32_elf_flags |= E_NDS32_HAS_ZOL; + skip_flags |= NASM_ATTR_ZOL; + } + else + as_bad (_("instruction %s requires enabling zol extension"), + insn->opcode->opcode); + } + break; + default: + as_bad (_("internal error: unknown instruction attribute: 0x%08x"), + next); } - else - as_bad (_("instruction %s requires enabling FPU_MAC extension"), - insn->opcode->opcode); - } - /* TODO: FPU_BOTH */ - else if ((insn->opcode->attr & NASM_ATTR_MAC) - && (insn->opcode->attr & NASM_ATTR_DXREG)) - { - if (nds32_mac && nds32_dx_regs) - nds32_elf_flags |= E_NDS32_HAS_MAC_DX_INST; - else - as_bad (_("instruction %s requires enabling DX_REGS extension"), - insn->opcode->opcode); - } - /* TODO: for DX_REG set but not for MAC, DIV, AUDIO */ - else if (insn->opcode->attr & NASM_ATTR_IFC_EXT) - { - nds32_elf_flags |= E_NDS32_HAS_IFC_INST; } - /* TODO: E_NDS32_HAS_SATURATION_INST */ } /* Flag for analysis relaxation type. */ @@ -4607,100 +5127,212 @@ enum nds32_insn_type N32_RELAX_ORI = (1 << 5), N32_RELAX_MEM = (1 << 6), N32_RELAX_MOVI = (1 << 7), + N32_RELAX_ALU1 = (1 << 8), + N32_RELAX_16BIT = (1 << 9), }; struct nds32_hint_map { + /* the preamble relocation */ bfd_reloc_code_real_type hi_type; + /* mnemonic */ const char *opc; + /* relax pattern ID */ enum nds32_relax_hint_type hint_type; + /* range */ enum nds32_br_range range; + /* pattern character flags */ enum nds32_insn_type insn_list; + /* optional pattern character flags */ + enum nds32_insn_type option_list; }; /* Table to match instructions with hint and relax pattern. */ static struct nds32_hint_map hint_map [] = { - { - /* LONGCALL4. */ - BFD_RELOC_NDS32_HI20, - "jal", - NDS32_RELAX_HINT_NONE, - BR_RANGE_U4G, - N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_CALL - }, - { - /* LONGCALL5. */ - _dummy_first_bfd_reloc_code_real, - "bgezal", - NDS32_RELAX_HINT_NONE, - BR_RANGE_S16M, - N32_RELAX_BR | N32_RELAX_CALL - }, - { - /* LONGCALL6. */ - BFD_RELOC_NDS32_HI20, - "bgezal", - NDS32_RELAX_HINT_NONE, - BR_RANGE_U4G, - N32_RELAX_BR | N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_CALL - }, - { - /* LONGJUMP4. */ - BFD_RELOC_NDS32_HI20, - "j", - NDS32_RELAX_HINT_NONE, - BR_RANGE_U4G, - N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_JUMP - }, - { - /* LONGJUMP5. */ - /* There is two kinds of variations of LONGJUMP5. One of them - generate EMPTY relocation for converted INSN16 if needed. - But we don't distinguish them here. */ - _dummy_first_bfd_reloc_code_real, - "beq", - NDS32_RELAX_HINT_NONE, - BR_RANGE_S16M, - N32_RELAX_BR | N32_RELAX_JUMP - }, - { - /* LONGJUMP6. */ - BFD_RELOC_NDS32_HI20, - "beq", - NDS32_RELAX_HINT_NONE, - BR_RANGE_U4G, - N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_BR | N32_RELAX_JUMP - }, - { - /* LONGJUMP7. */ - _dummy_first_bfd_reloc_code_real, - "beqc", - NDS32_RELAX_HINT_NONE, - BR_RANGE_S16K, - N32_RELAX_MOVI | N32_RELAX_BR - }, - { - /* LOADSTORE ADDRESS. */ - BFD_RELOC_NDS32_HI20, - NULL, - NDS32_RELAX_HINT_LA, - BR_RANGE_U4G, - N32_RELAX_SETHI | N32_RELAX_ORI - }, - { - /* LOADSTORE ADDRESS. */ - BFD_RELOC_NDS32_HI20, - NULL, - NDS32_RELAX_HINT_LS, - BR_RANGE_U4G, - N32_RELAX_SETHI | N32_RELAX_LSI - }, - {0, NULL, 0, 0 ,0} + { + /* LONGCALL4. */ + BFD_RELOC_NDS32_HI20, + "jal", + NDS32_RELAX_HINT_NONE, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_CALL, + 0, + }, + { + /* LONGCALL5. */ + _dummy_first_bfd_reloc_code_real, + "bgezal", + NDS32_RELAX_HINT_NONE, + BR_RANGE_S16M, + N32_RELAX_BR | N32_RELAX_CALL, + 0, + }, + { + /* LONGCALL6. */ + BFD_RELOC_NDS32_HI20, + "bgezal", + NDS32_RELAX_HINT_NONE, + BR_RANGE_U4G, + N32_RELAX_BR | N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_CALL, + 0, + }, + { + /* LONGJUMP4. */ + BFD_RELOC_NDS32_HI20, + "j", + NDS32_RELAX_HINT_NONE, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_JUMP, + 0, + }, + { + /* LONGJUMP5. */ + /* There is two kinds of variation of LONGJUMP5. One of them + generate EMPTY relocation for converted INSN16 if needed. + But we don't distinguish them here. */ + _dummy_first_bfd_reloc_code_real, + "beq", + NDS32_RELAX_HINT_NONE, + BR_RANGE_S16M, + N32_RELAX_BR | N32_RELAX_JUMP, + 0, + }, + { + /* LONGJUMP6. */ + BFD_RELOC_NDS32_HI20, + "beq", + NDS32_RELAX_HINT_NONE, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_BR | N32_RELAX_JUMP, + 0, + }, + { + /* LONGJUMP7. */ + _dummy_first_bfd_reloc_code_real, + "beqc", + NDS32_RELAX_HINT_NONE, + BR_RANGE_S16K, + N32_RELAX_MOVI | N32_RELAX_BR, + 0, + }, + { + /* LONGCALL (BAL|JR|LA symbol@PLT). */ + BFD_RELOC_NDS32_PLT_GOTREL_HI20, + NULL, + NDS32_RELAX_HINT_LA_PLT, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI, + N32_RELAX_ALU1 | N32_RELAX_CALL | N32_RELAX_JUMP, + }, + /* relative issue: #12566 */ + { + /* LA and Floating LSI. */ + BFD_RELOC_NDS32_HI20, + NULL, + NDS32_RELAX_HINT_LA_FLSI, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_LSI, + 0, + }, + /* relative issue: #11685 #11602 */ + { + /* load address / load-store (LALS). */ + BFD_RELOC_NDS32_HI20, + NULL, + NDS32_RELAX_HINT_LALS, + BR_RANGE_U4G, + N32_RELAX_SETHI, + N32_RELAX_ORI | N32_RELAX_LSI, + }, + { + /* setup $GP (_GLOBAL_OFFSET_TABLE_) */ + BFD_RELOC_NDS32_GOTPC_HI20, + NULL, + NDS32_RELAX_HINT_LALS, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI, + 0, + }, + { + /* GOT LA/LS (symbol@GOT) */ + BFD_RELOC_NDS32_GOT_HI20, + NULL, + NDS32_RELAX_HINT_LA_GOT, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI, + N32_RELAX_MEM, + }, + { + /* GOTOFF LA/LS (symbol@GOTOFF) */ + BFD_RELOC_NDS32_GOTOFF_HI20, + NULL, + NDS32_RELAX_HINT_LA_GOTOFF, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI, + N32_RELAX_ALU1 | N32_RELAX_MEM, /* | N32_RELAX_LSI, */ + }, + { + /* TLS LE LA|LS (@TPOFF) */ + BFD_RELOC_NDS32_TLS_LE_HI20, + NULL, + NDS32_RELAX_HINT_TLS_LE_LS, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI, + N32_RELAX_ALU1 | N32_RELAX_MEM, + }, + { + /* TLS IE LA */ + BFD_RELOC_NDS32_TLS_IE_HI20, + NULL, + NDS32_RELAX_HINT_TLS_IE_LA, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_LSI, + 0, + }, + { + /* TLS IE LS */ + BFD_RELOC_NDS32_TLS_IE_HI20, + NULL, + NDS32_RELAX_HINT_TLS_IE_LS, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_LSI | N32_RELAX_MEM, + 0, + }, + { + /* TLS IEGP LA */ + BFD_RELOC_NDS32_TLS_IEGP_HI20, + NULL, + NDS32_RELAX_HINT_TLS_IEGP_LA, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_MEM, + 0, + }, + { + /* TLS DESC LS */ + BFD_RELOC_NDS32_TLS_DESC_HI20, + NULL, + NDS32_RELAX_HINT_TLS_DESC_LS, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI | N32_RELAX_ALU1 | N32_RELAX_CALL, + N32_RELAX_LSI | N32_RELAX_MEM, + }, + { + /* Jump-patch load address (LA). */ + BFD_RELOC_NDS32_ICT_HI20, + NULL, + NDS32_RELAX_HINT_ICT_LA, + BR_RANGE_U4G, + N32_RELAX_SETHI | N32_RELAX_ORI, + 0, + }, + /* last one */ + {0, NULL, 0, 0 ,0, 0} }; /* Find the relaxation pattern according to instructions. */ +/* TODO: refine this function with hash or so */ static bfd_boolean nds32_find_reloc_table (struct nds32_relocs_pattern *relocs_pattern, @@ -4739,6 +5371,9 @@ nds32_find_reloc_table (struct nds32_relocs_pattern *relocs_pattern, case N32_OP6_MEM: relax_type |= N32_RELAX_MEM; break; + case N32_OP6_ALU1: + relax_type |= N32_RELAX_ALU1; + break; case N32_OP6_ORI: relax_type |= N32_RELAX_ORI; break; @@ -4760,6 +5395,8 @@ nds32_find_reloc_table (struct nds32_relocs_pattern *relocs_pattern, case N32_OP6_SWI: case N32_OP6_LWC: case N32_OP6_SWC: + case N32_OP6_LDC: + case N32_OP6_SDC: relax_type |= N32_RELAX_LSI; break; case N32_OP6_JREG: @@ -4784,16 +5421,20 @@ nds32_find_reloc_table (struct nds32_relocs_pattern *relocs_pattern, { /* 2 byte instruction. Compare by opcode name because the opcode of 2byte instruction is not regular. */ - for (i = 0; i < sizeof (check_insn) / sizeof (check_insn[0]); i++) + int is_matched = 0; + for (i = 0; i < ARRAY_SIZE (check_insn); i++) { if (strcmp (pattern->opcode->opcode, check_insn[i]) == 0) { relax_type |= N32_RELAX_BR; + is_matched += 1; break; } } - if (strcmp (pattern->opcode->opcode, "movi55") == 0) - relax_type |= N32_RELAX_MOVI; + if (!is_matched) + { + relax_type |= N32_RELAX_16BIT; + } } pattern = pattern->next; } @@ -4801,23 +5442,35 @@ nds32_find_reloc_table (struct nds32_relocs_pattern *relocs_pattern, /* Analysis instruction flag to choose relaxation table. */ while (map_ptr->insn_list != 0) { - if (map_ptr->insn_list == relax_type - && (!hi_pattern - || (hi_pattern->fixP - && hi_pattern->fixP->fx_r_type == map_ptr->hi_type))) + struct nds32_hint_map *hint = map_ptr++; + enum nds32_insn_type must = hint->insn_list; + enum nds32_insn_type optional = hint->option_list; + enum nds32_insn_type extra; + + if (must != (must & relax_type)) + continue; + + extra = relax_type ^ must; + if (extra != (extra & optional)) + continue; + + if (!hi_pattern + || (hi_pattern->fixP + && hi_pattern->fixP->fx_r_type == hint->hi_type)) { - opc = map_ptr->opc; - hint_type = map_ptr->hint_type; - range = map_ptr->range; + opc = hint->opc; + hint_type = hint->hint_type; + range = hint->range; + map_ptr = hint; break; } - map_ptr++; } if (map_ptr->insn_list == 0) { - as_warn (_("Can not find match relax hint. Line: %d"), - relocs_pattern->frag->fr_line); + if (!nds32_pic) + as_warn (_("Can not find match relax hint. line : %d"), + relocs_pattern->fixP->fx_line); return FALSE; } @@ -4876,12 +5529,14 @@ nds32_find_reloc_table (struct nds32_relocs_pattern *relocs_pattern, /* Because there are a lot of variant of load-store, check all these type here. */ -#define CLEAN_REG(insn) ((insn) & 0xff0003ff) +#define CLEAN_REG(insn) ((insn) & 0xfe0003ff) +#define GET_OPCODE(insn) ((insn) & 0xfe000000) + static bfd_boolean nds32_match_hint_insn (struct nds32_opcode *opcode, uint32_t seq) { const char *check_insn[] = - { "bnes38", "beqs38", "bnez38", "bnezs8", "beqz38", "beqzs8" }; + { "bnes38", "beqs38", "bnez38", "bnezs8", "beqz38", "beqzs8", "jral5" }; uint32_t insn = opcode->value; unsigned int i; @@ -4897,22 +5552,23 @@ nds32_match_hint_insn (struct nds32_opcode *opcode, uint32_t seq) if (insn == OP6 (LBI) || insn == OP6 (SBI) || insn == OP6 (LBSI) || insn == OP6 (LHI) || insn == OP6 (SHI) || insn == OP6 (LHSI) || insn == OP6 (LWI) || insn == OP6 (SWI) - || insn == OP6 (LWC) || insn == OP6 (SWC)) - return TRUE; + || insn == OP6 (LWC) || insn == OP6 (SWC) + || insn == OP6 (LDC) || insn == OP6 (SDC)) + return TRUE; break; case OP6 (BR2): /* This is for LONGCALL5 and LONGCALL6. */ if (insn == OP6 (BR2)) - return TRUE; + return TRUE; break; case OP6 (BR1): /* This is for LONGJUMP5 and LONGJUMP6. */ if (opcode->isize == 4 && (insn == OP6 (BR1) || insn == OP6 (BR2) || insn == OP6 (BR3))) - return TRUE; + return TRUE; else if (opcode->isize == 2) { - for (i = 0; i < sizeof (check_insn) / sizeof (check_insn[0]); i++) + for (i = 0; i < ARRAY_SIZE (check_insn); i++) if (strcmp (opcode->opcode, check_insn[i]) == 0) return TRUE; } @@ -4920,8 +5576,28 @@ nds32_match_hint_insn (struct nds32_opcode *opcode, uint32_t seq) case OP6 (MOVI): /* This is for LONGJUMP7. */ if (opcode->isize == 2 && strcmp (opcode->opcode, "movi55") == 0) - return TRUE; + return TRUE; + break; + case OP6 (MEM): + if (OP6 (MEM) == GET_OPCODE (insn)) + return TRUE; break; + case OP6 (JREG): + /* bit 24: N32_JI_JAL */ /* feed me! */ + if ((insn & ~(N32_BIT (24))) == JREG (JRAL)) + return TRUE; + break; + default: + if (opcode->isize == 2) + { + for (i = 0; i < ARRAY_SIZE (check_insn); i++) + if (strcmp (opcode->opcode, check_insn[i]) == 0) + return TRUE; + + if ((strcmp (opcode->opcode, "add5.pc") == 0) || + (strcmp (opcode->opcode, "add45") == 0)) + return TRUE; + } } return FALSE; } @@ -4929,7 +5605,7 @@ nds32_match_hint_insn (struct nds32_opcode *opcode, uint32_t seq) /* Append relax relocation for link time relaxing. */ static void -nds32_elf_append_relax_relocs (const char *key ATTRIBUTE_UNUSED, void *value) +nds32_elf_append_relax_relocs (const char *key, void *value) { struct nds32_relocs_pattern *relocs_pattern = (struct nds32_relocs_pattern *) value; @@ -4942,7 +5618,7 @@ nds32_elf_append_relax_relocs (const char *key ATTRIBUTE_UNUSED, void *value) struct nds32_relax_hint_table hint_info; nds32_relax_fixup_info_t *hint_fixup, *fixup_now; size_t fixup_size; - offsetT branch_offset; + offsetT branch_offset, hi_branch_offset = 0; fixS *fixP; int range, offset; unsigned int ptr_offset, hint_count, relax_code_size, count = 0; @@ -4963,6 +5639,7 @@ nds32_elf_append_relax_relocs (const char *key ATTRIBUTE_UNUSED, void *value) if (pattern_now->opcode->value == OP6 (SETHI)) { hi_sym = pattern_now->sym; + hi_branch_offset = pattern_now->fixP->fx_offset; break; } pattern_now = pattern_now->next; @@ -4979,15 +5656,36 @@ nds32_elf_append_relax_relocs (const char *key ATTRIBUTE_UNUSED, void *value) relax_code_size = hint_info.relax_code_size; pattern_now = relocs_pattern; +#ifdef NDS32_LINUX_TOOLCHAIN + /* prepare group relocation ID (number). */ + long group_id = 0; + if (key) + { + /* convert .relax_hint key to number */ + errno = 0; + group_id = strtol (key, NULL, 10); + if ((errno == ERANGE && (group_id == LONG_MAX || group_id == LONG_MIN)) + || (errno != 0 && group_id == 0)) + { + as_bad (_("Internal error: .relax_hint KEY is not a number!")); + goto restore; + } + } +#endif + /* Insert relaxation. */ exp.X_op = O_symbol; + /* for each instruction in the hint group */ while (pattern_now) { - /* Choose the match fixup by instruction. */ + if (count >= relax_code_size / 4) + count = 0; + /* Choose the match fix-up by instruction. */ code_insn = CLEAN_REG (*(code_seq + count)); if (!nds32_match_hint_insn (pattern_now->opcode, code_insn)) { + /* try search from head again */ count = 0; code_insn = CLEAN_REG (*(code_seq + count)); @@ -4996,8 +5694,11 @@ nds32_elf_append_relax_relocs (const char *key ATTRIBUTE_UNUSED, void *value) count++; if (count >= relax_code_size / 4) { - as_bad (_("Internal error: Relax hint error. %s: %x"), - now_seg->name, pattern_now->opcode->value); + as_bad (_("Internal error: Relax hint (%s) error. %s: %s (%x)"), + key, + now_seg->name, + pattern_now->opcode->opcode, + pattern_now->opcode->value); goto restore; } code_insn = CLEAN_REG (*(code_seq + count)); @@ -5024,7 +5725,7 @@ nds32_elf_append_relax_relocs (const char *key ATTRIBUTE_UNUSED, void *value) } fixup_size = fixup_now->size; - /* Insert all fixup. */ + /* Insert all fix-up. */ while (fixup_size != 0 && fixup_now->offset == offset) { /* Set the real instruction size in element. */ @@ -5093,7 +5794,108 @@ nds32_elf_append_relax_relocs (const char *key ATTRIBUTE_UNUSED, void *value) { /* For EMPTY relocation save the true symbol. */ exp.X_add_symbol = hi_sym; - exp.X_add_number = branch_offset; + exp.X_add_number = hi_branch_offset; + } + else if (NDS32_SYM_DESC_MEM & fixup_now->ramp) + { + /* do the same as NDS32_SYM */ + exp.X_add_symbol = hi_sym; + exp.X_add_number = hi_branch_offset; + + /* extra to NDS32_SYM */ + /* detect if DESC_FUNC relax type do apply */ + if ((REG_GP == N32_RA5 (pattern_now->insn)) + || (REG_GP == N32_RB5 (pattern_now->insn))) + { + fixP = fix_new_exp (fragP, where - fragP->fr_literal, + fixup_size, &exp, pcrel, + BFD_RELOC_NDS32_TLS_DESC_FUNC); + fixP->fx_addnumber = fixP->fx_offset; + + fixup_size = 0; + } + /* else do as usual */ + } + else if (fixup_now->ramp & NDS32_PTR_PATTERN) + { + /* find out PTR_RESOLVED code pattern */ + nds32_relax_fixup_info_t *next_fixup = fixup_now + 1; + uint32_t resolved_pattern = 0; + while (next_fixup->offset) + { + if (next_fixup->r_type == BFD_RELOC_NDS32_PTR_RESOLVED) + { + uint32_t new_pattern = code_seq[next_fixup->offset >> 2]; + if (!resolved_pattern) + resolved_pattern = new_pattern; + else if (new_pattern != resolved_pattern) + { + as_warn (_("Multiple BFD_RELOC_NDS32_PTR_RESOLVED patterns are not supported yet!")); + break; + } + } + ++next_fixup; + } + + /* find matched code and insert fix-ups */ + struct nds32_relocs_pattern *next_pattern = pattern_now->next; + /* This relocation has to point to another instruction. Make + sure each resolved relocation has to be pointed. */ + /* All instruction in relax_table should be 32-bit. */ + while (next_pattern) + { + uint32_t cur_pattern = GET_OPCODE (next_pattern->opcode->value); + if (cur_pattern == resolved_pattern) + { + ptr_offset = next_pattern->where + - next_pattern->frag->fr_literal; + exp.X_add_symbol = symbol_temp_new (now_seg, ptr_offset, + next_pattern->frag); + exp.X_add_number = 0; + fixP = fix_new_exp (fragP, where - fragP->fr_literal, + fixup_size, &exp, 0, + fixup_now->r_type); + fixP->fx_addnumber = fixP->fx_offset; + } + next_pattern = next_pattern->next; + } + + fixup_size = 0; + } + else if (fixup_now->ramp & NDS32_PTR_MULTIPLE) + { + /* find each PTR_RESOLVED pattern after PTR */ + nds32_relax_fixup_info_t *next_fixup = fixup_now + 1; + while (next_fixup->offset) + { + if (next_fixup->r_type == BFD_RELOC_NDS32_PTR_RESOLVED) + { + uint32_t pattern = code_seq[next_fixup->offset >> 2]; + /* find matched code to insert fix-ups */ + struct nds32_relocs_pattern *next_insn = pattern_now->next; + while (next_insn) + { + uint32_t insn_pattern = GET_OPCODE( + next_insn->opcode->value); + if (insn_pattern == pattern) + { + ptr_offset = next_insn->where + - next_insn->frag->fr_literal; + exp.X_add_symbol = symbol_temp_new ( + now_seg, ptr_offset, next_insn->frag); + exp.X_add_number = 0; + fixP = fix_new_exp (fragP, + where - fragP->fr_literal, + fixup_size, &exp, 0, + fixup_now->r_type); + fixP->fx_addnumber = fixP->fx_offset; + } + next_insn = next_insn->next; + } + } + ++next_fixup; + } + fixup_size = 0; } else { @@ -5110,6 +5912,19 @@ nds32_elf_append_relax_relocs (const char *key ATTRIBUTE_UNUSED, void *value) fixup_now++; fixup_size = fixup_now->size; } + +#ifdef NDS32_LINUX_TOOLCHAIN + /* Insert group relocation for each relax hint. */ + if (key) + { + exp.X_add_symbol = hi_sym; /* for eyes only */ + exp.X_add_number = group_id; + fixP = fix_new_exp (fragP, where - fragP->fr_literal, fixup_size, + &exp, pcrel, BFD_RELOC_NDS32_GROUP); + fixP->fx_addnumber = fixP->fx_offset; + } +#endif + if (count < relax_code_size / 4) count++; pattern_now = pattern_now->next; @@ -5120,6 +5935,19 @@ restore: frchain_now = frchain_bak; } +static void +nds32_str_tolower (const char *src, char *dest) +{ + unsigned int i, len; + + len = strlen (src); + + for (i = 0; i < len; i++) + *(dest + i) = TOLOWER (*(src + i)); + + *(dest + i) = '\0'; +} + /* Check instruction if it can be used for the baseline. */ static bfd_boolean @@ -5127,6 +5955,28 @@ nds32_check_insn_available (struct nds32_asm_insn insn, const char *str) { int attr = insn.attr & ATTR_ALL; static int baseline_isa = 0; + char *s; + + s = alloca (strlen (str) + 1); + nds32_str_tolower (str, s); + if (verbatim && inline_asm + && (((insn.opcode->value == ALU2 (MTUSR) + || insn.opcode->value == ALU2 (MFUSR)) + && (strstr (s, "lc") + || strstr (s, "le") + || strstr (s, "lb"))) + || (insn.attr & NASM_ATTR_ZOL))) + { + as_bad (_("Not support instruction %s in verbatim."), str); + return FALSE; + } + + if (!enable_16bit && insn.opcode->isize == 2) + { + as_bad (_("16-bit instruction is disabled: %s."), str); + return FALSE; + } + /* No isa setting or all isa can use. */ if (attr == 0 || attr == ATTR_ALL) return TRUE; @@ -5150,28 +6000,70 @@ nds32_check_insn_available (struct nds32_asm_insn insn, const char *str) if ((baseline_isa & attr) == 0) { - as_bad (_("Instruction %s not supported in the baseline."), str); + as_bad (_("Not support instruction %s in the baseline."), str); return FALSE; } return TRUE; } +/* Clear security and insert relocation. */ +static void +nds32_set_crc (fragS *fragP, struct nds32_asm_insn *insn, char *out) +{ + expressionS exp; + + /* The security region begin. */ + if (strcmp (insn->opcode->opcode, "isps") == 0) + { + exp.X_op = O_symbol; + exp.X_add_symbol = abs_section_sym; + /* Meet the new crc in previos crc region. */ + if (crcing == TRUE) + { + exp.X_add_number = NDS32_SECURITY_RESTART; + fix_new_exp (fragP, out - fragP->fr_literal, 0, &exp, + 0, BFD_RELOC_NDS32_SECURITY_16); + } + crcing = TRUE; + /* For security used only. */ + exp.X_add_number = NDS32_SECURITY_START; + fix_new_exp (fragP, out - fragP->fr_literal, insn->opcode->isize, + &exp, 0 /* pcrel */, BFD_RELOC_NDS32_SECURITY_16); + } + /* Turn off security region when meeting branch. */ + else if (crcing && ((insn->attr & NASM_ATTR_BRANCH) + || insn->opcode->value == MISC (SYSCALL) + || insn->opcode->value == MISC (TRAP) + || insn->opcode->value == MISC (TEQZ) + || insn->opcode->value == MISC (TNEZ) + || insn->opcode->value == MISC (IRET) + || insn->attr & NASM_ATTR_IFC_EXT)) + { + crcing = FALSE; + exp.X_op = O_symbol; + exp.X_add_symbol = abs_section_sym; + exp.X_add_number = NDS32_SECURITY_END; + fix_new_exp (fragP, out - fragP->fr_literal, 0, &exp, + 0, BFD_RELOC_NDS32_SECURITY_16); + } +} + /* Stub of machine dependent. */ void md_assemble (char *str) { struct nds32_asm_insn insn; - expressionS expr; char *out; struct nds32_pseudo_opcode *popcode; const struct nds32_field *fld = NULL; fixS *fixP; uint16_t insn_16; struct nds32_relocs_pattern *relocs_temp; - expressionS *pexp; + struct nds32_relocs_group *group_temp; fragS *fragP; int label = label_exist; + static bfd_boolean pseudo_hint = FALSE; popcode = nds32_lookup_pseudo_opcode (str); /* Note that we need to check 'verbatim' and @@ -5180,11 +6072,23 @@ md_assemble (char *str) need to perform pseudo instruction expansion/transformation. */ if (popcode && !(verbatim && popcode->physical_op)) { + /* Pseudo instruction is with relax_hint. */ + if (relaxing) + pseudo_hint = TRUE; pseudo_opcode = TRUE; nds32_pseudo_opcode_wrapper (str, popcode); pseudo_opcode = FALSE; + pseudo_hint = FALSE; nds32_elf_append_relax_relocs (NULL, relocs_list); + /* Free relax_hint group list. */ + while (nds32_relax_hint_current) + { + group_temp = nds32_relax_hint_current->next; + free (nds32_relax_hint_current); + nds32_relax_hint_current = group_temp; + } + /* Free pseudo list. */ relocs_temp = relocs_list; while (relocs_temp) @@ -5193,12 +6097,11 @@ md_assemble (char *str) free (relocs_temp); relocs_temp = relocs_list; } - return; } label_exist = 0; - insn.info = & expr; + insn.info = (expressionS *) alloca (sizeof (expressionS)); asm_desc.result = NASM_OK; nds32_assemble (&asm_desc, &insn, str); @@ -5235,11 +6138,13 @@ md_assemble (char *str) /* Make sure the beginning of text being 2-byte align. */ nds32_adjust_label (1); + add_mapping_symbol (MAP_CODE, 0, 0); fld = insn.field; /* Try to allocate the max size to guarantee relaxable same branch instructions in the same fragment. */ frag_grow (NDS32_MAXCHAR); fragP = frag_now; + if (fld && (insn.attr & NASM_ATTR_BRANCH) && (pseudo_opcode || (insn.opcode->value != INSN_JAL && insn.opcode->value != INSN_J)) @@ -5247,7 +6152,7 @@ md_assemble (char *str) { /* User assembly code branch relax for it. */ /* If fld is not NULL, it is a symbol. */ - /* Branch must relax to proper pattern in user assembly code exclude + /* Branch msut relax to proper pattern in user assembly code exclude J and JAL. Keep these two in original type for users which wants to keep their size be fixed. In general, assembler does not convert instruction generated by compiler. But jump instruction may be @@ -5257,8 +6162,8 @@ md_assemble (char *str) /* Get branch range type. */ dwarf2_emit_insn (0); enum nds32_br_range range_type; + expressionS *pexp = insn.info; - pexp = insn.info; range_type = get_range_type (fld); out = frag_var (rs_machine_dependent, NDS32_MAXCHAR, @@ -5274,6 +6179,12 @@ md_assemble (char *str) else if (insn.opcode->isize == 2) bfd_putb16 (insn.insn, out); fragP->tc_frag_data.flag |= NDS32_FRAG_BRANCH; + + if (fld->bitsize == 24 && fld->shift == 1 + && pexp->X_md == BFD_RELOC_NDS32_ICT) + fragP->tc_frag_data.flag |= NDS32_FRAG_ICT_BRANCH; + + nds32_set_crc (fragP, &insn, out); return; /* md_convert_frag will insert relocations. */ } @@ -5284,7 +6195,7 @@ md_assemble (char *str) && nds32_convert_16_to_32 (stdoutput, insn.insn, NULL)))) { /* Record this one is relaxable. */ - pexp = insn.info; + expressionS *pexp = insn.info; dwarf2_emit_insn (0); if (fld) { @@ -5304,7 +6215,7 @@ md_assemble (char *str) fragP->tc_frag_data.insn = insn.insn; fragP->fr_fix += 2; - /* In original, we don't relax the instruction with label on it, + /* In original, we don't relax the instrucion with label on it, but this may cause some redundant nop16. Therefore, tag this relaxable instruction and relax it carefully. */ if (label) @@ -5314,6 +6225,7 @@ md_assemble (char *str) bfd_putb16 (insn_16, out); else if (insn.opcode->isize == 2) bfd_putb16 (insn.insn, out); + nds32_set_crc (fragP, &insn, out); return; } else if ((verbatim || !relaxing) && optimize && label) @@ -5322,7 +6234,7 @@ md_assemble (char *str) expressionS exp; out = frag_var (rs_machine_dependent, insn.opcode->isize, 0, 0, NULL, 0, NULL); - /* If this instruction is branch target, it is not relaxable. */ + /* If this insturction is branch target, it is not relaxable. */ fragP->tc_frag_data.flag = NDS32_FRAG_LABEL; fragP->tc_frag_data.opcode = insn.opcode; fragP->tc_frag_data.insn = insn.insn; @@ -5343,18 +6255,20 @@ md_assemble (char *str) if (insn.opcode->isize == 4) bfd_putb32 (insn.insn, out); - if (insn.opcode->isize == 2) + else if (insn.opcode->isize == 2) bfd_putb16 (insn.insn, out); dwarf2_emit_insn (insn.opcode->isize); /* Compiler generating code and user assembly pseudo load-store, insert fixup here. */ - pexp = insn.info; + expressionS *pexp = insn.info; fixP = nds32_elf_record_fixup_exp (fragP, str, fld, pexp, out, &insn); /* Build relaxation pattern when relaxing is enable. */ if (relaxing) - nds32_elf_build_relax_relation (fixP, pexp, out, insn.opcode, fragP, fld); + nds32_elf_build_relax_relation (fixP, pexp, out, &insn, fragP, fld, + pseudo_hint); + nds32_set_crc (fragP, &insn, out); } /* md_macro_start */ @@ -5402,7 +6316,7 @@ md_section_align (segT segment, valueT size) { int align = bfd_get_section_alignment (stdoutput, segment); - return ((size + (1 << align) - 1) & -(1 << align)); + return ((size + (1 << align) - 1) & ((valueT) -1 << align)); } /* GAS will call this function when a symbol table lookup fails, before it @@ -5441,6 +6355,7 @@ nds32_calc_branch_offset (segT segment, fragS *fragP, { /* Calculate symbol-to-instruction offset. */ branch_target_address = S_GET_VALUE (branch_symbol) + branch_offset; + /* If the destination symbol is beyond current frag address, STRETCH will take effect to symbol's position. */ if (S_GET_VALUE (branch_symbol) > fragP->fr_address) @@ -5464,31 +6379,31 @@ nds32_convert_to_range_type (long offset) { enum nds32_br_range range_type; - if (-(0x100) <= offset && offset < 0x100) /* 256 bytes */ + if (-(0x100) <= offset && offset < 0x100) /* 256 bytes */ range_type = BR_RANGE_S256; - else if (-(0x4000) <= offset && offset < 0x4000) /* 16K bytes */ + else if (-(0x4000) <= offset && offset < 0x4000) /* 16K bytes */ range_type = BR_RANGE_S16K; - else if (-(0x10000) <= offset && offset < 0x10000) /* 64K bytes */ + else if (-(0x10000) <= offset && offset < 0x10000) /* 64K bytes */ range_type = BR_RANGE_S64K; - else if (-(0x1000000) <= offset && offset < 0x1000000) /* 16M bytes */ + else if (-(0x1000000) <= offset && offset < 0x1000000) /* 16M bytes */ range_type = BR_RANGE_S16M; - else /* 4G bytes */ + else /* 4G bytes */ range_type = BR_RANGE_U4G; return range_type; } -/* Set instruction register mask. */ +/* Set insntruction register mask. */ static void nds32_elf_get_set_cond (relax_info_t *relax_info, int offset, uint32_t *insn, uint32_t ori_insn, int range) { - nds32_cond_field_t *cond_fields = relax_info->cond_field; + nds32_cond_field_t *cond_fields; + cond_fields = relax_info->cond_field; nds32_cond_field_t *code_seq_cond = relax_info->relax_code_condition[range]; uint32_t mask; int i = 0; - /* The instruction has conditions. Collect condition values. */ while (code_seq_cond[i].bitmask != 0) { @@ -5525,24 +6440,45 @@ nds32_relax_branch_instructions (segT segment, fragS *fragP, int insn_size; int code_seq_offset; - /* Replace with gas_assert (fragP->fr_symbol != NULL); */ + /* Replace with gas_assert (fragP->fr_symbol != NULL); */ if (fragP->fr_symbol == NULL) return adjust; - /* If frag_var is not enough room, the previous frag is fr_full and with + /* If frag_var is not enough room, the previos frag is fr_full and with opcode. The new one is rs_dependent but without opcode. */ if (opcode == NULL) return adjust; + /* Use U4G mode for b and bal in verbatim mode because lto may combine + functions into a file. And order the file in the last when linking. + Once there is multiple definition, the same function will be kicked. + This may cause relocation truncated error. */ + if (verbatim && !nds32_pic + && (strcmp (opcode->opcode, "j") == 0 + || strcmp (opcode->opcode, "jal") == 0)) + { + fragP->fr_subtype = BR_RANGE_U4G; + if (init) + return 8; + else + return 0; + } + relax_info = hash_find (nds32_relax_info_hash, opcode->opcode); if (relax_info == NULL) return adjust; if (init) - branch_range_type = relax_info->br_range; + { + branch_range_type = relax_info->br_range; + i = BR_RANGE_S256; + } else - branch_range_type = fragP->fr_subtype; + { + branch_range_type = fragP->fr_subtype; + i = branch_range_type; + } offset = nds32_calc_branch_offset (segment, fragP, stretch, relax_info, branch_range_type); @@ -5551,15 +6487,21 @@ nds32_relax_branch_instructions (segT segment, fragS *fragP, /* If actual range is equal to instruction jump range, do nothing. */ if (real_range_type == branch_range_type) - return adjust; + { + fragP->fr_subtype = real_range_type; + return adjust; + } /* Find out proper relaxation code sequence. */ - for (i = BR_RANGE_S256; i < BR_RANGE_NUM; i++) + for (; i < BR_RANGE_NUM; i++) { if (real_range_type <= (unsigned int) i) { if (init) diff = relax_info->relax_code_size[i] - opcode->isize; + else if (real_range_type < (unsigned int) i) + diff = relax_info->relax_code_size[real_range_type] + - relax_info->relax_code_size[branch_range_type]; else diff = relax_info->relax_code_size[i] - relax_info->relax_code_size[branch_range_type]; @@ -5592,7 +6534,7 @@ nds32_relax_branch_instructions (segT segment, fragS *fragP, } /* Update fr_subtype to new NDS32_BR_RANGE. */ - fragP->fr_subtype = i; + fragP->fr_subtype = real_range_type; break; } } @@ -5631,19 +6573,19 @@ nds32_get_align (addressT address, int align) { addressT mask, new_address; - mask = ~((~0U) << align); + mask = ~((addressT) (~0) << align); new_address = (address + mask) & (~mask); return (new_address - address); } /* Check the prev_frag is legal. */ static void -invalid_prev_frag (fragS * fragP, fragS **prev_frag) +invalid_prev_frag (fragS * fragP, fragS **prev_frag, bfd_boolean relax) { addressT address; fragS *frag_start = *prev_frag; - if (!frag_start) + if (!frag_start || !relax) return; if (frag_start->last_fr_address >= fragP->last_fr_address) @@ -5659,13 +6601,13 @@ invalid_prev_frag (fragS * fragP, fragS **prev_frag) || frag_t->fr_type == rs_align_code || frag_t->fr_type == rs_align_test) { - /* Relax instruction can not walk across label. */ + /* Relax instruction can not walk across lable. */ if (frag_t->tc_frag_data.flag & NDS32_FRAG_LABEL) { prev_frag = NULL; return; } - /* Relax previous relaxable to align rs_align frag. */ + /* Relax previos relaxable to align rs_align frag. */ address = frag_t->fr_address + frag_t->fr_fix; addressT offset = nds32_get_align (address, (int) frag_t->fr_offset); if (offset & 0x2) @@ -5711,7 +6653,7 @@ nds32_relax_frag (segT segment, fragS *fragP, long stretch ATTRIBUTE_UNUSED) static fragS *prev_frag = NULL; int adjust = 0; - invalid_prev_frag (fragP, &prev_frag); + invalid_prev_frag (fragP, &prev_frag, TRUE); if (fragP->tc_frag_data.flag & NDS32_FRAG_BRANCH) adjust = nds32_relax_branch_instructions (segment, fragP, stretch, 0); @@ -5720,8 +6662,8 @@ nds32_relax_frag (segT segment, fragS *fragP, long stretch ATTRIBUTE_UNUSED) if (fragP->tc_frag_data.flag & NDS32_FRAG_RELAXABLE && (fragP->tc_frag_data.flag & NDS32_FRAG_RELAXED) == 0) /* Here is considered relaxed case originally. But it may cause - an endless loop when relaxing. Once the instruction is relaxed, - it can not be undone. */ + unendless loop when relaxing. Once the instruction is relaxed, + it can not be undo. */ prev_frag = fragP; return adjust; @@ -5744,11 +6686,11 @@ md_estimate_size_before_relax (fragS *fragP, segT segment) 1. relax for branch 2. relax for 32-bits to 16-bits */ - /* Save previous relaxable frag. */ + /* Save previos relaxable frag. */ static fragS *prev_frag = NULL; int adjust = 0; - invalid_prev_frag (fragP, &prev_frag); + invalid_prev_frag (fragP, &prev_frag, FALSE); if (fragP->tc_frag_data.flag & NDS32_FRAG_BRANCH) adjust = nds32_relax_branch_instructions (segment, fragP, 0, 1); @@ -5798,12 +6740,14 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragP) nds32_relax_fixup_info_t fixup_info[MAX_RELAX_FIX]; /* Save the 1st instruction is converted to 16 bit or not. */ unsigned int branch_size; + bfd_boolean is_ict_sym; + enum bfd_reloc_code_real final_r_type; - /* Replace with gas_assert (branch_symbol != NULL); */ + /* Replace with gas_assert (branch_symbol != NULL); */ if (branch_symbol == NULL && !(fragP->tc_frag_data.flag & NDS32_FRAG_RELAXED)) return; - /* If frag_var is not enough room, the previous frag is fr_full and with + /* If frag_var is not enough room, the previos frag is fr_full and with opcode. The new one is rs_dependent but without opcode. */ if (opcode == NULL) return; @@ -5872,6 +6816,8 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragP) /* Branch instruction adjust and append relocations. */ relax_info = hash_find (nds32_relax_info_hash, opcode->opcode); + is_ict_sym = fragP->tc_frag_data.flag & NDS32_FRAG_ICT_BRANCH; + if (relax_info == NULL) return; @@ -5902,8 +6848,8 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragP) /* Fill in frag. */ i = 0; k = 0; - offset = 0; /* code_seq offset */ - buf_offset = 0; /* fr_buffer offset */ + offset = 0; /* code_seq offset */ + buf_offset = 0; /* fr_buffer offset */ while (offset < code_size) { insn = code_seq[i]; @@ -5921,7 +6867,7 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragP) origin_insn, branch_range_type); /* Try to convert to 16-bits instruction. Currently, only the first - instruction in pattern can be converted. EX: bnez sethi ori jr, + insntruction in pattern can be converted. EX: bnez sethi ori jr, only bnez can be converted to 16 bit and ori can't. */ while (fixup_info[k].size != 0 @@ -5978,9 +6924,20 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNUSED, segT sec, fragS *fragP) if (fixup_info[i].r_type != 0) { + final_r_type = fixup_info[i].r_type; + + /* Convert reloc type to ICT style if this frag is + handle for ICT symbol. */ + if (is_ict_sym && final_r_type == BFD_RELOC_NDS32_HI20) + final_r_type = BFD_RELOC_NDS32_ICT_HI20; + else if (is_ict_sym && final_r_type == BFD_RELOC_NDS32_LO12S0_ORI) + final_r_type = BFD_RELOC_NDS32_ICT_LO12; + else if (is_ict_sym && fixup_info[i].ramp & NDS32_HINT) + continue; + fixP = fix_new_exp (fragP, fr_where + fixup_info[i].offset, fixup_size, &exp, pcrel, - fixup_info[i].r_type); + final_r_type); fixP->fx_addnumber = fixP->fx_offset; } } @@ -6003,7 +6960,7 @@ nds32_relaxable_section (asection *sec) && strcmp (sec->name, ".eh_frame") != 0); } -/* TC_FORCE_RELOCATION */ +/* TC_FORCE_RELOCATION */ int nds32_force_relocation (fixS * fix) { @@ -6041,8 +6998,8 @@ nds32_force_relocation (fixS * fix) && nds32_relaxable_section (S_GET_SEGMENT (fix->fx_addsy)); case BFD_RELOC_64: if (fix->fx_subsy) - as_bad ("Double word for difference between two symbols " - "is not supported across relaxation."); + as_bad ("Double word for difference between two symbols is not " + "supported across relaxation."); default: ; } @@ -6202,14 +7159,16 @@ nds32_insert_relax_entry (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, fixS *fixp; seginfo = seg_info (sec); + if (symbol_find ("_INDIRECT_CALL_TABLE_BASE_")) + ict_exist = TRUE; if (!seginfo || !symbol_rootP || !subseg_text_p (sec) || sec->size == 0) return; - /* If there is no relocation and relax is disabled, it is not necessary to - insert R_NDS32_RELAX_ENTRY for linker do EX9 or IFC optimization. */ + for (fixp = seginfo->fix_root; fixp; fixp = fixp->fx_next) if (!fixp->fx_done) break; - if (!fixp && !enable_relax_ex9 && !verbatim) + + if (!fixp && !verbatim && (!ict_exist || ict_flag == ICT_NONE)) return; subseg_change (sec, 0); @@ -6217,21 +7176,21 @@ nds32_insert_relax_entry (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, /* Set RELAX_ENTRY flags for linker. */ fragP = seginfo->frchainP->frch_root; exp.X_op = O_symbol; - exp.X_add_symbol = section_symbol (sec); + exp.X_add_symbol = abs_section_sym; exp.X_add_number = 0; if (!enable_relax_relocs) exp.X_add_number |= R_NDS32_RELAX_ENTRY_DISABLE_RELAX_FLAG; else { /* These flags are only enabled when global relax is enabled. - Maybe we can check DISABLE_RELAX_FLAG at link-time, + Maybe we can check DISABLE_RELAX_FLAG at linke-time, so we set them anyway. */ - if (enable_relax_ex9) - exp.X_add_number |= R_NDS32_RELAX_ENTRY_EX9_FLAG; - if (enable_relax_ifc) - exp.X_add_number |= R_NDS32_RELAX_ENTRY_IFC_FLAG; if (verbatim) exp.X_add_number |= R_NDS32_RELAX_ENTRY_VERBATIM_FLAG; + if (ict_exist && ict_flag == ICT_SMALL) + exp.X_add_number |= R_NDS32_RELAX_ENTRY_ICT_SMALL; + else if (ict_exist && ict_flag == ICT_LARGE) + exp.X_add_number |= R_NDS32_RELAX_ENTRY_ICT_LARGE; } if (optimize) exp.X_add_number |= R_NDS32_RELAX_ENTRY_OPTIMIZE_FLAG; @@ -6282,9 +7241,28 @@ nds32_elf_insert_final_frag (void) } } +static void +nds32_create_section_compatible_abi (void) +{ + segT comp_section = subseg_new (".note.v2abi_compatible", 0); + bfd_set_section_flags (stdoutput, comp_section, + SEC_READONLY | SEC_DATA | SEC_EXCLUDE); + + /* Set content to .v2abi_compatible section. */ + now_seg = comp_section; + frag_grow (NDS32_MAXCHAR); + char *out = frag_more (4); + if (compatible_abi) + bfd_putb32 ((bfd_vma) 1, out); + else + bfd_putb32 ((bfd_vma) 0, out); +} + void md_end (void) { + if (compatible_abi) + nds32_create_section_compatible_abi (); nds32_elf_insert_final_frag (); nds32_elf_analysis_relax_hint (); bfd_map_over_sections (stdoutput, nds32_insert_leb128_fixes, NULL); @@ -6390,6 +7368,8 @@ nds32_fix_adjustable (fixS *fixP) case BFD_RELOC_NDS32_LONGJUMP5: case BFD_RELOC_NDS32_LONGJUMP6: case BFD_RELOC_NDS32_LONGJUMP7: + case BFD_RELOC_NDS32_10IFCU_PCREL: + case BFD_RELOC_NDS32_17IFC_PCREL: return 1; default: return 0; @@ -6407,7 +7387,7 @@ elf_nds32_final_processing (void) && !(nds32_elf_flags & (E_NDS32_HAS_FPU_INST | E_NDS32_HAS_FPU_DP_INST))) { /* Since only FPU_COM instructions are used and no other FPU instructions - are used. The nds32_elf_flags will be decided by the enabled options + are used. The nds32_elf_flags will be decided by the enabled options by command line or default configuration. */ if (nds32_fpu_dp_ext || nds32_fpu_sp_ext) { @@ -6430,9 +7410,6 @@ elf_nds32_final_processing (void) nds32_elf_flags |= (nds32_freg << E_NDS32_FPU_REG_CONF_SHIFT); } - if (nds32_pic) - nds32_elf_flags |= E_NDS32_HAS_PIC; - if (nds32_gpr16) nds32_elf_flags |= E_NDS32_HAS_REDUCED_REGS; @@ -6440,7 +7417,7 @@ elf_nds32_final_processing (void) elf_elfheader (stdoutput)->e_flags |= nds32_elf_flags; } -/* Implement md_apply_fix. Apply the fix-up or transform the fix-up for +/* Implement md_apply_fix. Apply the fix-up or tranform the fix-up for later relocation generation. */ void @@ -6463,14 +7440,10 @@ nds32_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) fixP->fx_addnumber = value; fixP->tc_fix_data = NULL; - /* Transform specific relocations here for later relocation generation. - Tag data here for ex9 relaxation and tag tls data for linker. */ + /* Tranform specific relocations here for later relocation generation. + Tag tls data here for linker. */ switch (fixP->fx_r_type) { - case BFD_RELOC_NDS32_DATA: - if (!enable_relax_ex9) - fixP->fx_done = 1; - break; case BFD_RELOC_NDS32_TPOFF: case BFD_RELOC_NDS32_TLS_LE_HI20: case BFD_RELOC_NDS32_TLS_LE_LO12: @@ -6479,6 +7452,12 @@ nds32_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) case BFD_RELOC_NDS32_GOTTPOFF: case BFD_RELOC_NDS32_TLS_IE_HI20: case BFD_RELOC_NDS32_TLS_IE_LO12S2: + case BFD_RELOC_NDS32_TLS_DESC_HI20: + case BFD_RELOC_NDS32_TLS_DESC_LO12: + case BFD_RELOC_NDS32_TLS_IE_LO12: + case BFD_RELOC_NDS32_TLS_IEGP_HI20: + case BFD_RELOC_NDS32_TLS_IEGP_LO12: + case BFD_RELOC_NDS32_TLS_IEGP_LO12S2: S_SET_THREAD_LOCAL (fixP->fx_addsy); break; default: @@ -6519,7 +7498,7 @@ nds32_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) ---- 8< ---- 8< ---- 8< ---- 8< ---- We use a single relocation entry for this expression. - * The initial distance value is stored directly in that location + * The initial distance value is stored direcly in that location specified by r_offset (i.e., foo in this example.) * The begin of the region, i.e., .LBEGIN, is specified by r_info/R_SYM and r_addend, e.g., .text + 0x32. @@ -6605,7 +7584,6 @@ nds32_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) break; case BFD_RELOC_64: md_number_to_chars (where, value, 8); - break; default: as_bad_where (fixP->fx_file, fixP->fx_line, _("Internal error: Unknown fixup type %d (`%s')"), @@ -6624,9 +7602,9 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP) arelent *reloc; bfd_reloc_code_real_type code; - reloc = XNEW (arelent); + reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = XNEW (asymbol *); + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy); reloc->address = fixP->fx_frag->fr_address + fixP->fx_where; @@ -6661,13 +7639,15 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP) return reloc; } -struct suffix_name suffix_table[] = +static struct suffix_name suffix_table[] = { - {"GOTOFF", BFD_RELOC_NDS32_GOTOFF, 1}, - {"GOT", BFD_RELOC_NDS32_GOT20, 1}, - {"TPOFF", BFD_RELOC_NDS32_TPOFF, 0}, - {"PLT", BFD_RELOC_NDS32_25_PLTREL, 1}, - {"GOTTPOFF", BFD_RELOC_NDS32_GOTTPOFF, 0} + {"GOTOFF", BFD_RELOC_NDS32_GOTOFF}, + {"GOT", BFD_RELOC_NDS32_GOT20}, + {"TPOFF", BFD_RELOC_NDS32_TPOFF}, + {"PLT", BFD_RELOC_NDS32_25_PLTREL}, + {"GOTTPOFF", BFD_RELOC_NDS32_GOTTPOFF}, + {"TLSDESC", BFD_RELOC_NDS32_TLS_DESC}, + {"ICT", BFD_RELOC_NDS32_ICT} }; /* Implement md_parse_name. */ @@ -6686,9 +7666,9 @@ nds32_parse_name (char const *name, expressionS *exprP, exprP->X_op = O_symbol; exprP->X_add_number = 0; - /* Check the special name if a symbol. */ + /* Check the specail name if a symbol. */ segment = S_GET_SEGMENT (exprP->X_add_symbol); - if (segment != undefined_section) + if ((segment != undefined_section) && (*nextcharP != '@')) return 0; if (strcmp (name, GOT_NAME) == 0 && *nextcharP != '@') @@ -6702,13 +7682,11 @@ nds32_parse_name (char const *name, expressionS *exprP, char *next; for (i = 0; i < ARRAY_SIZE (suffix_table); i++) { - next = input_line_pointer + 1 + strlen(suffix_table[i].suffix); + next = input_line_pointer + 1 + strlen (suffix_table[i].suffix); if (strncasecmp (input_line_pointer + 1, suffix_table[i].suffix, strlen (suffix_table[i].suffix)) == 0 && !is_part_of_name (*next)) { - if (!nds32_pic && suffix_table[i].pic) - as_bad (_("need PIC qualifier with symbol.")); exprP->X_md = suffix_table[i].reloc; *input_line_pointer = *nextcharP; input_line_pointer = next; @@ -6718,6 +7696,10 @@ nds32_parse_name (char const *name, expressionS *exprP, } } } + + if (exprP->X_md == BFD_RELOC_NDS32_ICT) + ict_exist = TRUE; + return 1; } diff --git a/gas/config/tc-nds32.h b/gas/config/tc-nds32.h index 178ca4e..bcea94a 100644 --- a/gas/config/tc-nds32.h +++ b/gas/config/tc-nds32.h @@ -24,13 +24,28 @@ #include "bfd_stdint.h" +/* Enum mapping symbol. */ +enum mstate +{ + MAP_UNDEFINED = 0, /* Must be zero, for seginfo in new sections. */ + MAP_DATA, + MAP_CODE, +}; +#define TC_SEGMENT_INFO_TYPE struct nds32_segment_info_type + +/* For mapping symbol. */ +struct nds32_segment_info_type +{ + enum mstate mapstate; +}; + #define LISTING_HEADER \ (target_big_endian ? "NDS32 GAS" : "NDS32 GAS Little Endian") /* The target BFD architecture. */ #define TARGET_ARCH bfd_arch_nds32 -/* mapping to mach_table[5] */ +/* mapping to mach_table[5] */ #define ISA_V1 bfd_mach_n1h #define ISA_V2 bfd_mach_n1h_v2 #define ISA_V3 bfd_mach_n1h_v3 @@ -42,29 +57,28 @@ #define TARGET_BYTES_BIG_ENDIAN 1 #endif -/* as.c. */ -/* Extend GAS command line option handling capability. */ +/* as.c */ +/* Extend GAS command line option handling capability */ extern int nds32_parse_option (int, const char *); extern void nds32_after_parse_args (void); /* The endianness of the target format may change based on command line arguments. */ -extern const char * nds32_target_format (void); - +extern const char *nds32_target_format (void); #define md_parse_option(optc, optarg) nds32_parse_option (optc, optarg) #define md_after_parse_args() nds32_after_parse_args () #define TARGET_FORMAT nds32_target_format() -/* expr.c */ +/* expr.c */ extern int nds32_parse_name (char const *, expressionS *, enum expr_mode, char *); extern bfd_boolean nds32_allow_local_subtract (expressionS *, expressionS *, segT); #define md_parse_name(name, exprP, mode, nextcharP) \ nds32_parse_name (name, exprP, mode, nextcharP) #define md_allow_local_subtract(lhs,rhs,sect) nds32_allow_local_subtract (lhs, rhs, sect) -/* dwarf2dbg.c. */ +/* dwarf2dbg.c */ #define DWARF2_USE_FIXED_ADVANCE_PC 1 -/* write.c. */ +/* write.c */ extern long nds32_pcrel_from_section (struct fix *, segT); extern bfd_boolean nds32_fix_adjustable (struct fix *); extern void nds32_frob_file (void); @@ -73,14 +87,13 @@ extern void nds32_frob_file_before_fix (void); extern void elf_nds32_final_processing (void); extern int nds32_validate_fix_sub (struct fix *, segT); extern int nds32_force_relocation (struct fix *); -extern void nds32_set_section_relocs (asection *, arelent ** , unsigned int); +extern void nds32_set_section_relocs (asection *, arelent **, unsigned int); /* Fill in rs_align_code fragments. TODO: Review this. */ extern void nds32_handle_align (fragS *); extern int nds32_relax_frag (segT, fragS *, long); extern int tc_nds32_regname_to_dw2regnum (char *); extern void tc_nds32_frame_initial_instructions (void); - #define MD_PCREL_FROM_SECTION(fix, sect) nds32_pcrel_from_section (fix, sect) #define TC_FINALIZE_SYMS_BEFORE_SIZE_SEG 0 #define tc_fix_adjustable(FIX) nds32_fix_adjustable (FIX) @@ -103,7 +116,7 @@ extern void tc_nds32_frame_initial_instructions (void); #define md_relax_frag(segment, fragP, stretch) nds32_relax_frag (segment, fragP, stretch) #define WORKING_DOT_WORD /* We don't need to handle .word strangely. */ /* Using to chain fixup with previous fixup. */ -#define TC_FIX_TYPE struct fix * +#define TC_FIX_TYPE struct fix* #define TC_INIT_FIX_DATA(fixP) \ do \ { \ @@ -111,8 +124,8 @@ extern void tc_nds32_frame_initial_instructions (void); } \ while (0) -/* read.c. */ -/* Extend GAS macro handling capability. */ +/* read.c */ +/* Extend GAS macro handling capability */ extern void nds32_macro_start (void); extern void nds32_macro_end (void); extern void nds32_macro_info (void *); @@ -128,7 +141,6 @@ extern void nds32_check_label (symbolS *); extern void nds32_frob_label (symbolS *); extern void nds32_pre_do_align (int, char *, int, int); extern void nds32_do_align (int); - #define md_macro_start() nds32_macro_start () #define md_macro_end() nds32_macro_end () #define md_macro_info(args) nds32_macro_info (args) @@ -143,7 +155,7 @@ extern void nds32_do_align (int); #define md_do_align(N, FILL, LEN, MAX, LABEL) \ nds32_pre_do_align (N, FILL, LEN, MAX); \ if ((N) > 1 && (subseg_text_p (now_seg) \ - || strncmp (now_seg->name, ".gcc_except_table", sizeof(".gcc_except_table") - 1) == 0)) \ + || strncmp (now_seg->name, ".gcc_except_table", sizeof (".gcc_except_table") - 1) == 0)) \ nds32_do_align (N); \ goto LABEL; #define md_elf_section_change_hook() nds32_elf_section_change_hook () @@ -151,7 +163,7 @@ extern void nds32_do_align (int); #define md_cleanup() nds32_cleanup () #define LOCAL_LABELS_FB 1 /* Permit temporary numeric labels. */ -/* frags.c. */ +/* frags.c */ enum FRAG_ATTR { @@ -161,7 +173,8 @@ enum FRAG_ATTR NDS32_FRAG_LABEL = 0x8, NDS32_FRAG_FINAL = 0x10, NDS32_FRAG_RELAXABLE_BRANCH = 0x20, - NDS32_FRAG_ALIGN = 0x40 + NDS32_FRAG_ALIGN = 0x40, + NDS32_FRAG_ICT_BRANCH = 0x80 }; struct nds32_frag_type @@ -231,7 +244,11 @@ enum nds32_ramp NDS32_FIX = (1 << 7), NDS32_ADDEND = (1 << 8), NDS32_SYM = (1 << 9), - NDS32_PCREL = (1 << 10) + NDS32_PCREL = (1 << 10), + NDS32_PTR_PATTERN = (1 << 11), + NDS32_PTR_MULTIPLE = (1 << 12), + NDS32_GROUP = (1 << 13), + NDS32_SYM_DESC_MEM = (1 << 14) }; typedef struct nds32_relax_fixup_info @@ -255,7 +272,7 @@ typedef struct nds32_cond_field #define NDS32_MAXCHAR 20 /* In current, the max extended number of instruction for one pseudo instruction is 4, but its number of relocation may be 12. */ -#define MAX_RELAX_NUM 4 +#define MAX_RELAX_NUM 6 #define MAX_RELAX_FIX 12 typedef struct nds32_relax_info @@ -275,8 +292,18 @@ typedef struct nds32_relax_info enum nds32_relax_hint_type { NDS32_RELAX_HINT_NONE = 0, - NDS32_RELAX_HINT_LA, - NDS32_RELAX_HINT_LS + NDS32_RELAX_HINT_LA_FLSI, + NDS32_RELAX_HINT_LALS, + NDS32_RELAX_HINT_LA_PLT, + NDS32_RELAX_HINT_LA_GOT, + NDS32_RELAX_HINT_LA_GOTOFF, + NDS32_RELAX_HINT_TLS_START = 0x100, + NDS32_RELAX_HINT_TLS_LE_LS, + NDS32_RELAX_HINT_TLS_IE_LS, + NDS32_RELAX_HINT_TLS_IE_LA, + NDS32_RELAX_HINT_TLS_IEGP_LA, + NDS32_RELAX_HINT_TLS_DESC_LS, + NDS32_RELAX_HINT_ICT_LA, }; struct nds32_relax_hint_table @@ -287,4 +314,4 @@ struct nds32_relax_hint_table nds32_relax_fixup_info_t relax_fixup[MAX_RELAX_FIX]; }; -#endif /* TC_NDS32 */ +#endif /* TC_NDS32 */ diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 35da05c..f63003b 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -2747,7 +2747,7 @@ md_assemble (char *str) struct ppc_fixup fixups[MAX_INSN_FIXUPS]; int fc; char *f; - int addr_mod; + int addr_mask; int i; unsigned int insn_length; @@ -3520,31 +3520,34 @@ md_assemble (char *str) #endif /* Write out the instruction. */ - /* Differentiate between two and four byte insns. */ + + addr_mask = 3; if ((ppc_cpu & PPC_OPCODE_VLE) != 0) + /* All instructions can start on a 2 byte boundary for VLE. */ + addr_mask = 1; + + if (frag_now->insn_addr != addr_mask) { - if (PPC_OP_SE_VLE (insn)) - insn_length = 2; - else - insn_length = 4; - addr_mod = frag_now_fix () & 1; - } - else - { - insn_length = 4; - addr_mod = frag_now_fix () & 3; + /* Don't emit instructions to a frag started for data, or for a + CPU differing in VLE mode. Data is allowed to be misaligned, + and it's possible to start a new frag in the middle of + misaligned data. */ + frag_wane (frag_now); + frag_new (0); } - /* All instructions can start on a 2 byte boundary for VLE. */ + + /* Check that insns within the frag are aligned. ppc_frag_check + will ensure that the frag start address is aligned. */ + if ((frag_now_fix () & addr_mask) != 0) + as_bad (_("instruction address is not a multiple of %d"), addr_mask + 1); + + /* Differentiate between two and four byte insns. */ + insn_length = 4; + if ((ppc_cpu & PPC_OPCODE_VLE) != 0 && PPC_OP_SE_VLE (insn)) + insn_length = 2; + f = frag_more (insn_length); - if (frag_now->has_code && frag_now->insn_addr != addr_mod) - { - if ((ppc_cpu & PPC_OPCODE_VLE) != 0) - as_bad (_("instruction address is not a multiple of 2")); - else - as_bad (_("instruction address is not a multiple of 4")); - } - frag_now->insn_addr = addr_mod; - frag_now->has_code = 1; + frag_now->insn_addr = addr_mask; md_number_to_chars (f, insn, insn_length); last_insn = insn; last_seg = now_seg; @@ -6491,19 +6494,10 @@ ppc_fix_adjustable (fixS *fix) void ppc_frag_check (struct frag *fragP) { - if (!fragP->has_code) - return; - - if ((ppc_cpu & PPC_OPCODE_VLE) != 0) - { - if (((fragP->fr_address + fragP->insn_addr) & 1) != 0) - as_bad (_("instruction address is not a multiple of 2")); - } - else - { - if (((fragP->fr_address + fragP->insn_addr) & 3) != 0) - as_bad (_("instruction address is not a multiple of 4")); - } + if ((fragP->fr_address & fragP->insn_addr) != 0) + as_bad_where (fragP->fr_file, fragP->fr_line, + _("instruction address is not a multiple of %d"), + fragP->insn_addr + 1); } /* Implement HANDLE_ALIGN. This writes the NOP pattern into an diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index f60bea1..f1bc7f9 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -570,6 +570,7 @@ validate_riscv_insn (const struct riscv_opcode *opc) case 'p': used_bits |= ENCODE_SBTYPE_IMM (-1U); break; case 'q': used_bits |= ENCODE_STYPE_IMM (-1U); break; case 'u': used_bits |= ENCODE_UTYPE_IMM (-1U); break; + case 'z': break; case '[': break; case ']': break; case '0': break; @@ -1190,14 +1191,14 @@ my_getSmallExpression (expressionS *ep, bfd_reloc_code_real_type *reloc, an implicit offset was detected. */ static bfd_boolean -riscv_handle_implicit_zero_offset (expressionS *expr, const char *s) +riscv_handle_implicit_zero_offset (expressionS *ep, const char *s) { /* Check whether there is only a single bracketed expression left. If so, it must be the base register and the constant must be zero. */ if (*s == '(' && strchr (s + 1, '(') == 0) { - expr->X_op = O_constant; - expr->X_add_number = 0; + ep->X_op = O_constant; + ep->X_add_number = 0; return TRUE; } @@ -1712,6 +1713,15 @@ jump: *imm_reloc = BFD_RELOC_RISCV_CALL; continue; + case 'z': + if (my_getSmallExpression (imm_expr, imm_reloc, s, p) + || imm_expr->X_op != O_constant + || imm_expr->X_add_number != 0) + break; + s = expr_end; + imm_expr->X_op = O_absent; + continue; + default: as_fatal (_("internal error: bad argument type %c"), *args); } diff --git a/gas/config/tc-rx.c b/gas/config/tc-rx.c index 8e49ddd..6c8befe 100644 --- a/gas/config/tc-rx.c +++ b/gas/config/tc-rx.c @@ -2681,6 +2681,7 @@ rx_start_line (void) int in_single_quote = 0; int done = 0; char * p = input_line_pointer; + char prev_char = 0; /* Scan the line looking for question marks. Skip past quote enclosed regions. */ do @@ -2693,7 +2694,9 @@ rx_start_line (void) break; case '"': - in_double_quote = ! in_double_quote; + /* Handle escaped double quote \" inside a string. */ + if (prev_char != '\\') + in_double_quote = ! in_double_quote; break; case '\'': @@ -2722,7 +2725,7 @@ rx_start_line (void) break; } - p ++; + prev_char = *p++; } while (! done); } diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 69a8e52..c21192a 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -325,6 +325,19 @@ init_default_arch (void) default_arch_type = sa->arch_type; } +/* Called by TARGET_MACH. */ + +unsigned long +sparc_mach (void) +{ + /* We don't get a chance to initialize anything before we're called, + so handle that now. */ + if (! default_init_p) + init_default_arch (); + + return sparc_arch_size == 64 ? bfd_mach_sparc_v9 : bfd_mach_sparc; +} + /* Called by TARGET_FORMAT. */ const char * @@ -1148,7 +1161,7 @@ md_begin (void) void sparc_md_end (void) { - unsigned long mach = bfd_mach_sparc; + unsigned long mach; #if defined(OBJ_ELF) && !defined(TE_SOLARIS) int hwcaps, hwcaps2; #endif @@ -1182,7 +1195,7 @@ sparc_md_end (void) /* The sparclite is treated like a normal sparc. Perhaps it shouldn't be but for now it is (since that's the way it's always been treated). */ - default: break; + default: mach = bfd_mach_sparc; break; } bfd_set_arch_mach (stdoutput, bfd_arch_sparc, mach); diff --git a/gas/config/tc-sparc.h b/gas/config/tc-sparc.h index 7ff7613..e3db1fb 100644 --- a/gas/config/tc-sparc.h +++ b/gas/config/tc-sparc.h @@ -30,6 +30,9 @@ struct frag; #define TARGET_ARCH bfd_arch_sparc +extern unsigned long sparc_mach (void); +#define TARGET_MACH sparc_mach () + #ifdef TE_FreeBSD #define ELF_TARGET_FORMAT "elf32-sparc" #define ELF64_TARGET_FORMAT "elf64-sparc-freebsd" diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 58c2e10..4db7ef5 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -438,6 +438,7 @@ struct litpool_frag addressT addr; short priority; /* 1, 2, or 3 -- 1 is highest */ short original_priority; + int literal_count; }; /* Map a segment to its litpool_frag list. */ @@ -451,6 +452,14 @@ struct litpool_seg static struct litpool_seg litpool_seg_list; +/* Limit maximal size of auto litpool by half of the j range. */ +#define MAX_AUTO_POOL_LITERALS 16384 + +/* Limit maximal size of explicit literal pool by l32r range. */ +#define MAX_EXPLICIT_POOL_LITERALS 65536 + +#define MAX_POOL_LITERALS \ + (auto_litpools ? MAX_AUTO_POOL_LITERALS : MAX_EXPLICIT_POOL_LITERALS) /* Directive functions. */ @@ -488,7 +497,7 @@ static int init_trampoline_frag (fragS *); static fixS *xg_append_jump (fragS *fragP, symbolS *sym, offsetT offset); static void xtensa_maybe_create_literal_pool_frag (bfd_boolean, bfd_boolean); static bfd_boolean auto_litpools = FALSE; -static int auto_litpool_limit = 10000; +static int auto_litpool_limit = 0; /* Alignment Functions. */ @@ -984,6 +993,8 @@ md_parse_option (int c, const char *arg) case option_auto_litpools: auto_litpools = TRUE; use_literal_section = FALSE; + if (auto_litpool_limit <= 0) + auto_litpool_limit = MAX_AUTO_POOL_LITERALS / 2; return 1; case option_no_auto_litpools: @@ -7912,6 +7923,7 @@ xtensa_maybe_create_literal_pool_frag (bfd_boolean create, lpf->fragP = fragP; lpf->priority = (needed) ? (only_if_needed) ? 3 : 2 : 1; lpf->original_priority = lpf->priority; + lpf->literal_count = 0; lps->frag_count = 0; } @@ -9339,6 +9351,12 @@ static size_t xg_find_best_trampoline (struct trampoline_index *idx, trampoline_frag->fr_address > target)) continue; + /* Don't choose trampoline that contains the source. */ + if (source >= trampoline_frag->fr_address + && source <= trampoline_frag->fr_address + + trampoline_frag->fr_fix) + continue; + off = trampoline_frag->fr_address - fulcrum; /* Stop if some trampoline is found and the search is more than J_RANGE / 4 from the projected fulcrum. A trampoline w/o jump @@ -11182,6 +11200,66 @@ xg_promote_candidate_litpool (struct litpool_seg *lps, /* Rest is done in xtensa_relax_frag. */ } +static struct litpool_frag *xg_find_litpool (struct litpool_seg *lps, + struct litpool_frag *lpf, + addressT addr) +{ + struct litpool_frag *lp = lpf->prev; + + gas_assert (lp->fragP); + + while (lp->fragP->fr_subtype == RELAX_LITERAL_POOL_CANDIDATE_BEGIN) + { + lp = lp->prev; + if (lp->fragP == NULL) + { + /* End of list; have to bite the bullet. + Take the nearest. */ + lp = lpf->prev; + break; + } + /* Does it (conservatively) reach? */ + if (addr - lp->addr <= 128 * 1024) + { + if (lp->fragP->fr_subtype == RELAX_LITERAL_POOL_BEGIN && + lp->literal_count < MAX_POOL_LITERALS) + { + /* Found a good one. */ + break; + } + else if (lp->prev->fragP && + addr - lp->prev->addr > 128 * 1024 && + lp->prev->literal_count < MAX_POOL_LITERALS) + { + /* This is still a "candidate" but the next one + will be too far away, so revert to the nearest + one, convert it and add the jump around. */ + lp = lpf->prev; + break; + } + } + } + + if (lp->literal_count >= MAX_POOL_LITERALS) + { + lp = lpf->prev; + while (lp && lp->fragP && lp->literal_count >= MAX_POOL_LITERALS) + { + lp = lp->prev; + } + gas_assert (lp); + } + + gas_assert (lp && lp->fragP && lp->literal_count < MAX_POOL_LITERALS); + ++lp->literal_count; + + /* Convert candidate and add the jump around. */ + if (lp->fragP->fr_subtype == RELAX_LITERAL_POOL_CANDIDATE_BEGIN) + xg_promote_candidate_litpool (lps, lp); + + return lp; +} + static void xtensa_move_literals (void) { @@ -11239,49 +11317,12 @@ xtensa_move_literals (void) preferring non-"candidate" positions to avoid the jump-around. */ fragS *litfrag = fragP->tc_frag_data.literal_frags[slot]; - struct litpool_frag *lp = lpf->prev; - if (!lp->fragP) - { - break; - } - while (lp->fragP->fr_subtype == - RELAX_LITERAL_POOL_CANDIDATE_BEGIN) - { - lp = lp->prev; - if (lp->fragP == NULL) - { - /* End of list; have to bite the bullet. - Take the nearest. */ - lp = lpf->prev; - break; - } - /* Does it (conservatively) reach? */ - if (addr - lp->addr <= 128 * 1024) - { - if (lp->fragP->fr_subtype == RELAX_LITERAL_POOL_BEGIN) - { - /* Found a good one. */ - break; - } - else if (lp->prev->fragP && - addr - lp->prev->addr > 128 * 1024) - { - /* This is still a "candidate" but the next one - will be too far away, so revert to the nearest - one, convert it and add the jump around. */ - lp = lpf->prev; - break; - } - } - } - /* Convert candidate and add the jump around. */ - if (lp->fragP->fr_subtype == - RELAX_LITERAL_POOL_CANDIDATE_BEGIN) - xg_promote_candidate_litpool (lps, lp); - - if (! litfrag->tc_frag_data.literal_frag) + if (!litfrag->tc_frag_data.literal_frag) { + struct litpool_frag *lp; + + lp = xg_find_litpool (lps, lpf, addr); /* Take earliest use of this literal to avoid forward refs. */ litfrag->tc_frag_data.literal_frag = lp->fragP; diff --git a/gas/configure b/gas/configure index 0d54225..a5d4a44 100755 --- a/gas/configure +++ b/gas/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for gas 2.30. +# Generated by GNU Autoconf 2.64 for gas 2.30.51. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software @@ -556,8 +556,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gas' PACKAGE_TARNAME='gas' -PACKAGE_VERSION='2.30' -PACKAGE_STRING='gas 2.30' +PACKAGE_VERSION='2.30.51' +PACKAGE_STRING='gas 2.30.51' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1330,7 +1330,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gas 2.30 to adapt to many kinds of systems. +\`configure' configures gas 2.30.51 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1401,7 +1401,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gas 2.30:";; + short | recursive ) echo "Configuration of gas 2.30.51:";; esac cat <<\_ACEOF @@ -1523,7 +1523,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gas configure 2.30 +gas configure 2.30.51 generated by GNU Autoconf 2.64 Copyright (C) 2009 Free Software Foundation, Inc. @@ -1933,7 +1933,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gas $as_me 2.30, which was +It was created by gas $as_me 2.30.51, which was generated by GNU Autoconf 2.64. Invocation command line was $ $0 $@ @@ -3742,7 +3742,7 @@ fi # Define the identity of the package. PACKAGE='gas' - VERSION='2.30' + VERSION='2.30.51' cat >>confdefs.h <<_ACEOF @@ -12491,6 +12491,11 @@ _ACEOF ;; nds32) + # setup NDS32_LINUX_TOOLCHAIN definition + if test "linux" = $em; then +$as_echo "#define NDS32_LINUX_TOOLCHAIN 1" >>confdefs.h + fi + # Decide BASELINE, REDUCED_REGS, FPU_DP_EXT, FPU_SP_EXT features # based on arch_name. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default configuration of --with-arch" >&5 @@ -12582,6 +12587,34 @@ $as_echo "#define NDS32_DEFAULT_AUDIO_EXT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_audio_ext" >&5 $as_echo "$enable_audio_ext" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for default configuration of --enable-dsp-ext" >&5 +$as_echo_n "checking for default configuration of --enable-dsp-ext... " >&6; } + if test "x${enable_dsp_ext}" == xno; then + +$as_echo "#define NDS32_DEFAULT_DSP_EXT 0" >>confdefs.h + + else + +$as_echo "#define NDS32_DEFAULT_DSP_EXT 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dsp_ext" >&5 +$as_echo "$enable_dsp_ext" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for default configuration of --enable-zol-ext" >&5 +$as_echo_n "checking for default configuration of --enable-zol-ext... " >&6; } + if test "x${enable_zol_ext}" == xno; then + +$as_echo "#define NDS32_DEFAULT_ZOL_EXT 0" >>confdefs.h + + else + +$as_echo "#define NDS32_DEFAULT_ZOL_EXT 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_zol_ext" >&5 +$as_echo "$enable_zol_ext" >&6; } ;; aarch64 | i386 | riscv | s390 | sparc) @@ -13165,7 +13198,7 @@ if test "$LEX" = :; then LEX=${am_missing_run}flex fi -ALL_LINGUAS="fr tr es rw id ru fi ja zh_CN sv" +ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN" # If we haven't got the data from the intl directory, # assume NLS is disabled. USE_NLS=no @@ -15224,7 +15257,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gas $as_me 2.30, which was +This file was extended by gas $as_me 2.30.51, which was generated by GNU Autoconf 2.64. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15288,7 +15321,7 @@ Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -gas config.status 2.30 +gas config.status 2.30.51 configured by $0, generated by GNU Autoconf 2.64, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/gas/configure.ac b/gas/configure.ac index 043b5c8..3b0279a 100644 --- a/gas/configure.ac +++ b/gas/configure.ac @@ -797,7 +797,7 @@ AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.]) AC_PROG_YACC AM_PROG_LEX -ALL_LINGUAS="fr tr es rw id ru fi ja zh_CN sv" +ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN" ZW_GNU_GETTEXT_SISTER_DIR AM_PO_SUBDIRS diff --git a/gas/configure.tgt b/gas/configure.tgt index afe4e06..6455fbb 100644 --- a/gas/configure.tgt +++ b/gas/configure.tgt @@ -345,12 +345,13 @@ case ${generic_target} in mips*-*-linux*) fmt=elf em=tmips ;; mips*-*-freebsd* | mips*-*-kfreebsd*-gnu) fmt=elf em=freebsd ;; - mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;; + mips-*-sysv4* | mips-*-gnu*) fmt=elf em=tmips ;; mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*) fmt=elf em=tmips ;; mips-*-elf*) fmt=elf ;; mips-*-netbsd*) fmt=elf em=tmips ;; mips-*-openbsd*) fmt=elf em=tmips ;; + mips-*-windiss) fmt=elf ;; mmix-*-*) fmt=elf ;; diff --git a/gas/doc/as.texinfo b/gas/doc/as.texinfo index f4e0fdd..f56515e 100644 --- a/gas/doc/as.texinfo +++ b/gas/doc/as.texinfo @@ -4404,6 +4404,9 @@ Some machine configurations provide additional directives. * CFI directives:: @code{.cfi_startproc [simple]}, @code{.cfi_endproc}, etc. * Comm:: @code{.comm @var{symbol} , @var{length} } * Data:: @code{.data @var{subsection}} +* Dc:: @code{.dc[@var{size}] @var{expressions}} +* Dcb:: @code{.dcb[@var{size}] @var{number} [,@var{fill}]} +* Ds:: @code{.ds[@var{size}] @var{number} [,@var{fill}]} @ifset COFF * Def:: @code{.def @var{name}} @end ifset @@ -4479,6 +4482,7 @@ Some machine configurations provide additional directives. * MRI:: @code{.mri @var{val}} * Noaltmacro:: @code{.noaltmacro} * Nolist:: @code{.nolist} +* Nops:: @code{.nops @var{size}[, @var{control}]} * Octa:: @code{.octa @var{bignums}} * Offset:: @code{.offset @var{loc}} * Org:: @code{.org @var{new-lc}, @var{fill}} @@ -4517,12 +4521,12 @@ Some machine configurations provide additional directives. * Size:: @code{.size [@var{name} , @var{expression}]} @end ifset @ifclear no-space-dir -* Skip:: @code{.skip @var{size} , @var{fill}} +* Skip:: @code{.skip @var{size} [,@var{fill}]} @end ifclear * Sleb128:: @code{.sleb128 @var{expressions}} @ifclear no-space-dir -* Space:: @code{.space @var{size} , @var{fill}} +* Space:: @code{.space @var{size} [,@var{fill}]} @end ifclear @ifset have-stabs * Stab:: @code{.stabd, .stabn, .stabs} @@ -5049,13 +5053,107 @@ The syntax for @code{.comm} differs slightly on the HPPA. The syntax is @node Data @section @code{.data @var{subsection}} - @cindex @code{data} directive + @code{.data} tells @command{@value{AS}} to assemble the following statements onto the end of the data subsection numbered @var{subsection} (which is an absolute expression). If @var{subsection} is omitted, it defaults to zero. +@node Dc +@section @code{.dc[@var{size}] @var{expressions}} +@cindex @code{dc} directive + +The @code{.dc} directive expects zero or more @var{expressions} separated by +commas. These expressions are evaluated and their values inserted into the +current section. The size of the emitted value depends upon the suffix to the +@code{.dc} directive: + +@table @code +@item @samp{.a} +Emits N-bit values, where N is the size of an address on the target system. +@item @samp{.b} +Emits 8-bit values. +@item @samp{.d} +Emits double precision floating-point values. +@item @samp{.l} +Emits 32-bit values. +@item @samp{.s} +Emits single precision floating-point values. +@item @samp{.w} +Emits 16-bit values. +Note - this is true even on targets where the @code{.word} directive would emit +32-bit values. +@item @samp{.x} +Emits long double precision floating-point values. +@end table + +If no suffix is used then @samp{.w} is assumed. + +The byte ordering is target dependent, as is the size and format of floating +point values. + +@node Dcb +@section @code{.dcb[@var{size}] @var{number} [,@var{fill}]} +@cindex @code{dcb} directive +This directive emits @var{number} copies of @var{fill}, each of @var{size} +bytes. Both @var{number} and @var{fill} are absolute expressions. If the +comma and @var{fill} are omitted, @var{fill} is assumed to be zero. The +@var{size} suffix, if present, must be one of: + +@table @code +@item @samp{.b} +Emits single byte values. +@item @samp{.d} +Emits double-precision floating point values. +@item @samp{.l} +Emits 4-byte values. +@item @samp{.s} +Emits single-precision floating point values. +@item @samp{.w} +Emits 2-byte values. +@item @samp{.x} +Emits long double-precision floating point values. +@end table + +If the @var{size} suffix is omitted then @samp{.w} is assumed. + +The byte ordering is target dependent, as is the size and format of floating +point values. + +@node Ds +@section @code{.ds[@var{size}] @var{number} [,@var{fill}]} +@cindex @code{ds} directive +This directive emits @var{number} copies of @var{fill}, each of @var{size} +bytes. Both @var{number} and @var{fill} are absolute expressions. If the +comma and @var{fill} are omitted, @var{fill} is assumed to be zero. The +@var{size} suffix, if present, must be one of: + +@table @code +@item @samp{.b} +Emits single byte values. +@item @samp{.d} +Emits 8-byte values. +@item @samp{.l} +Emits 4-byte values. +@item @samp{.p} +Emits 12-byte values. +@item @samp{.s} +Emits 4-byte values. +@item @samp{.w} +Emits 2-byte values. +@item @samp{.x} +Emits 12-byte values. +@end table + +Note - unlike the @code{.dcb} directive the @samp{.d}, @samp{.s} and @samp{.x} +suffixes do not indicate that floating-point values are to be inserted. + +If the @var{size} suffix is omitted then @samp{.w} is assumed. + +The byte ordering is target dependent. + + @ifset COFF @node Def @section @code{.def @var{name}} @@ -6101,6 +6199,23 @@ internal counter (which is zero initially). @code{.list} increments the counter, and @code{.nolist} decrements it. Assembly listings are generated whenever the counter is greater than zero. +@node Nops +@section @code{.nops @var{size}[, @var{control}]} + +@cindex @code{nops} directive +@cindex filling memory with no-op instructions +This directive emits @var{size} bytes filled with no-op instructions. +@var{size} is absolute expression, which must be a positve value. +@var{control} controls how no-op instructions should be generated. If +the comma and @var{control} are omitted, @var{control} is assumed to be +zero. + +Note: For Intel 80386 and AMD x86-64 targets, @var{control} specifies +the size limit of a no-op instruction. The valid values of @var{control} +are between 0 and 8 for 16-bit mode, between 0 and 10 for 32-bit mode, +between 0 and 11 for 64-bit mode. When 0 is used, the no-op instruction +size limit is set to the maximum supported size. + @node Octa @section @code{.octa @var{bignums}} @@ -6813,7 +6928,7 @@ symbols. @ifclear no-space-dir @node Skip -@section @code{.skip @var{size} , @var{fill}} +@section @code{.skip @var{size} [,@var{fill}]} @cindex @code{skip} directive @cindex filling memory @@ -6833,7 +6948,7 @@ symbolic debugging format. @xref{Uleb128, ,@code{.uleb128}}. @ifclear no-space-dir @node Space -@section @code{.space @var{size} , @var{fill}} +@section @code{.space @var{size} [,@var{fill}]} @cindex @code{space} directive @cindex filling memory diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi index ec0f544..f67696f 100644 --- a/gas/doc/c-arm.texi +++ b/gas/doc/c-arm.texi @@ -631,7 +631,7 @@ extensions. @item .arch_extension @var{name} Add or remove an architecture extension to the target architecture. Valid values for @var{name} are the same as those accepted as architectural -extensions by the @option{-mcpu} commandline option. +extensions by the @option{-mcpu} and @option{-march} commandline options. @code{.arch_extension} may be used multiple times to add or remove extensions incrementally to the architecture being compiled for. diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi index e500e7c..965e0ff 100644 --- a/gas/doc/c-i386.texi +++ b/gas/doc/c-i386.texi @@ -229,6 +229,8 @@ accept various extension mnemonics. For example, @code{clflush}, @code{mwaitx}, @code{clzero}, +@code{wbnoinvd}, +@code{pconfig}, @code{lwp}, @code{fma4}, @code{xop}, @@ -409,6 +411,28 @@ with 01, 10 and 11 RC bits, respectively. This option specifies that the assembler should accept only AMD64 or Intel64 ISA in 64-bit mode. The default is to accept both. +@cindex @samp{-O0} option, i386 +@cindex @samp{-O0} option, x86-64 +@cindex @samp{-O} option, i386 +@cindex @samp{-O} option, x86-64 +@cindex @samp{-O1} option, i386 +@cindex @samp{-O1} option, x86-64 +@cindex @samp{-O2} option, i386 +@cindex @samp{-O2} option, x86-64 +@cindex @samp{-Os} option, i386 +@cindex @samp{-Os} option, x86-64 +@item -O0 | -O | -O1 | -O2 | -Os +Optimize instruction encoding with smaller instruction size. @samp{-O} +and @samp{-O1} encode 64-bit register load instructions with 64-bit +immediate as 32-bit register load instructions with 31-bit or 32-bits +immediates and encode 64-bit register clearing instructions with 32-bit +register clearing instructions. @samp{-O2} includes @samp{-O1} +optimization plus encodes 256-bit and 512-bit vector register clearing +instructions with 128-bit vector register clearing instructions. +@samp{-Os} includes @samp{-O2} optimization plus encodes 16-bit, 32-bit +and 64-bit register tests with immediate as 8-bit register test with +immediate. @samp{-O0} turns off this optimization. + @end table @c man end @@ -640,6 +664,14 @@ Different encoding options can be specified via pseudo prefixes: @item @samp{@{evex@}} -- encode with EVEX prefix. + +@item +@samp{@{rex@}} -- prefer REX prefix for integer and legacy vector +instructions (x86-64 only). Note that this differs from the @samp{rex} +prefix which generates REX prefix unconditionally. + +@item +@samp{@{nooptimize@}} -- disable instruction size optimization. @end itemize @cindex conversion instructions, i386 @@ -1239,12 +1271,13 @@ supported on the CPU specified. The choices for @var{cpu_type} are: @item @samp{.avx512vbmi} @tab @samp{.avx512_4fmaps} @tab @samp{.avx512_4vnniw} @item @samp{.avx512_vpopcntdq} @tab @samp{.avx512_vbmi2} @tab @samp{.avx512_vnni} @item @samp{.avx512_bitalg} -@item @samp{.clwb} @tab @samp{.rdpid} @tab @samp{.ptwrite} @tab @item @samp{.cet} +@item @samp{.clwb} @tab @samp{.rdpid} @tab @samp{.ptwrite} @tab @item @samp{.ibt} +@item @samp{.wbnoinvd} @tab @samp{.pconfig} +@item @samp{.shstk} @tab @samp{.gfni} @tab @samp{.vaes} @tab @samp{.vpclmulqdq} @item @samp{.3dnow} @tab @samp{.3dnowa} @tab @samp{.sse4a} @tab @samp{.sse5} @item @samp{.syscall} @tab @samp{.rdtscp} @tab @samp{.svme} @tab @samp{.abm} @item @samp{.lwp} @tab @samp{.fma4} @tab @samp{.xop} @tab @samp{.cx16} -@item @samp{.padlock} @tab @samp{.clzero} @tab @samp{.mwaitx} @tab @samp{.gfni} -@item @samp{.vaes} @tab @samp{.vpclmulqdq} +@item @samp{.padlock} @tab @samp{.clzero} @tab @samp{.mwaitx} @end multitable Apart from the warning, there are only two other effects on diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 3fb5dc1..e7c0b6e 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -751,10 +751,10 @@ get_filenum (const char *filename, unsigned int num) - Pass .file "source.c" to s_app_file - Handle .file 1 "source.c" by adding an entry to the DWARF-2 file table - If an entry is added to the file table, return a pointer to the filename. */ + If an entry is added to the file table, return a pointer to the filename. */ char * -dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED) +dwarf2_directive_filename (void) { offsetT num; char *filename; @@ -795,6 +795,15 @@ dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED) return filename; } +/* Calls dwarf2_directive_filename, but discards its result. + Used in pseudo-op tables where the function result is ignored. */ + +void +dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED) +{ + (void) dwarf2_directive_filename (); +} + void dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) { diff --git a/gas/dwarf2dbg.h b/gas/dwarf2dbg.h index 06e537b..3c272d6 100644 --- a/gas/dwarf2dbg.h +++ b/gas/dwarf2dbg.h @@ -41,8 +41,10 @@ struct dwarf2_line_info /* Implements the .file FILENO "FILENAME" directive. FILENO can be 0 to indicate that no file number has been assigned. All real file - number must be >0. */ -extern char *dwarf2_directive_file (int); + number must be >0. The second form returns the filename extracted + from the input stream. */ +extern void dwarf2_directive_file (int); +extern char * dwarf2_directive_filename (void); /* Implements the .loc FILENO LINENO [COLUMN] directive. FILENO is the file number, LINENO the line number and the (optional) COLUMN diff --git a/gas/po/gas.pot b/gas/po/gas.pot index 96e6ba0..f88c59d 100644 --- a/gas/po/gas.pot +++ b/gas/po/gas.pot @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: bug-binutils@gnu.org\n" -"POT-Creation-Date: 2018-01-13 13:44+0000\n" +"POT-Creation-Date: 2018-01-13 13:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/gas/po/ru.po b/gas/po/ru.po index 564135a..f5d087f 100644 --- a/gas/po/ru.po +++ b/gas/po/ru.po @@ -2,80 +2,82 @@ # Copyright (C) 2010 Free Software Foundation, Inc. # This file is distributed under the same license as the binutils package. # -# Yuri Kozlov , 2010. +# Yuri Kozlov , 2010, 2018. +#: config/tc-arm.c:642 msgid "" msgstr "" -"Project-Id-Version: gas 2.20\n" +"Project-Id-Version: gas 2.30.0\n" "Report-Msgid-Bugs-To: bug-binutils@gnu.org\n" -"POT-Creation-Date: 2009-09-07 14:09+0200\n" -"PO-Revision-Date: 2010-01-05 21:08+0300\n" +"POT-Creation-Date: 2018-01-13 13:44+0000\n" +"PO-Revision-Date: 2018-02-24 08:45+0300\n" "Last-Translator: Yuri Kozlov \n" -"Language-Team: Russian \n" -"X-Bugs: Report translation errors to the Language-Team address.\n" +"Language-Team: Russian \n" +"Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.11.4\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 2.0\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: app.c:488 app.c:502 +#: app.c:490 app.c:504 msgid "end of file in comment" msgstr "конец файла в комментарии" -#: app.c:580 app.c:627 +#: app.c:582 app.c:629 #, c-format msgid "end of file in string; '%c' inserted" -msgstr "конец файла в строке; вставлен '%c'" +msgstr "конец файла в строке; вставлен «%c»" -#: app.c:653 +#: app.c:655 #, c-format msgid "unknown escape '\\%c' in string; ignored" msgstr "неизвестная экранирующая последовательность '\\%c' в строке; игнорируется" -#: app.c:816 +#: app.c:829 input-scrub.c:363 msgid "end of file not at end of a line; newline inserted" msgstr "конец файла не в конце строки; вставлен символ новой строки" -#: app.c:973 +#: app.c:992 msgid "end of file in multiline comment" msgstr "конец файла в многостроковом комментарии" -#: app.c:1048 +#: app.c:1067 msgid "end of file after a one-character quote; \\0 inserted" msgstr "конец файла после одиночной кавычки; вставлен \\0" -#: app.c:1056 +#: app.c:1075 msgid "end of file in escape character" msgstr "конец файла в экранированном символе" -#: app.c:1068 +#: app.c:1087 msgid "missing close quote; (assumed)" msgstr "отсутствует закрывающая кавычка; (предположительно)" -#: app.c:1137 app.c:1192 app.c:1203 app.c:1277 +#: app.c:1156 app.c:1211 app.c:1223 app.c:1303 msgid "end of file in comment; newline inserted" msgstr "конец файла в комментарии; вставлен символ новой строки" -#: as.c:158 +#: as.c:162 msgid "missing emulation mode name" msgstr "пропущено имя режима эмуляции" -#: as.c:173 +#: as.c:177 #, c-format msgid "unrecognized emulation name `%s'" -msgstr "нераспознанно имя эмуляции `%s'" +msgstr "нераспознанное имя эмуляции «%s»" -#: as.c:220 +#: as.c:224 #, c-format msgid "GNU assembler version %s (%s) using BFD version %s\n" msgstr "GNU ассемблер, версия %s (%s); используется BFD версии %s\n" -#: as.c:227 +#: as.c:236 #, c-format msgid "Usage: %s [option...] [asmfile...]\n" msgstr "Использование: %s [параметр...] [asm-файл...]\n" -#: as.c:229 +#: as.c:238 #, c-format msgid "" "Options:\n" @@ -104,259 +106,351 @@ msgstr "" " \t s включать символы\n" " \t =ФАЙЛ записывать в ФАЙЛ (должно быть последним)\n" -#: as.c:243 +#: as.c:252 #, c-format msgid " --alternate initially turn on alternate macro syntax\n" msgstr " --alternate сразу включить альтернативный синтаксис макросов\n" -#: as.c:245 +#: as.c:255 +#, c-format +msgid "" +" --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n" +" compress DWARF debug sections using zlib [default]\n" +msgstr "" +" --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n" +" сжимать отладочные разделы DWARF\n" +" с помощью zlib [по умолчанию]\n" + +#: as.c:258 +#, c-format +msgid "" +" --nocompress-debug-sections\n" +" don't compress DWARF debug sections\n" +msgstr "" +" --nocompress-debug-sections\n" +" не сжимать отладочные разделы DWARF\n" + +#: as.c:262 +#, c-format +msgid "" +" --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n" +" compress DWARF debug sections using zlib\n" +msgstr "" +" --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi}]\n" +" сжимать отладочные разделы DWARF\n" +" с помощью zlib\n" + +#: as.c:265 +#, c-format +msgid "" +" --nocompress-debug-sections\n" +" don't compress DWARF debug sections [default]\n" +msgstr "" +" --nocompress-debug-sections\n" +" не сжимать отладочные разделы DWARF [по умолчанию]\n" + +#: as.c:269 #, c-format msgid " -D produce assembler debugging messages\n" msgstr " -D выводить ассемблерные отладочные сообщения\n" -#: as.c:247 +#: as.c:271 #, c-format -msgid " --debug-prefix-map OLD=NEW Map OLD to NEW in debug information\n" +msgid "" +" --debug-prefix-map OLD=NEW\n" +" map OLD to NEW in debug information\n" msgstr "" -" --debug-prefix-map СТА=НОВ Преобразовывать СТАрые на НОВые в отладочной\n" -" информации\n" +" --debug-prefix-map СТА=НОВ\n" +" в отладочной информации преобразовывать\n" +" СТАрое в НОВое\n" -#: as.c:249 +#: as.c:274 #, c-format msgid " --defsym SYM=VAL define symbol SYM to given value\n" msgstr " --defsym СИМ=ЗНА назначить СИМволу нужно ЗНАчение\n" -#: as.c:265 +#: as.c:290 #, c-format msgid " emulate output (default %s)\n" msgstr " эмулировать вывод (по умолчанию %s)\n" -#: as.c:270 +#: as.c:295 #, c-format msgid " --execstack require executable stack for this object\n" msgstr " --execstack требовать исполняемый стек для этого объекта\n" -#: as.c:272 +#: as.c:297 #, c-format msgid " --noexecstack don't require executable stack for this object\n" msgstr " --noexecstack не требовать исполняемый стек для этого объекта\n" -#: as.c:275 +#: as.c:299 +#, c-format +msgid "" +" --size-check=[error|warning]\n" +"\t\t\t ELF .size directive check (default --size-check=error)\n" +msgstr "" +" --size-check=[error|warning]\n" +"\t\t\t проверка директивы .size в ELF (по умолчанию --size-check=error)\n" + +#: as.c:302 +#, c-format +msgid "" +" --elf-stt-common=[no|yes]\n" +" generate ELF common symbols with STT_COMMON type\n" +msgstr "" +" --elf-stt-common=[no|yes]\n" +" генерировать общие символы ELF с типом STT_COMMON\n" + +#: as.c:305 +#, c-format +msgid " --sectname-subst enable section name substitution sequences\n" +msgstr "" +" --sectname-subst включать последовательности подстановки\n" +" в именах разделов\n" + +#: as.c:308 #, c-format msgid " -f skip whitespace and comment preprocessing\n" msgstr " -f не выполнять пред-обработку пробелов и комментариев\n" -#: as.c:277 +#: as.c:310 #, c-format msgid " -g --gen-debug generate debugging information\n" msgstr " -g --gen-debug генерировать отладочную информацию\n" -#: as.c:279 +#: as.c:312 #, c-format msgid " --gstabs generate STABS debugging information\n" msgstr " --gstabs генерировать отладочную информацию STABS\n" -#: as.c:281 +#: as.c:314 #, c-format msgid " --gstabs+ generate STABS debug info with GNU extensions\n" msgstr "" " --gstabs+ генерировать отладочную информацию STABS\n" " с расширениями GNU\n" -#: as.c:283 +#: as.c:316 #, c-format msgid " --gdwarf-2 generate DWARF2 debugging information\n" msgstr " --gdwarf-2 генерировать отладочную информацию DWARF2\n" -#: as.c:285 +#: as.c:318 +#, c-format +msgid " --gdwarf-sections generate per-function section names for DWARF line information\n" +msgstr "" +" --gdwarf-sections генерировать имена разделов для каждой функции\n" +" в информацию DWARF о строках\n" + +#: as.c:320 #, c-format msgid " --hash-size= set the hash table size close to \n" msgstr " --hash-size=<знач> задать размер хэш таблицы близким к <значению>\n" -#: as.c:287 +#: as.c:322 #, c-format msgid " --help show this message and exit\n" msgstr " --help показать это сообщение и закончить работу\n" -#: as.c:289 +#: as.c:324 #, c-format msgid " --target-help show target specific options\n" msgstr " --target-help показать параметры, подходящие только к этой цели\n" -#: as.c:291 +#: as.c:326 #, c-format msgid " -I DIR add DIR to search list for .include directives\n" msgstr "" " -I КАТ добавить КАТалог в список поиска, используемого\n" " директивами .include\n" -#: as.c:293 +#: as.c:328 #, c-format msgid " -J don't warn about signed overflow\n" msgstr " -J не предупреждать о знаковом переполнении\n" -#: as.c:295 +#: as.c:330 #, c-format msgid " -K warn when differences altered for long displacements\n" -msgstr "" +msgstr " -K предупреждать при изменении различий в длинных перестановках\n" -#: as.c:297 +#: as.c:332 #, c-format msgid " -L,--keep-locals keep local symbols (e.g. starting with `L')\n" msgstr "" " -L,--keep-locals сохранять локальные символы (например,\n" " начинающиеся с L)\n" -#: as.c:299 +#: as.c:334 #, c-format msgid " -M,--mri assemble in MRI compatibility mode\n" msgstr " -M,--mri ассемблировать в режиме совместимости с MRI\n" -#: as.c:301 +#: as.c:336 #, c-format msgid " --MD FILE write dependency information in FILE (default none)\n" msgstr "" " --MD ФАЙЛ записывать информацию о зависимостях в ФАЙЛ\n" " (по умолчанию не записывается)\n" -#: as.c:303 +#: as.c:338 #, c-format msgid " -nocpp ignored\n" msgstr " -nocpp игнорируется\n" -#: as.c:305 +#: as.c:340 +#, c-format +msgid " -no-pad-sections do not pad the end of sections to alignment boundaries\n" +msgstr " -no-pad-sections не дополнять конец разделов для выравнивая по границам\n" + +#: as.c:342 #, c-format msgid " -o OBJFILE name the object-file output OBJFILE (default a.out)\n" msgstr " -o OBJ-ФАЙЛ имя объектного файла результата (по умолчанию a.out)\n" -#: as.c:307 +#: as.c:344 #, c-format msgid " -R fold data section into text section\n" msgstr " -R поместить раздел данных в раздел текста\n" -#: as.c:309 +#: as.c:346 #, c-format msgid "" " --reduce-memory-overheads \n" " prefer smaller memory use at the cost of longer\n" " assembly times\n" msgstr "" +" --reduce-memory-overheads \n" +" сокращать расход памяти, хоть и при этом\n" +" увеличится время компиляции\n" -#: as.c:313 +#: as.c:350 #, c-format msgid " --statistics print various measured statistics from execution\n" -msgstr "" +msgstr " --statistics показать различную измеренную статистику выполнения\n" -#: as.c:315 +#: as.c:352 #, c-format msgid " --strip-local-absolute strip local absolute symbols\n" msgstr " --strip-local-absolute удалить локальные абсолютные символы\n" -#: as.c:317 +#: as.c:354 #, c-format msgid " --traditional-format Use same format as native assembler when possible\n" msgstr "" " --traditional-format использовать родной для ассемблера формат,\n" " если возможно\n" -#: as.c:319 +#: as.c:356 #, c-format msgid " --version print assembler version number and exit\n" msgstr " --version показать версию ассемблера и закончить работу\n" -#: as.c:321 +#: as.c:358 #, c-format msgid " -W --no-warn suppress warnings\n" msgstr " -W --no-warn не показывать предупреждения\n" -#: as.c:323 +#: as.c:360 #, c-format msgid " --warn don't suppress warnings\n" msgstr " --warn показывать предупреждения\n" -#: as.c:325 +#: as.c:362 #, c-format msgid " --fatal-warnings treat warnings as errors\n" msgstr " --fatal-warnings считать предупреждения ошибками\n" -#: as.c:328 +#: as.c:365 #, c-format msgid "" " --itbl INSTTBL extend instruction set to include instructions\n" " matching the specifications defined in file INSTTBL\n" msgstr "" +" --itbl INSTTBL расширить набор инструкций, включив инструкции\n" +" из спецификации, определённой в файле INSTTBL\n" -#: as.c:332 +#: as.c:369 #, c-format msgid " -w ignored\n" msgstr " -w игнорируется\n" -#: as.c:334 +#: as.c:371 #, c-format msgid " -X ignored\n" msgstr " -X игнорируется\n" -#: as.c:336 +#: as.c:373 #, c-format msgid " -Z generate object file even after errors\n" msgstr " -Z генерировать объектный файл не смотря на ошибки\n" -#: as.c:338 +#: as.c:375 #, c-format msgid "" " --listing-lhs-width set the width in words of the output data column of\n" " the listing\n" msgstr "" +" --listing-lhs-width задать в словах ширину выводимого столбца данных\n" +" в листинге\n" -#: as.c:341 +#: as.c:378 #, c-format msgid "" " --listing-lhs-width2 set the width in words of the continuation lines\n" " of the output data column; ignored if smaller than\n" " the width of the first line\n" msgstr "" +" --listing-lhs-width2 задать в словах ширину последующих выводимых строк\n" +" столбца данных; игнорируется, если меньше ширины\n" +" первой строки\n" -#: as.c:345 +#: as.c:382 #, c-format msgid "" " --listing-rhs-width set the max width in characters of the lines from\n" " the source file\n" msgstr "" +" --listing-rhs-width задать максимальную ширину (в символах) строк из\n" +" файла исходного кода\n" -#: as.c:348 +#: as.c:385 #, c-format msgid "" " --listing-cont-lines set the maximum number of continuation lines used\n" " for the output data column of the listing\n" msgstr "" +" --listing-cont-lines задать максимальное количество последующих строк,\n" +" используемых в листинге при выводе столбца данных\n" -#: as.c:351 +#: as.c:388 #, c-format msgid " @FILE read options from FILE\n" msgstr " @ФАЙЛ прочитать парамеры из ФАЙЛа\n" -#: as.c:359 +#: as.c:396 #, c-format msgid "Report bugs to %s\n" msgstr "Сообщения об ошибках отправляйте в %s\n" -#: as.c:564 +#: as.c:616 #, c-format msgid "unrecognized option -%c%s" msgstr "нераспознанный параметр -%c%s" #. This output is intended to follow the GNU standards document. -#: as.c:602 +#: as.c:658 #, c-format msgid "GNU assembler %s\n" msgstr "GNU ассемблер %s\n" -#: as.c:603 +#: as.c:659 #, c-format -msgid "Copyright 2009 Free Software Foundation, Inc.\n" -msgstr "Copyright 2009 Free Software Foundation, Inc.\n" +msgid "Copyright (C) 2018 Free Software Foundation, Inc.\n" +msgstr "Copyright (C) 2018 Free Software Foundation, Inc.\n" -#: as.c:604 +#: as.c:660 #, c-format msgid "" "This program is free software; you may redistribute it under the terms of\n" @@ -368,344 +462,395 @@ msgstr "" "более новой версии.\n" "Эта программа не имеет абсолютно никаких гарантий.\n" -#: as.c:608 +#: as.c:665 +#, c-format +msgid "" +"This assembler was configured for a target of `%s' and default,\n" +"cpu type `%s'.\n" +msgstr "" +"По умолчанию ассемблер настроен на цель «%s»\n" +"с типом процессора «%s».\n" + +#: as.c:669 #, c-format msgid "This assembler was configured for a target of `%s'.\n" msgstr "Ассемблер настроен на цель %s.\n" -#: as.c:615 +#: as.c:677 msgid "multiple emulation names specified" msgstr "указано несколько имён эмуляции" -#: as.c:617 +#: as.c:679 msgid "emulations not handled in this configuration" msgstr "эмуляции не обрабатываются при таких настройках" -#: as.c:622 +#: as.c:684 #, c-format msgid "alias = %s\n" msgstr "псевдоним = %s\n" -#: as.c:623 +#: as.c:685 #, c-format msgid "canonical = %s\n" msgstr "каноническое = %s\n" -#: as.c:624 +#: as.c:686 #, c-format msgid "cpu-type = %s\n" msgstr "тип ЦП = %s\n" -#: as.c:626 +#: as.c:688 #, c-format msgid "format = %s\n" msgstr "формат = %s\n" -#: as.c:629 +#: as.c:691 #, c-format msgid "bfd-target = %s\n" msgstr "bfd-цель = %s\n" -#: as.c:646 +#: as.c:708 +#, c-format +msgid "Invalid --compress-debug-sections option: `%s'" +msgstr "Некорректный параметр --compress-debug-sections: «%s»" + +#: as.c:711 +#, c-format +msgid "--compress-debug-sections=%s is unsupported" +msgstr "--compress-debug-sections=%s не поддерживается" + +#: as.c:736 msgid "bad defsym; format is --defsym name=value" msgstr "неверный defsym; формат должен быть --defsym имя=значение" -#: as.c:666 +#: as.c:756 msgid "no file name following -t option" msgstr "для параметра -t не указано имя файла" -#: as.c:681 +#: as.c:771 #, c-format msgid "failed to read instruction table %s\n" msgstr "не удалось прочитать таблицу инструкций %s\n" -#: as.c:852 +#: as.c:887 +#, c-format +msgid "Invalid --size-check= option: `%s'" +msgstr "Некорректное значение --size-check=: «%s»" + +#: as.c:896 +#, c-format +msgid "Invalid --elf-stt-common= option: `%s'" +msgstr "Некорректное значение --elf-stt-common=: «%s»" + +#: as.c:969 #, c-format msgid "invalid listing option `%c'" msgstr "неверный параметр %c для листинга" -#: as.c:905 +#: as.c:1022 msgid "--hash-size needs a numeric argument" msgstr "для --hash-size требуется числовой аргумент" -#: as.c:930 +#: as.c:1044 #, c-format msgid "%s: total time in assembly: %ld.%06ld\n" msgstr "%s: общее время ассемблирования: %ld.%06ld\n" -#: as.c:933 +#: as.c:1325 +#, c-format +msgid "%d warning" +msgid_plural "%d warnings" +msgstr[0] "%d предупреждение" +msgstr[1] "%d предупреждения" +msgstr[2] "%d предупреждений" + +#: as.c:1327 +#, c-format +msgid "%d error" +msgid_plural "%d errors" +msgstr[0] "%d ошибка" +msgstr[1] "%d ошибки" +msgstr[2] "%d ошибок" + +#: as.c:1331 #, c-format -msgid "%s: data size %ld\n" -msgstr "%s: размер данных %ld\n" +msgid "%s, treating warnings as errors" +msgstr "%s, предупреждения считаются ошибками" -#: as.c:1241 +#: as.c:1342 #, c-format -msgid "%d warnings, treating warnings as errors" -msgstr "%d предупреждений, предупреждения считаются ошибками" +msgid "%s, %s, generating bad object file\n" +msgstr "%s, %s, генерируется плохой объектный файл\n" -#: as.h:208 +#: as.h:173 #, c-format msgid "Case value %ld unexpected at line %d of file \"%s\"\n" -msgstr "" +msgstr "Неожиданное значение %ld в строке %d файла «%s»\n" #. #. * We have a GROSS internal error. #. * This should never happen. #. -#: atof-generic.c:417 config/tc-m68k.c:3536 +#: atof-generic.c:418 config/tc-m68k.c:3582 msgid "failed sanity check" msgstr "проверка на исправность не пройдена" -#: cgen.c:113 config/tc-alpha.c:2083 config/tc-alpha.c:2107 -#: config/tc-arc.c:1681 config/tc-d10v.c:550 config/tc-d30v.c:538 -#: config/tc-mn10200.c:1100 config/tc-mn10300.c:1749 config/tc-ppc.c:2562 -#: config/tc-ppc.c:2713 config/tc-ppc.c:2834 config/tc-ppc.c:2845 -#: config/tc-s390.c:1218 config/tc-s390.c:1318 config/tc-s390.c:1447 -#: config/tc-v850.c:1730 config/tc-v850.c:1753 config/tc-v850.c:1956 +#: cgen.c:107 config/tc-alpha.c:2099 config/tc-alpha.c:2123 +#: config/tc-arc.c:4013 config/tc-arc.c:4087 config/tc-d10v.c:550 +#: config/tc-d30v.c:537 config/tc-mn10200.c:1098 config/tc-mn10300.c:1752 +#: config/tc-ppc.c:2987 config/tc-ppc.c:3173 config/tc-ppc.c:3438 +#: config/tc-s390.c:1323 config/tc-s390.c:1446 config/tc-s390.c:1584 +#: config/tc-v850.c:2538 config/tc-v850.c:2609 config/tc-v850.c:2656 +#: config/tc-v850.c:2693 config/tc-v850.c:2730 config/tc-v850.c:2993 msgid "too many fixups" -msgstr "" +msgstr "слишком много местоположений (fixups)" -#: cgen.c:400 cgen.c:420 config/tc-arc.c:1662 config/tc-d10v.c:461 -#: config/tc-d30v.c:453 config/tc-i370.c:2129 config/tc-mn10200.c:1042 -#: config/tc-mn10300.c:1674 config/tc-ppc.c:2601 config/tc-s390.c:1189 -#: config/tc-v850.c:1932 config/tc-z80.c:422 +#: cgen.c:372 cgen.c:392 config/tc-d10v.c:461 config/tc-d30v.c:453 +#: config/tc-i370.c:2127 config/tc-mn10200.c:1040 config/tc-mn10300.c:1677 +#: config/tc-ppc.c:3029 config/tc-s390.c:1307 config/tc-v850.c:2647 +#: config/tc-v850.c:2681 config/tc-v850.c:2721 config/tc-v850.c:2966 +#: config/tc-z80.c:446 msgid "illegal operand" msgstr "неверный операнд" -#: cgen.c:424 config/tc-arc.c:1664 config/tc-avr.c:569 config/tc-d10v.c:463 -#: config/tc-d30v.c:455 config/tc-h8300.c:450 config/tc-i370.c:2131 -#: config/tc-mcore.c:662 config/tc-microblaze.c:583 config/tc-mmix.c:488 -#: config/tc-mn10200.c:1045 config/tc-mn10300.c:1677 config/tc-msp430.c:452 -#: config/tc-or32.c:307 config/tc-ppc.c:2603 config/tc-s390.c:1207 -#: config/tc-sh.c:1359 config/tc-sh64.c:2213 config/tc-v850.c:1935 -#: config/tc-z80.c:575 config/tc-z8k.c:350 +#: cgen.c:396 config/tc-avr.c:899 config/tc-d10v.c:463 config/tc-d30v.c:455 +#: config/tc-h8300.c:502 config/tc-i370.c:2129 config/tc-mcore.c:661 +#: config/tc-microblaze.c:609 config/tc-mmix.c:495 config/tc-mn10200.c:1043 +#: config/tc-mn10300.c:1680 config/tc-msp430.c:417 config/tc-ppc.c:3031 +#: config/tc-s390.c:1312 config/tc-sh.c:1385 config/tc-sh64.c:2214 +#: config/tc-v850.c:2651 config/tc-v850.c:2685 config/tc-v850.c:2725 +#: config/tc-v850.c:2969 config/tc-xgate.c:895 config/tc-z80.c:557 +#: config/tc-z8k.c:349 msgid "missing operand" msgstr "пропущен операнд" -#: cgen.c:799 +#: cgen.c:767 msgid "a reloc on this operand implies an overflow" -msgstr "" +msgstr "перемещение на этот операнд означает переполнение" -#: cgen.c:822 +#: cgen.c:790 msgid "operand mask overflow" msgstr "переполнение маски операнда" #. We can't actually support subtracting a symbol. -#: cgen.c:885 config/tc-arc.c:1247 config/tc-arm.c:1612 config/tc-arm.c:8617 -#: config/tc-arm.c:8668 config/tc-arm.c:8914 config/tc-arm.c:9704 -#: config/tc-arm.c:10703 config/tc-arm.c:10743 config/tc-arm.c:11051 -#: config/tc-arm.c:11080 config/tc-avr.c:1087 config/tc-cris.c:4044 -#: config/tc-d10v.c:1502 config/tc-d30v.c:1903 config/tc-mips.c:4394 -#: config/tc-mips.c:5518 config/tc-mips.c:6493 config/tc-mips.c:7069 -#: config/tc-msp430.c:1937 config/tc-ppc.c:5769 config/tc-spu.c:959 -#: config/tc-spu.c:983 config/tc-v850.c:2271 config/tc-xstormy16.c:484 -#: config/tc-xtensa.c:5821 config/tc-xtensa.c:11839 +#: cgen.c:851 config/tc-arm.c:1776 config/tc-arm.c:10346 config/tc-arm.c:10398 +#: config/tc-arm.c:10656 config/tc-arm.c:11493 config/tc-arm.c:12630 +#: config/tc-arm.c:12670 config/tc-arm.c:13013 config/tc-arm.c:13054 +#: config/tc-arm.c:17513 config/tc-arm.c:17554 config/tc-avr.c:1550 +#: config/tc-avr.c:1562 config/tc-avr.c:1826 config/tc-cris.c:4067 +#: config/tc-d10v.c:1507 config/tc-d30v.c:1912 config/tc-ft32.c:574 +#: config/tc-ft32.c:587 config/tc-mips.c:9438 config/tc-mips.c:10743 +#: config/tc-mips.c:11999 config/tc-mips.c:12658 config/tc-nds32.c:6587 +#: config/tc-pru.c:747 config/tc-pru.c:757 config/tc-spu.c:957 +#: config/tc-spu.c:981 config/tc-tilegx.c:1485 config/tc-tilepro.c:1346 +#: config/tc-v850.c:3451 config/tc-vax.c:282 config/tc-xstormy16.c:482 +#: config/tc-xtensa.c:5949 config/tc-xtensa.c:13095 msgid "expression too complex" msgstr "слишком сложное выражение" -#: cgen.c:979 config/tc-arc.c:1308 config/tc-ppc.c:5894 config/tc-s390.c:2023 -#: config/tc-v850.c:2311 config/tc-xstormy16.c:538 +#: cgen.c:950 config/tc-ppc.c:7027 config/tc-s390.c:2365 config/tc-v850.c:3503 +#: config/tc-xstormy16.c:539 msgid "unresolved expression that must be resolved" msgstr "нерешаемое выражение, которое должно быть решено" -#: cgen.c:1004 config/tc-xstormy16.c:563 +#: cgen.c:975 config/tc-xstormy16.c:564 #, c-format msgid "internal error: can't install fix for reloc type %d (`%s')" -msgstr "" +msgstr "внутренняя ошибка: невозможно установить местоположение для перемещения с типом %d («%s»)" -#: cgen.c:1034 +#: cgen.c:1026 config/tc-nios2.c:1360 config/tc-pru.c:788 msgid "relocation is not supported" msgstr "перемещение не поддерживается" -#: cond.c:83 +#: cond.c:82 msgid "invalid identifier for \".ifdef\"" -msgstr "неверный идентификатор для \".ifdef\"" +msgstr "неверный идентификатор для «.ifdef»" -#: cond.c:150 +#: cond.c:149 msgid "non-constant expression in \".if\" statement" -msgstr "неконстантное выражение в операторе \".if\"" +msgstr "неконстантное выражение в операторе «.if»" -#: cond.c:277 +#: cond.c:276 msgid "bad format for ifc or ifnc" msgstr "неверный формат для ifc или ifnc" -#: cond.c:307 +#: cond.c:306 msgid "\".elseif\" without matching \".if\"" -msgstr "\".elseif\" без надлежащего \".if\"" +msgstr "«.elseif» без надлежащего «.if»" -#: cond.c:311 +#: cond.c:310 msgid "\".elseif\" after \".else\"" -msgstr "\".elseif\" после \".else\"" +msgstr "«.elseif» после «.else»" -#: cond.c:314 cond.c:420 -msgid "here is the previous \"else\"" -msgstr "здесь предыдущий \"else\"" +#: cond.c:313 cond.c:419 +msgid "here is the previous \".else\"" +msgstr "здесь предыдущий «.else»" -#: cond.c:317 cond.c:423 -msgid "here is the previous \"if\"" -msgstr "здесь предыдущий \"if\"" +#: cond.c:316 cond.c:422 +msgid "here is the previous \".if\"" +msgstr "здесь предыдущий «.if»" -#: cond.c:346 +#: cond.c:345 msgid "non-constant expression in \".elseif\" statement" -msgstr "неконстантное выражение в операторе \".elseif\"" +msgstr "неконстантное выражение в операторе «.elseif»" -#: cond.c:384 +#: cond.c:383 msgid "\".endif\" without \".if\"" -msgstr "\".endif\" без \".if\"" +msgstr "«.endif» без «.if»" -#: cond.c:413 +#: cond.c:412 msgid "\".else\" without matching \".if\"" -msgstr "\".else\" без надлежащего \".if\"" +msgstr "«.else» без надлежащего «.if»" -#: cond.c:417 -msgid "duplicate \"else\"" -msgstr "повторный \"else\"" +#: cond.c:416 +msgid "duplicate \".else\"" +msgstr "повторный «.else»" -#: cond.c:468 +#: cond.c:467 msgid ".ifeqs syntax error" msgstr "синтаксическая ошибка в .ifeqs" -#: cond.c:549 +#: cond.c:548 msgid "end of macro inside conditional" msgstr "конец макроса внутри условия" -#: cond.c:551 +#: cond.c:550 msgid "end of file inside conditional" msgstr "конец файла внутри условия" -#: cond.c:554 +#: cond.c:553 msgid "here is the start of the unterminated conditional" msgstr "вот начало незавершённого условия" -#: cond.c:558 +#: cond.c:557 msgid "here is the \"else\" of the unterminated conditional" msgstr "вот \"else\" незавершённого условия" -#: config/atof-ieee.c:141 +#: config/atof-ieee.c:139 msgid "cannot create floating-point number" msgstr "не удалось создать число с плавающей точкой" -#: config/atof-ieee.c:288 +#: config/atof-ieee.c:286 msgid "NaNs are not supported by this target\n" msgstr "NaN не поддерживается этой целью\n" -#: config/atof-ieee.c:327 config/atof-ieee.c:368 +#: config/atof-ieee.c:325 config/atof-ieee.c:366 msgid "Infinities are not supported by this target\n" msgstr "Бесконечность не поддерживается этой целью\n" -#: config/atof-ieee.c:784 config/atof-vax.c:450 config/tc-arm.c:1007 -#: config/tc-ia64.c:11332 config/tc-tic30.c:1261 config/tc-tic4x.c:2599 +#: config/atof-ieee.c:781 config/atof-vax.c:449 config/tc-arm.c:1152 +#: config/tc-ia64.c:11608 config/tc-tic30.c:1263 config/tc-tic4x.c:2585 msgid "Unrecognized or unsupported floating point constant" msgstr "Нераспознанная или неподдерживаемая константа с плавающей точкой" -#: config/obj-aout.c:85 +#: config/obj-aout.c:81 #, c-format msgid "Attempt to put a common symbol into set %s" -msgstr "" +msgstr "Попытка поместить общий символ в набор %s" -#: config/obj-aout.c:89 +#: config/obj-aout.c:85 #, c-format msgid "Attempt to put an undefined symbol into set %s" -msgstr "" +msgstr "Попытка поместить неопределённый символ в набор %s" -#: config/obj-aout.c:116 config/obj-coff.c:1406 +#: config/obj-aout.c:112 config/obj-coff.c:1382 #, c-format msgid "Symbol `%s' can not be both weak and common" -msgstr "" +msgstr "Символ «%s» не может быть слабым и общим одновременно" -#: config/obj-coff.c:135 +#: config/obj-coff.c:135 dw2gencfi.c:334 #, c-format msgid "Inserting \"%s\" into structure table failed: %s" -msgstr "Не удалось вставить \"%s\" в таблицу структур: %s" +msgstr "Не удалось вставить «%s» в таблицу структур: %s" -#: config/obj-coff.c:214 config/obj-coff.c:1694 config/tc-ppc.c:4859 -#: config/tc-tic54x.c:4011 read.c:2796 +#: config/obj-coff.c:214 config/obj-coff.c:1681 config/tc-ppc.c:5647 +#: config/tc-tic54x.c:3980 read.c:2960 #, c-format msgid "error setting flags for \"%s\": %s" -msgstr "ошибка установки флагов для \"%s\": %s" +msgstr "ошибка установки флагов для «%s»: %s" #. Zero is used as an end marker in the file. -#: config/obj-coff.c:433 +#: config/obj-coff.c:435 msgid "Line numbers must be positive integers\n" msgstr "Номера строк должны быть положительными целыми числами\n" -#: config/obj-coff.c:465 +#: config/obj-coff.c:467 msgid ".ln pseudo-op inside .def/.endef: ignored." msgstr "Псевдооперация .in внутри .def/.endef: игнорируется." -#: config/obj-coff.c:507 ecoff.c:3240 +#: config/obj-coff.c:509 ecoff.c:3245 msgid ".loc outside of .text" msgstr ".loc вне .text" -#: config/obj-coff.c:514 +#: config/obj-coff.c:516 msgid ".loc pseudo-op inside .def/.endef: ignored." msgstr "Псевдооперация .loc внутри .def/.endef: игнорируется." -#: config/obj-coff.c:595 +#: config/obj-coff.c:596 msgid ".def pseudo-op used inside of .def/.endef: ignored." msgstr "Псевдооперация .def используется внутри .def/.endef: игнорируется." -#: config/obj-coff.c:634 +#: config/obj-coff.c:629 msgid ".endef pseudo-op used outside of .def/.endef: ignored." msgstr "Псевдооперация .endef используется вне .def/.endef: игнорируется." -#: config/obj-coff.c:673 +#: config/obj-coff.c:668 #, c-format msgid "`%s' symbol without preceding function" -msgstr "" +msgstr "символ «%s» без предшествующей функции" -#: config/obj-coff.c:760 +#: config/obj-coff.c:755 #, c-format msgid "unexpected storage class %d" msgstr "неожиданный класс хранения %d" -#: config/obj-coff.c:868 +#: config/obj-coff.c:863 msgid ".dim pseudo-op used outside of .def/.endef: ignored." msgstr "Псевдооперация .dim используется вне .def/.endef: игнорируется." -#: config/obj-coff.c:888 +#: config/obj-coff.c:883 msgid "badly formed .dim directive ignored" msgstr "неправильный формат директивы .dim: игнорируется" -#: config/obj-coff.c:937 -msgid ".size pseudo-op used outside of .def/.endef ignored." +#: config/obj-coff.c:932 +msgid ".size pseudo-op used outside of .def/.endef: ignored." msgstr "Псевдооперация .size используется вне .def/.endef: игнорируется." -#: config/obj-coff.c:952 -msgid ".scl pseudo-op used outside of .def/.endef ignored." +#: config/obj-coff.c:947 +msgid ".scl pseudo-op used outside of .def/.endef: ignored." msgstr "Псевдооперация .scl используется вне .def/.endef: игнорируется." -#: config/obj-coff.c:969 -msgid ".tag pseudo-op used outside of .def/.endef ignored." +#: config/obj-coff.c:964 +msgid ".tag pseudo-op used outside of .def/.endef: ignored." msgstr "Псевдооперация .tag используется вне .def/.endef: игнорируется." -#: config/obj-coff.c:987 +#: config/obj-coff.c:981 #, c-format msgid "tag not found for .tag %s" msgstr "метка не найдена для .tag %s" -#: config/obj-coff.c:1000 -msgid ".type pseudo-op used outside of .def/.endef ignored." +#: config/obj-coff.c:994 +msgid ".type pseudo-op used outside of .def/.endef: ignored." msgstr "Псевдооперация .type используется вне .def/.endef: игнорируется." -#: config/obj-coff.c:1019 -msgid ".val pseudo-op used outside of .def/.endef ignored." +#: config/obj-coff.c:1013 +msgid ".val pseudo-op used outside of .def/.endef: ignored." msgstr "Псевдооперация .val используется вне .def/.endef: игнорируется." -#: config/obj-coff.c:1186 +#: config/obj-coff.c:1160 msgid "badly formed .weak directive ignored" msgstr "неправильный формат директивы.weak: игнорируется" -#: config/obj-coff.c:1364 +#: config/obj-coff.c:1338 msgid "mismatched .eb" msgstr "непарная .eb" -#: config/obj-coff.c:1385 +#: config/obj-coff.c:1361 #, c-format msgid "C_EFCN symbol for %s out of scope" -msgstr "" +msgstr "Символ C_EFCN для %s вне области" -#: config/obj-coff.c:1439 +#: config/obj-coff.c:1415 #, c-format msgid "Warning: internal error: forgetting to set endndx of %s" msgstr "Предупреждение: внутренняя ошибка: забыли установить endndx для %s" @@ -713,13070 +858,17668 @@ msgstr "Предупреждение: внутренняя ошибка: заб #. STYP_INFO #. STYP_LIB #. STYP_OVER -#: config/obj-coff.c:1662 +#: config/obj-coff.c:1646 #, c-format msgid "unsupported section attribute '%c'" msgstr "неподдерживаемый атрибут раздела %c" -#: config/obj-coff.c:1666 config/tc-ppc.c:4841 +#: config/obj-coff.c:1650 config/tc-ppc.c:5629 #, c-format msgid "unknown section attribute '%c'" msgstr "неизвестный атрибут раздела %c" -#: config/obj-coff.c:1706 +#: config/obj-coff.c:1693 config/obj-macho.c:267 #, c-format msgid "Ignoring changed section attributes for %s" msgstr "Игнорируются изменённые атрибуты раздела для %s" -#: config/obj-coff.c:1836 +#: config/obj-coff.c:1831 #, c-format msgid "0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n" msgstr "0x%lx: \"%s\" тип = %ld, класс = %d, сегмент = %d\n" -#: config/obj-ecoff.c:125 +#: config/obj-ecoff.c:124 msgid "Can't set GP value" msgstr "Не удалось установить значение GP" -#: config/obj-ecoff.c:132 +#: config/obj-ecoff.c:131 msgid "Can't set register masks" msgstr "Не удалось установить значение регистра масок" -#: config/obj-elf.c:334 config/tc-sparc.c:3950 config/tc-v850.c:450 +#: config/obj-elf.c:348 config/tc-sparc.c:4564 config/tc-v850.c:511 #, c-format msgid "bad .common segment %s" msgstr "неправильный сегмент .common %s" -#: config/obj-elf.c:612 +#: config/obj-elf.c:424 +msgid "Missing symbol name in directive" +msgstr "В директиве пропущено имя символа" + +#: config/obj-elf.c:646 #, c-format msgid "setting incorrect section type for %s" msgstr "установка некорректного типа раздела для %s" -#: config/obj-elf.c:617 +#: config/obj-elf.c:651 #, c-format msgid "ignoring incorrect section type for %s" msgstr "игнорируется некорректный тип раздела для %s" -#: config/obj-elf.c:659 +#: config/obj-elf.c:702 #, c-format msgid "setting incorrect section attributes for %s" msgstr "установка некорректных атрибутов раздела для %s" #: config/obj-elf.c:713 #, c-format +msgid "SHF_ALLOC isn't set for GNU_MBIND section: %s" +msgstr "в разделе GNU_MBIND не задан SHF_ALLOC: %s" + +#: config/obj-elf.c:762 +#, c-format msgid "ignoring changed section type for %s" msgstr "игнорируется изменение типа раздела для %s" -#: config/obj-elf.c:725 +#: config/obj-elf.c:774 #, c-format msgid "ignoring changed section attributes for %s" msgstr "игнорируется изменение атрибутов раздела для %s" -#: config/obj-elf.c:727 +#: config/obj-elf.c:781 #, c-format msgid "ignoring changed section entity size for %s" msgstr "игнорируется изменение размера элементов раздела для %s" -#: config/obj-elf.c:780 -msgid "unrecognized .section attribute: want a,w,x,M,S,G,T" -msgstr "нераспознанный атрибут .section: должно быть a,w,x,M,S,G,T" +#: config/obj-elf.c:845 +msgid "unrecognized .section attribute: want a,e,w,x,M,S,G,T or number" +msgstr "нераспознанный атрибут .section: должно быть a,e,w,x,M,S,G,T или число" + +#: config/obj-elf.c:905 +msgid "extraneous characters at end of numeric section type" +msgstr "посторонние символы в конце раздела числового типа" -#: config/obj-elf.c:822 read.c:2780 +#: config/obj-elf.c:911 read.c:2944 msgid "unrecognized section type" msgstr "нераспознанный тип раздела" -#: config/obj-elf.c:852 +#: config/obj-elf.c:943 msgid "unrecognized section attribute" msgstr "нераспознанный атрибут раздела" -#: config/obj-elf.c:883 config/tc-alpha.c:4190 +#: config/obj-elf.c:974 config/tc-alpha.c:4208 msgid "missing name" msgstr "пропущено имя" -#: config/obj-elf.c:1012 +#: config/obj-elf.c:1134 msgid "invalid merge entity size" -msgstr "" +msgstr "некорректное слияние размера элемента" -#: config/obj-elf.c:1019 +#: config/obj-elf.c:1141 msgid "entity size for SHF_MERGE not specified" -msgstr "" +msgstr "не задан размер элемента SHF_MERGE" -#: config/obj-elf.c:1039 +#: config/obj-elf.c:1147 +msgid "? section flag ignored with G present" +msgstr "флаг раздела ? игнорируется, если установлен G" + +#: config/obj-elf.c:1171 msgid "group name for SHF_GROUP not specified" msgstr "не задано имя группы для SHF_GROUP" -#: config/obj-elf.c:1052 +#: config/obj-elf.c:1196 +#, c-format +msgid "unsupported mbind section info: %s" +msgstr "неподдерживаемая информация раздела mbind: %s" + +#: config/obj-elf.c:1211 msgid "character following name is not '#'" -msgstr "символ после имени не #" +msgstr "символ после имени не «#»" -#: config/obj-elf.c:1171 +#: config/obj-elf.c:1331 msgid ".previous without corresponding .section; ignored" msgstr ".previous без соответствующей .section; игнорируется" -#: config/obj-elf.c:1197 +#: config/obj-elf.c:1357 msgid ".popsection without corresponding .pushsection; ignored" msgstr ".popsection без соответствующей .pushsection; игнорируется" -#: config/obj-elf.c:1249 +#: config/obj-elf.c:1403 msgid "expected comma after name in .symver" msgstr "ожидается запятая после имени в .symver" -#: config/obj-elf.c:1273 +#: config/obj-elf.c:1419 config/obj-elf.c:2291 +#, c-format +msgid "`%s' can't be versioned to common symbol '%s'" +msgstr "«%s» не может иметь версии для общего символа «%s»" + +#: config/obj-elf.c:1434 #, c-format msgid "missing version name in `%s' for symbol `%s'" -msgstr "пропущено имя версии в %s для символа %s" +msgstr "пропущено имя версии в «%s» для символа «%s»" -#: config/obj-elf.c:1284 +#: config/obj-elf.c:1445 #, c-format msgid "multiple versions [`%s'|`%s'] for symbol `%s'" -msgstr "несколько версий [%s|%s] для символа %s" +msgstr "несколько версий [«%s»|«%s»] для символа «%s»" -#: config/obj-elf.c:1321 +#: config/obj-elf.c:1481 #, c-format msgid "expected `%s' to have already been set for .vtable_inherit" -msgstr "" +msgstr "ожидается «%s» для уже заданной .vtable_inherit" -#: config/obj-elf.c:1331 +#: config/obj-elf.c:1491 msgid "expected comma after name in .vtable_inherit" msgstr "ожидается запятая после имени в .vtable_inherit" -#: config/obj-elf.c:1391 +#: config/obj-elf.c:1543 msgid "expected comma after name in .vtable_entry" msgstr "ожидается запятая после имени в .vtable_entry" -#: config/obj-elf.c:1514 +#: config/obj-elf.c:1673 +#, c-format +msgid "Attribute name not recognised: %s" +msgstr "Не распознано имя атрибута: %s" + +#: config/obj-elf.c:1690 +msgid "expected numeric constant" +msgstr "ожидается числовая константа" + +#: config/obj-elf.c:1699 config/tc-arm.c:6473 +msgid "expected comma" +msgstr "ожидается запятая" + +#: config/obj-elf.c:1732 +msgid "bad string constant" +msgstr "некорректная строковая константа" + +#: config/obj-elf.c:1736 +msgid "expected , " +msgstr "ожидается <метка> , <значение>" + +#: config/obj-elf.c:1856 msgid "expected quoted string" msgstr "ожидается строка в кавычках" -#: config/obj-elf.c:1534 +#: config/obj-elf.c:1876 #, c-format msgid "expected comma after name `%s' in .size directive" -msgstr "ожидается запятая после имени %s в директиве .size" +msgstr "ожидается запятая после имени «%s» в директиве .size" -#: config/obj-elf.c:1543 +#: config/obj-elf.c:1885 msgid "missing expression in .size directive" msgstr "пропущено выражение в директиве .size" -#: config/obj-elf.c:1670 +#: config/obj-elf.c:2008 #, c-format msgid "symbol '%s' is already defined" -msgstr "символ %s уже определён" +msgstr "символ «%s» уже определён" + +#: config/obj-elf.c:2029 +#, c-format +msgid "symbol type \"%s\" is supported only by GNU and FreeBSD targets" +msgstr "тип символа «%s» поддерживается только целями GNU и FreeBSD" -#: config/obj-elf.c:1690 config/obj-elf.c:1702 +#: config/obj-elf.c:2041 #, c-format msgid "symbol type \"%s\" is supported only by GNU targets" -msgstr "тип символа %s поддерживается только целями GNU" +msgstr "тип символа «%s» поддерживается только целями GNU" -#: config/obj-elf.c:1713 +#: config/obj-elf.c:2052 #, c-format msgid "unrecognized symbol type \"%s\"" -msgstr "нераспознанный тип символа %s" +msgstr "нераспознанный тип символа «%s»" -#: config/obj-elf.c:1889 -msgid ".size expression too complicated to fix up" -msgstr "" +#: config/obj-elf.c:2219 config/obj-elf.c:2222 +#, c-format +msgid ".size expression for %s does not evaluate to a constant" +msgstr "из выражения .size для %s не получается константа" -#: config/obj-elf.c:1921 +#: config/obj-elf.c:2256 #, c-format msgid "invalid attempt to declare external version name as default in symbol `%s'" -msgstr "" +msgstr "некорректная попытка объявить внешнее имя версии значением по умолчанию в символе «%s»" -#: config/obj-elf.c:1982 ecoff.c:3598 +#: config/obj-elf.c:2325 ecoff.c:3600 #, c-format msgid "symbol `%s' can not be both weak and common" -msgstr "" +msgstr "символ «%s» не может быть слабым и общим одновременно" -#: config/obj-elf.c:2089 +#: config/obj-elf.c:2437 #, c-format msgid "assuming all members of group `%s' are COMDAT" -msgstr "" +msgstr "предполагаем, что все члены группы «%s» — COMDAT" -#: config/obj-elf.c:2111 +#: config/obj-elf.c:2449 #, c-format msgid "can't create group: %s" -msgstr "" +msgstr "не удалось создать группу: %s" -#: config/obj-elf.c:2221 +#: config/obj-elf.c:2603 #, c-format msgid "failed to set up debugging information: %s" -msgstr "" +msgstr "не удалось задать отладочную информацию: %s" -#: config/obj-elf.c:2241 +#: config/obj-elf.c:2623 #, c-format msgid "can't start writing .mdebug section: %s" -msgstr "" +msgstr "невозможно начать запись раздела .mdebug: %s" -#: config/obj-elf.c:2249 +#: config/obj-elf.c:2631 #, c-format msgid "could not write .mdebug section: %s" -msgstr "" - -#: config/obj-som.c:58 -msgid "Only one .compiler pseudo-op per file!" -msgstr "" - -#: config/obj-som.c:75 config/obj-som.c:146 config/obj-som.c:188 -msgid "Expected quoted string" -msgstr "" +msgstr "невозможно записать раздел .mdebug: %s" -#: config/obj-som.c:88 -msgid ".compiler directive missing language and version" -msgstr "" - -#: config/obj-som.c:98 -msgid ".compiler directive missing version" -msgstr "" - -#: config/obj-som.c:114 +#: config/obj-evax.c:127 #, c-format -msgid "FATAL: Attaching compiler header %s" -msgstr "" +msgid "no entry symbol for global function '%s'" +msgstr "отсутствует входной символ для глобальной функции «%s»" -#: config/obj-som.c:129 -msgid "Only one .version pseudo-op per file!" -msgstr "" - -#: config/obj-som.c:153 +#. make a temp string. +#: config/obj-macho.c:119 #, c-format -msgid "attaching version header %s: %s" -msgstr "" - -#: config/obj-som.c:171 -msgid "Only one .copyright pseudo-op per file!" -msgstr "" +msgid "the %s name '%s' is too long (maximum 16 characters)" +msgstr "слишком длинное %s для имени «%s» (не более 16 символов)" -#: config/obj-som.c:195 +#: config/obj-macho.c:130 #, c-format -msgid "attaching copyright header %s: %s" -msgstr "" +msgid "expected a %s name followed by a `,'" +msgstr "после имени %s ожидается «,»" -#: config/tc-alpha.c:643 +#: config/obj-macho.c:195 #, c-format -msgid "No !literal!%ld was found" -msgstr "" +msgid "cannot override zerofill section type for `%s,%s'" +msgstr "невозможно заместить заполненный нулями тип раздела для «%s,%s»" -#: config/tc-alpha.c:650 +#: config/obj-macho.c:249 #, c-format -msgid "No !tlsgd!%ld was found" -msgstr "" +msgid "failed to set flags for \"%s\": %s" +msgstr "ошибка установки флагов для «%s»: %s" -#: config/tc-alpha.c:657 +#: config/obj-macho.c:340 #, c-format -msgid "No !tlsldm!%ld was found" -msgstr "" +msgid "unknown or invalid section type '%s'" +msgstr "неизвестный или некорректный тип раздела «%s»" -#: config/tc-alpha.c:666 +#: config/obj-macho.c:379 #, c-format -msgid "No ldah !gpdisp!%ld was found" -msgstr "" +msgid "unknown or invalid section attribute '%s'" +msgstr "неизвестный или некорректный атрибут раздела «%s»" -#: config/tc-alpha.c:716 -#, c-format -msgid "too many !literal!%ld for %s" -msgstr "" +#: config/obj-macho.c:400 +msgid "unexpected section size information" +msgstr "неожиданный размер информации раздела" -#: config/tc-alpha.c:746 -#, c-format -msgid "No lda !gpdisp!%ld was found" -msgstr "" +#: config/obj-macho.c:412 +msgid "missing sizeof_stub expression" +msgstr "отсутствует выражение sizeof_stub" -#. Only support one relocation op per insn. -#: config/tc-alpha.c:905 -msgid "More than one relocation op per insn" -msgstr "" +#: config/obj-macho.c:476 config/tc-ia64.c:1083 config/tc-ia64.c:11770 +#: config/tc-score.c:6103 expr.c:1172 expr.c:1325 read.c:1715 +msgid "expected symbol name" +msgstr "ожидается имя символа" -#: config/tc-alpha.c:921 -msgid "No relocation operand" -msgstr "" +#: config/obj-macho.c:489 read.c:494 +msgid "bad or irreducible absolute expression" +msgstr "плохое или неприводимое абсолютное выражение" -#: config/tc-alpha.c:931 -#, c-format -msgid "Unknown relocation operand: !%s" -msgstr "" +#: config/obj-macho.c:495 config/tc-score.c:6120 read.c:1753 +msgid "missing size expression" +msgstr "отсутствует размер выражения" -#: config/tc-alpha.c:941 +#: config/obj-macho.c:504 config/tc-ia64.c:1118 read.c:1759 #, c-format -msgid "no sequence number after !%s" -msgstr "" +msgid "size (%ld) out of range, ignored" +msgstr "размер (%ld) выходит за границы, игнорируется" -#: config/tc-alpha.c:951 +#: config/obj-macho.c:514 config/tc-score.c:6264 dwarf2dbg.c:954 ecoff.c:3359 +#: read.c:1771 read.c:1876 read.c:2627 read.c:3270 read.c:3649 symbols.c:340 +#: symbols.c:436 #, c-format -msgid "!%s does not use a sequence number" -msgstr "" +msgid "symbol `%s' is already defined" +msgstr "символ «%s» уже определён" -#: config/tc-alpha.c:961 +#: config/obj-macho.c:524 read.c:1786 #, c-format -msgid "Bad sequence number: !%s!%s" -msgstr "" +msgid "size of \"%s\" is already %ld; not changing to %ld" +msgstr "размер «%s» уже равен %ld; не изменяется на %ld" -#: config/tc-alpha.c:1176 config/tc-alpha.c:3343 +#: config/obj-macho.c:535 +msgid "align value not recognized, using size" +msgstr "не распознано значение выравнивания, используется размер" + +#: config/obj-macho.c:540 config/obj-macho.c:903 #, c-format -msgid "inappropriate arguments for opcode `%s'" -msgstr "" +msgid "Alignment (%lu) too large: 15 assumed." +msgstr "Выравнивание (%lu) слишком велико: используем 15." -#: config/tc-alpha.c:1178 config/tc-alpha.c:3345 +#: config/obj-macho.c:606 #, c-format -msgid "opcode `%s' not supported for target %s" -msgstr "" +msgid "BFD is out of sync with GAS, unhandled well-known section type `%s'" +msgstr "BFD не синхронизирована с GAS, необработанный всем известный тип раздела «%s»" -#: config/tc-alpha.c:1182 config/tc-alpha.c:3349 config/tc-avr.c:1356 -#: config/tc-msp430.c:1829 +#: config/obj-macho.c:808 #, c-format -msgid "unknown opcode `%s'" -msgstr "" +msgid "%s is not used for the selected target" +msgstr "%s не используется в выбранной цели" -#: config/tc-alpha.c:1263 config/tc-alpha.c:1517 -msgid "overflow in literal (.lita) table" -msgstr "" +#: config/obj-macho.c:873 +msgid "internal error: base section index out of range" +msgstr "внутренняя ошибка: индекс основного раздела вне диапазона" -#: config/tc-alpha.c:1270 config/tc-alpha.c:1294 config/tc-alpha.c:1530 -#: config/tc-alpha.c:2215 config/tc-alpha.c:2260 config/tc-alpha.c:2329 -#: config/tc-alpha.c:2412 config/tc-alpha.c:2637 config/tc-alpha.c:2735 -msgid "macro requires $at register while noat in effect" -msgstr "" +#: config/obj-macho.c:959 +#, c-format +msgid "internal error: bad file property ID %d" +msgstr "внутренняя ошибка: некорректный ID (%d) свойства файла" -#: config/tc-alpha.c:1272 config/tc-alpha.c:1296 config/tc-alpha.c:1532 -msgid "macro requires $at while $at in use" -msgstr "" +#: config/obj-macho.c:967 +msgid "failed to set subsections by symbols" +msgstr "не удалось задать подразделы символами" -#: config/tc-alpha.c:1475 -msgid "bignum invalid; zero assumed" -msgstr "" +#: config/obj-macho.c:1030 +#, c-format +msgid "'%s' previously declared as '%s'." +msgstr "«%s» ранее объявлена как «%s»." -#: config/tc-alpha.c:1477 -msgid "floating point number invalid; zero assumed" -msgstr "" +#: config/obj-macho.c:1082 config/obj-macho.c:1402 config/obj-macho.c:1486 +#, c-format +msgid "'%s' can't be a weak_definition (currently only supported in sections of type coalesced)" +msgstr "«%s» не может быть weak_definition (пока поддерживается только в разделах с типом coalesced)" -#: config/tc-alpha.c:1482 -msgid "can't handle expression" -msgstr "" +#: config/obj-macho.c:1167 +msgid "use of .indirect_symbols requires `-dynamic'" +msgstr "при использовании .indirect_symbols требуется «-dynamic»" -#: config/tc-alpha.c:1523 -msgid "overflow in literal (.lit8) table" -msgstr "" +#: config/obj-macho.c:1184 +#, c-format +msgid "attempt to add an indirect_symbol to a stub or reference section with a zero-sized element at %s" +msgstr "попытка добавить indirect_symbol в раздел заглушек или ссылок с нулевым размером элемента в %s" + +#: config/obj-macho.c:1214 +msgid "an .indirect_symbol must be in a symbol pointer or stub section." +msgstr ".indirect_symbol должен быть в разделе указателей на символы или заглушки." -#: config/tc-alpha.c:1819 +#: config/obj-macho.c:1483 #, c-format -msgid "too many ldah insns for !gpdisp!%ld" -msgstr "" +msgid "'%s' can't be a weak_definition (since it is undefined)" +msgstr "«%s» не может быть weak_definition (так как не определён)" -#: config/tc-alpha.c:1821 config/tc-alpha.c:1833 +#: config/obj-macho.c:1489 #, c-format -msgid "both insns for !gpdisp!%ld must be in the same section" -msgstr "" +msgid "Non-global symbol: '%s' can't be a weak_definition." +msgstr "Не глобальный символ: «%s» не может быть weak_definition." -#: config/tc-alpha.c:1831 +#: config/obj-macho.c:1495 #, c-format -msgid "too many lda insns for !gpdisp!%ld" -msgstr "" +msgid "internal error: [%s] unexpected code [%lx] in frob symbol" +msgstr "внутренняя ошибка: [%s] неожиданный код [%lx] в символе frob" -#: config/tc-alpha.c:1887 +#: config/obj-macho.c:1536 #, c-format -msgid "too many lituse insns for !lituse_tlsgd!%ld" -msgstr "" +msgid "unrecognized stab type '%c'" +msgstr "нераспознанный тип stab «%c»" -#: config/tc-alpha.c:1890 +#: config/obj-macho.c:1587 #, c-format -msgid "too many lituse insns for !lituse_tlsldm!%ld" -msgstr "" +msgid "`%s' can't be undefined in `%s' - `%s' {%s section}" +msgstr "«%s» должен быть определён в «%s» — «%s» {раздел %s}" -#: config/tc-alpha.c:1907 +#: config/obj-macho.c:1595 #, c-format -msgid "duplicate !tlsgd!%ld" -msgstr "" +msgid "`%s' can't be undefined in `%s' {%s section} - `%s'" +msgstr "«%s» должен быть определён в «%s» {раздел «%s»} — «%s»" -#: config/tc-alpha.c:1909 +#: config/obj-macho.c:1602 #, c-format -msgid "sequence number in use for !tlsldm!%ld" -msgstr "" +msgid "`%s' and `%s' can't be undefined in `%s' - `%s'" +msgstr "«%s» и «%s» должны быть определены в «%s» — «%s»" -#: config/tc-alpha.c:1923 +#: config/obj-macho.c:1804 #, c-format -msgid "duplicate !tlsldm!%ld" -msgstr "" +msgid "the number of .indirect_symbols defined in section %s does not match the number expected (%d defined, %d expected)" +msgstr "номер .indirect_symbols, определённый в разделе %s, не совпадает с ожидаемым (определён %d, ожидается %d)" -#: config/tc-alpha.c:1925 +#: config/obj-macho.c:1824 #, c-format -msgid "sequence number in use for !tlsgd!%ld" -msgstr "" +msgid "internal error: failed to allocate %d indirectsymbol pointers" +msgstr "внутренняя ошибка: не удалось выделить %d указателей indirectsymbol" -#: config/tc-alpha.c:1980 config/tc-arc.c:292 config/tc-mn10200.c:856 -#: config/tc-mn10300.c:1146 config/tc-ppc.c:1676 config/tc-s390.c:604 -#: config/tc-v850.c:1556 -msgid "operand" -msgstr "" +#: config/obj-macho.c:1838 config/obj-macho.c:1861 +msgid "internal error: more indirect mach-o symbols than expected" +msgstr "внутренняя ошибка: неявных символов mach-o больше, чем ожидалось" -#: config/tc-alpha.c:2119 -msgid "invalid relocation for instruction" -msgstr "" +#: config/obj-som.c:56 +msgid "Only one .compiler pseudo-op per file!" +msgstr "Только одна псевдооперация .compiler на файл!" -#: config/tc-alpha.c:2132 -msgid "invalid relocation for field" -msgstr "" +#: config/obj-som.c:73 config/obj-som.c:144 config/obj-som.c:186 +msgid "Expected quoted string" +msgstr "Ожидается строка в кавычках" -#: config/tc-alpha.c:2961 -msgid "can not resolve expression" -msgstr "" +#: config/obj-som.c:86 +msgid ".compiler directive missing language and version" +msgstr "у директивы .compiler не указан язык и версия" + +#: config/obj-som.c:96 +msgid ".compiler directive missing version" +msgstr "у директивы .compiler не указана версия" -#: config/tc-alpha.c:3503 config/tc-i370.c:1058 config/tc-microblaze.c:187 -#: config/tc-ppc.c:2000 config/tc-ppc.c:4604 +#: config/obj-som.c:112 #, c-format -msgid ".COMMon length (%ld.) <0! Ignored." -msgstr "" +msgid "FATAL: Attaching compiler header %s" +msgstr "ОСТАНОВ: присоединение заголовка компилятора %s" -#: config/tc-alpha.c:3514 config/tc-sparc.c:3820 config/tc-v850.c:245 -msgid "Ignoring attempt to re-define symbol" -msgstr "" +#: config/obj-som.c:127 +msgid "Only one .version pseudo-op per file!" +msgstr "Только одна псевдооперация .version на файл!" -#: config/tc-alpha.c:3606 config/tc-ppc.c:4641 config/tc-sparc.c:3828 +#: config/obj-som.c:151 #, c-format -msgid "Length of .comm \"%s\" is already %ld. Not changed to %ld." -msgstr "" +msgid "attaching version header %s: %s" +msgstr "присоединение заголовка версии %s: %s" -#: config/tc-alpha.c:3713 ecoff.c:3054 -msgid ".ent directive has no name" -msgstr "" +#: config/obj-som.c:169 +msgid "Only one .copyright pseudo-op per file!" +msgstr "Только одна псевдооперация .copyright на файл!" -#: config/tc-alpha.c:3721 -msgid "nested .ent directives" -msgstr "" +#: config/obj-som.c:193 +#, c-format +msgid "attaching copyright header %s: %s" +msgstr "присоединение заголовка авторских прав %s: %s" -#: config/tc-alpha.c:3765 ecoff.c:3005 -msgid ".end directive has no name" -msgstr "" +#: config/tc-aarch64.c:373 +msgid "integer 32-bit register expected" +msgstr "ожидается целочисленный 32-битный регистр" -#: config/tc-alpha.c:3774 -msgid ".end directive without matching .ent" -msgstr "" +#: config/tc-aarch64.c:376 +msgid "integer 64-bit register expected" +msgstr "ожидается целочисленный 64-битный регистр" -#: config/tc-alpha.c:3776 -msgid ".end directive names different symbol than .ent" -msgstr "" +#: config/tc-aarch64.c:379 +msgid "integer register expected" +msgstr "ожидается целочисленный регистр" -#: config/tc-alpha.c:3819 ecoff.c:3140 -msgid ".fmask outside of .ent" -msgstr "" +#: config/tc-aarch64.c:382 +msgid "64-bit integer or SP register expected" +msgstr "ожидается целочисленный 64-битный регистр или регистр SP" -#: config/tc-alpha.c:3821 config/tc-score.c:5602 ecoff.c:3204 -msgid ".mask outside of .ent" -msgstr "" +#: config/tc-aarch64.c:385 config/tc-mcore.c:839 config/tc-mcore.c:1355 +#: config/tc-mcore.c:1409 +msgid "base register expected" +msgstr "ожидается базовый регистр" -#: config/tc-alpha.c:3829 ecoff.c:3147 -msgid "bad .fmask directive" -msgstr "" +#: config/tc-aarch64.c:388 +msgid "integer or zero register expected" +msgstr "ожидается целочисленный регистр или ноль" -#: config/tc-alpha.c:3831 ecoff.c:3211 -msgid "bad .mask directive" -msgstr "" +#: config/tc-aarch64.c:391 +msgid "offset register expected" +msgstr "ожидается регистр смещения" -#: config/tc-alpha.c:3864 config/tc-mips.c:15074 config/tc-score.c:5744 -#: ecoff.c:3168 -msgid ".frame outside of .ent" -msgstr "" +#: config/tc-aarch64.c:394 +msgid "integer or SP register expected" +msgstr "ожидается целочисленный регистр или регистр SP" -#: config/tc-alpha.c:3875 ecoff.c:3179 -msgid "bad .frame directive" -msgstr "" +#: config/tc-aarch64.c:397 +msgid "integer, zero or SP register expected" +msgstr "ожидается целочисленный регистр, ноль или регистр SP" -#: config/tc-alpha.c:3909 -msgid ".prologue directive without a preceding .ent directive" -msgstr "" +#: config/tc-aarch64.c:400 +msgid "8-bit SIMD scalar register expected" +msgstr "8-ожидается скалярный 8-битный регистр SIMD" + +#: config/tc-aarch64.c:403 +msgid "16-bit SIMD scalar or floating-point half precision register expected" +msgstr "ожидается скалярный 16-битный регистр SIMD или регистр плавающей запятой половинной точности" + +#: config/tc-aarch64.c:407 +msgid "32-bit SIMD scalar or floating-point single precision register expected" +msgstr "ожидается скалярный 32-битный регистр SIMD или регистр плавающей запятой одинарной точности" + +#: config/tc-aarch64.c:411 +msgid "64-bit SIMD scalar or floating-point double precision register expected" +msgstr "ожидается скалярный 64-битный регистр SIMD или регистр плавающей запятой двойной точности" -#: config/tc-alpha.c:3927 +#: config/tc-aarch64.c:415 +msgid "128-bit SIMD scalar or floating-point quad precision register expected" +msgstr "ожидается скалярный 128-битный регистр SIMD или регистр плавающей запятой четверной точности" + +#: config/tc-aarch64.c:420 config/tc-arm.c:4401 +msgid "register expected" +msgstr "ожидается регистр" + +#. any [BHSDQ]P FP +#: config/tc-aarch64.c:423 +msgid "SIMD scalar or floating-point register expected" +msgstr "ожидается скалярный регистр SIMD или регистр плавающей запятой" + +#. any V reg +#: config/tc-aarch64.c:426 +msgid "vector register expected" +msgstr "ожидается векторный регистр" + +#: config/tc-aarch64.c:429 +msgid "SVE vector register expected" +msgstr "ожидается векторный регистр SVE" + +#: config/tc-aarch64.c:432 +msgid "SVE predicate register expected" +msgstr "ожидается предикатный регистр SVE" + +#: config/tc-aarch64.c:435 #, c-format -msgid "Invalid argument %d to .prologue." -msgstr "" +msgid "invalid register type %d" +msgstr "некорректный тип регистра %d" -#: config/tc-alpha.c:4018 -msgid "ECOFF debugging is disabled." -msgstr "" +#: config/tc-aarch64.c:595 config/tc-aarch64.c:597 config/tc-arm.c:1061 +#: config/tc-score.c:6514 expr.c:1385 read.c:2609 +msgid "bad expression" +msgstr "неправильное выражение" -#: config/tc-alpha.c:4032 -msgid ".ent directive without matching .end" -msgstr "" +#: config/tc-aarch64.c:607 config/tc-arm.c:1072 config/tc-i860.c:1003 +#: config/tc-sparc.c:3440 +msgid "bad segment" +msgstr "неправильный сегмент" -#: config/tc-alpha.c:4117 -msgid ".usepv directive has no name" -msgstr "" +#: config/tc-aarch64.c:825 +#, c-format +msgid "bad size %d in vector width specifier" +msgstr "неправильный размер %d в определителе ширины вектора" -#: config/tc-alpha.c:4128 -msgid ".usepv directive has no type" -msgstr "" +#: config/tc-aarch64.c:858 +#, c-format +msgid "unexpected character `%c' in element size" +msgstr "неожиданный символ «%c» в элементе размера" -#: config/tc-alpha.c:4143 -msgid "unknown argument for .usepv" -msgstr "" +#: config/tc-aarch64.c:860 +msgid "missing element size" +msgstr "отсутствует размер элемента" -#: config/tc-alpha.c:4250 +#: config/tc-aarch64.c:869 #, c-format -msgid "unknown section attribute %s" -msgstr "" +msgid "invalid element size %d and vector size combination %c" +msgstr "некорректная комбинация размера элемента %d и размера вектора %c" -#: config/tc-alpha.c:4361 -msgid ".ent directive has no symbol" -msgstr "" +#: config/tc-aarch64.c:904 +#, c-format +msgid "unexpected character `%c' in predication type" +msgstr "неожиданный символ «%c» в типе предиката" -#: config/tc-alpha.c:4390 -msgid ".handler directive has no name" -msgstr "" +#: config/tc-aarch64.c:907 +msgid "missing predication type" +msgstr "отсутствует тип предиката" -#: config/tc-alpha.c:4419 -msgid "Bad .frame directive 1./2. param" -msgstr "" +#: config/tc-aarch64.c:1002 +msgid "this type of register can't be indexed" +msgstr "этот тип регистра невозможно проиндексировать" -#: config/tc-alpha.c:4431 -msgid "Bad .frame directive 3./4. param" -msgstr "" +#: config/tc-aarch64.c:1008 +msgid "index not allowed inside register list" +msgstr "внутри списка регистров индекс не допускается" -#: config/tc-alpha.c:4466 -msgid ".pdesc directive not in link (.link) section" -msgstr "" +#: config/tc-aarch64.c:1018 config/tc-aarch64.c:1966 config/tc-aarch64.c:2155 +#: config/tc-arm.c:1569 config/tc-arm.c:3681 config/tc-arm.c:4798 +msgid "constant expression required" +msgstr "требуется константное выражение" -#: config/tc-alpha.c:4474 -msgid ".pdesc directive has no entry symbol" -msgstr "" +#. Indexed vector register expected. +#: config/tc-aarch64.c:1030 +msgid "indexed vector register expected" +msgstr "ожидается индексированный векторный регистр" -#: config/tc-alpha.c:4492 -msgid ".pdesc has no matching .ent" -msgstr "" +#: config/tc-aarch64.c:1037 +msgid "invalid use of vector register" +msgstr "некорректное использование векторного регистра" -#: config/tc-alpha.c:4510 -msgid "No comma after .pdesc " -msgstr "" +#: config/tc-aarch64.c:1129 config/tc-arm.c:1837 +msgid "expecting {" +msgstr "ожидается {" -#: config/tc-alpha.c:4530 -msgid "unknown procedure kind" -msgstr "" +#: config/tc-aarch64.c:1154 +msgid "invalid vector register in list" +msgstr "в списке некорректный векторный регистр" -#: config/tc-alpha.c:4642 -msgid ".name directive not in link (.link) section" -msgstr "" +#: config/tc-aarch64.c:1161 +msgid "invalid scalar register in list" +msgstr "в списке некорректный скалярный регистр" -#: config/tc-alpha.c:4650 -msgid ".name directive has no symbol" -msgstr "" +#: config/tc-aarch64.c:1174 +msgid "invalid range in vector register list" +msgstr "некорректный диапазон в списке векторных регистров" -#: config/tc-alpha.c:4682 -msgid "No symbol after .linkage" -msgstr "" +#: config/tc-aarch64.c:1187 +msgid "type mismatch in vector register list" +msgstr "несовпадение типа в списке векторных регистров" -#: config/tc-alpha.c:4732 -msgid "No symbol after .code_address" -msgstr "" +#: config/tc-aarch64.c:1204 +msgid "end of vector register list not found" +msgstr "не найден конец списка векторных регистров" -#: config/tc-alpha.c:4759 config/tc-score.c:5608 -msgid "Bad .mask directive" -msgstr "" +#: config/tc-aarch64.c:1220 +msgid "constant expression required." +msgstr "требуется константное выражение." -#: config/tc-alpha.c:4777 -msgid "Bad .fmask directive" -msgstr "" +#: config/tc-aarch64.c:1230 +msgid "expected index" +msgstr "ожидается индекс" -#: config/tc-alpha.c:4934 -#, c-format -msgid "Expected comma after name \"%s\"" -msgstr "" +#: config/tc-aarch64.c:1237 +msgid "too many registers in vector register list" +msgstr "слишком много регистров в списке векторных регистров" -#. *symbol_get_obj (symbolP) = (signed char) temp; -#: config/tc-alpha.c:4945 -#, c-format -msgid "unhandled: .proc %s,%d" -msgstr "" +#: config/tc-aarch64.c:1242 +msgid "empty vector register list" +msgstr "список векторных регистров пуст" -#: config/tc-alpha.c:4979 +#: config/tc-aarch64.c:1264 config/tc-arm.c:2223 #, c-format -msgid "Tried to .set unrecognized mode `%s'" -msgstr "" +msgid "ignoring attempt to redefine built-in register '%s'" +msgstr "игнорируется попытка переопределить встроенный регистр «%s»" -#: config/tc-alpha.c:5005 +#: config/tc-aarch64.c:1270 config/tc-arm.c:2228 #, c-format -msgid "Bad base register, using $%d." -msgstr "" +msgid "ignoring redefinition of register alias '%s'" +msgstr "игнорируется переопределение псевдонима регистра «%s»" -#: config/tc-alpha.c:5026 +#: config/tc-aarch64.c:1316 config/tc-arm.c:2294 #, c-format -msgid "Alignment too large: %d. assumed" -msgstr "" +msgid "unknown register '%s' -- .req ignored" +msgstr "неизвестный регистр «%s» — .req игнорируется" -#: config/tc-alpha.c:5030 config/tc-d30v.c:2048 -msgid "Alignment negative: 0 assumed" -msgstr "" +#: config/tc-aarch64.c:1374 config/tc-arm.c:2502 +msgid "invalid syntax for .req directive" +msgstr "некорректный синтаксис директивы .req" -#: config/tc-alpha.c:5124 config/tc-alpha.c:5617 -#, c-format -msgid "Unknown CPU identifier `%s'" -msgstr "" +#: config/tc-aarch64.c:1399 config/tc-arm.c:2540 +msgid "invalid syntax for .unreq directive" +msgstr "некорректный синтаксис директивы .unreq" -#: config/tc-alpha.c:5315 +#: config/tc-aarch64.c:1405 config/tc-arm.c:2547 #, c-format -msgid "Chose GP value of %lx\n" -msgstr "" - -#: config/tc-alpha.c:5329 -msgid "Bad .section directive: want a,s,w,x,M,S,G,T in string" -msgstr "" +msgid "unknown register alias '%s'" +msgstr "неизвестный псевдоним регистра «%s»" -#: config/tc-alpha.c:5418 +#: config/tc-aarch64.c:1407 #, c-format -msgid "internal error: can't hash opcode `%s': %s" -msgstr "" +msgid "ignoring attempt to undefine built-in register '%s'" +msgstr "игнорируется попытка удалить определение встроенного регистра «%s»" -#: config/tc-alpha.c:5454 -#, c-format -msgid "internal error: can't hash macro `%s': %s" -msgstr "" +#: config/tc-aarch64.c:1731 config/tc-arm.c:3293 config/tc-arm.c:3320 +#: config/tc-arm.c:3333 +msgid "literal pool overflow" +msgstr "переполнение пула литералов" -#: config/tc-alpha.c:5539 config/tc-arm.c:6439 config/tc-arm.c:6451 -#: config/tc-i960.c:708 config/tc-xtensa.c:5294 config/tc-xtensa.c:5372 -#: config/tc-xtensa.c:5490 config/tc-z80.c:1893 -msgid "syntax error" -msgstr "" +#: config/tc-aarch64.c:1913 config/tc-aarch64.c:5916 config/tc-arm.c:3554 +#: config/tc-arm.c:6996 +msgid "unrecognized relocation suffix" +msgstr "нераспознанный суффикс перемещения" -#: config/tc-alpha.c:5668 -msgid "" -"Alpha options:\n" -"-32addr\t\t\ttreat addresses as 32-bit values\n" -"-F\t\t\tlack floating point instructions support\n" -"-mev4 | -mev45 | -mev5 | -mev56 | -mpca56 | -mev6 | -mev67 | -mev68 | -mall\n" -"\t\t\tspecify variant of Alpha architecture\n" -"-m21064 | -m21066 | -m21164 | -m21164a | -m21164pc | -m21264 | -m21264a | -m21264b\n" -"\t\t\tthese variants include PALcode opcodes\n" -msgstr "" +#: config/tc-aarch64.c:1915 +msgid "unimplemented relocation suffix" +msgstr "нереализованный суффикс перемещения" -#: config/tc-alpha.c:5678 -msgid "" -"VMS options:\n" -"-+\t\t\tencode (don't truncate) names longer than 64 characters\n" -"-H\t\t\tshow new symbol after hash truncation\n" -"-replace/-noreplace\tenable or disable the optimization of procedure calls\n" -msgstr "" +#: config/tc-aarch64.c:2123 config/tc-aarch64.c:2316 config/tc-aarch64.c:2374 +msgid "immediate operand required" +msgstr "требуется непосредственный операнд" -#: config/tc-alpha.c:5929 -#, c-format -msgid "unhandled relocation type %s" -msgstr "" +#: config/tc-aarch64.c:2131 +msgid "missing immediate expression" +msgstr "отсутствует непосредственное выражение" -#: config/tc-alpha.c:5942 -msgid "non-absolute expression in constant field" -msgstr "" +#: config/tc-aarch64.c:2354 config/tc-aarch64.c:5740 config/tc-aarch64.c:5760 +msgid "invalid floating-point constant" +msgstr "некорректная константа с плавающей точкой" -#: config/tc-alpha.c:5956 -#, c-format -msgid "type %d reloc done?\n" -msgstr "" +#: config/tc-aarch64.c:2984 config/tc-arm.c:5137 config/tc-arm.c:5146 +msgid "shift expression expected" +msgstr "ожидается выражение сдвига" -#: config/tc-alpha.c:6003 config/tc-alpha.c:6010 -msgid "Used $at without \".set noat\"" -msgstr "" +#: config/tc-aarch64.c:2992 +msgid "shift operator expected" +msgstr "ожидается оператор сдвига" -#: config/tc-alpha.c:6179 -#, c-format -msgid "!samegp reloc against symbol without .prologue: %s" -msgstr "" +#: config/tc-aarch64.c:3000 +msgid "invalid use of 'MSL'" +msgstr "некорректное употребление «MSL»" -#: config/tc-alpha.c:6223 config/tc-xtensa.c:5996 -#, c-format -msgid "cannot represent `%s' relocation in object file" -msgstr "" +#: config/tc-aarch64.c:3008 +msgid "invalid use of 'MUL'" +msgstr "некорректное употребление «MUL»" -#: config/tc-alpha.c:6229 -#, c-format -msgid "internal error? cannot generate `%s' relocation" -msgstr "" +#: config/tc-aarch64.c:3017 +msgid "extending shift is not permitted" +msgstr "расширяющий сдвиг не допускается" -#: config/tc-alpha.c:6336 -#, c-format -msgid "frame reg expected, using $%d." -msgstr "" +#: config/tc-aarch64.c:3025 +msgid "'ROR' shift is not permitted" +msgstr "сдвиг «ROR» не допускается" -#: config/tc-arc.c:194 config/tc-arc.c:215 config/tc-arc.c:991 -#: config/tc-h8300.c:77 config/tc-h8300.c:86 config/tc-h8300.c:96 -#: config/tc-h8300.c:106 config/tc-h8300.c:116 config/tc-h8300.c:127 -#: config/tc-h8300.c:194 config/tc-hppa.c:6820 config/tc-hppa.c:6826 -#: config/tc-hppa.c:6832 config/tc-hppa.c:6838 config/tc-hppa.c:8245 -#: config/tc-mn10300.c:935 config/tc-mn10300.c:940 config/tc-mn10300.c:2433 -#: config/tc-xc16x.c:79 config/tc-xc16x.c:86 config/tc-xc16x.c:93 -msgid "could not set architecture and machine" -msgstr "" +#: config/tc-aarch64.c:3033 +msgid "only 'LSL' shift is permitted" +msgstr "допускается только сдвиг «LSL»" -#: config/tc-arc.c:212 config/tc-arm.c:21296 config/tc-score.c:6304 -#: config/tc-score.c:6533 config/tc-score.c:6538 -msgid "virtual memory exhausted" -msgstr "" +#: config/tc-aarch64.c:3041 +msgid "only 'MUL' is permitted" +msgstr "допускается только «MUL»" -#: config/tc-arc.c:432 config/tc-arc.c:670 -msgid "expected comma after operand name" -msgstr "" +#: config/tc-aarch64.c:3059 +msgid "only 'MUL VL' is permitted" +msgstr "допускается только «MUL VL»" -#: config/tc-arc.c:443 -#, c-format -msgid "negative operand number %d" -msgstr "" +#: config/tc-aarch64.c:3067 +msgid "invalid shift for the register offset addressing mode" +msgstr "некорректный сдвиг регистра режима адресации смещения" -#: config/tc-arc.c:455 -msgid "expected comma after register-number" -msgstr "" +#: config/tc-aarch64.c:3075 +msgid "invalid shift operator" +msgstr "некорректный оператор сдвига" -#: config/tc-arc.c:480 -msgid "invalid mode" -msgstr "" +#: config/tc-aarch64.c:3108 +msgid "missing shift amount" +msgstr "не указан размер сдвига" -#: config/tc-arc.c:497 -msgid "expected comma after register-mode" -msgstr "" +#: config/tc-aarch64.c:3115 +msgid "constant shift amount required" +msgstr "требуется константный размер сдвига" -#: config/tc-arc.c:514 -msgid "shortcut designator invalid" -msgstr "" +#: config/tc-aarch64.c:3124 +msgid "shift amount out of range 0 to 63" +msgstr "размер сдвига вне диапазона от 0 до 63" -#: config/tc-arc.c:529 -#, c-format -msgid "core register value (%d) too large" -msgstr "" +#: config/tc-aarch64.c:3173 +msgid "unexpected shift operator" +msgstr "неожиданный оператор сдвига" -#: config/tc-arc.c:537 -#, c-format -msgid "condition code value (%d) too large" -msgstr "" +#: config/tc-aarch64.c:3209 +msgid "unexpected register in the immediate operand" +msgstr "неожиданный регистр в непосредственном операнде" -#: config/tc-arc.c:554 -#, c-format -msgid "attempt to override symbol: %s" -msgstr "" +#: config/tc-aarch64.c:3234 +msgid "integer register expected in the extended/shifted operand register" +msgstr "ожидается целочисленный регистр в расширенном/сдвигающем регистре-операнде" -#: config/tc-arc.c:625 -msgid "invalid opertype" -msgstr "" +#: config/tc-aarch64.c:3269 config/tc-aarch64.c:3403 config/tc-aarch64.c:3532 +#: config/tc-aarch64.c:3687 config/tc-aarch64.c:3728 +msgid "unknown relocation modifier" +msgstr "неизвестный модификатор перемещения" -#: config/tc-arc.c:682 -msgid "expected comma after opcode" -msgstr "" +#: config/tc-aarch64.c:3276 config/tc-aarch64.c:3422 config/tc-aarch64.c:3539 +#: config/tc-aarch64.c:3694 config/tc-aarch64.c:3735 +msgid "this relocation modifier is not allowed on this instruction" +msgstr "данный модификатор перемещения недопустим для этой инструкции" -#: config/tc-arc.c:692 -#, c-format -msgid "negative subopcode %d" -msgstr "" +#: config/tc-aarch64.c:3430 config/tc-aarch64.c:3550 +msgid "invalid relocation expression" +msgstr "некорректное выражение перемещения" -#: config/tc-arc.c:701 -msgid "subcode value found when opcode not equal 0x03" -msgstr "" +#: config/tc-aarch64.c:3448 +msgid "invalid address" +msgstr "неправильный адрес" -#: config/tc-arc.c:709 -#, c-format -msgid "invalid subopcode %d" -msgstr "" +#: config/tc-aarch64.c:3504 +msgid "invalid use of 32-bit register offset" +msgstr "некорректное использование 32-битного регистра смещения" -#: config/tc-arc.c:720 -msgid "expected comma after subopcode" -msgstr "" +#: config/tc-aarch64.c:3510 +msgid "offset has different size from base" +msgstr "смещение имеет размер отличный от базы" -#: config/tc-arc.c:739 -msgid "invalid suffix class" -msgstr "" +#: config/tc-aarch64.c:3516 +msgid "invalid use of 64-bit register offset" +msgstr "некорректное использование 64-битного регистра смещения" -#: config/tc-arc.c:748 -msgid "expected comma after suffix class" -msgstr "" +#. [Xn],#expr +#: config/tc-aarch64.c:3563 config/tc-aarch64.c:3620 +msgid "invalid expression in the address" +msgstr "некорректное выражение в адресе" -#: config/tc-arc.c:767 -msgid "invalid syntax class" -msgstr "" +#: config/tc-aarch64.c:3577 config/tc-arm.c:5673 config/tc-arm.c:6251 +msgid "']' expected" +msgstr "ожидается «]»" -#: config/tc-arc.c:774 -msgid "opcode 0x3 and SYNTAX_3OP invalid" -msgstr "" +#: config/tc-aarch64.c:3585 +msgid "register offset not allowed in pre-indexed addressing mode" +msgstr "регистр смещения не допускается в режиме адресации с предваряющим индексом" -#: config/tc-arc.c:794 -msgid "unknown suffix class" -msgstr "" +#: config/tc-aarch64.c:3600 config/tc-arm.c:5709 +msgid "cannot combine pre- and post-indexing" +msgstr "не удалось объединить пре и пост индексацию" -#: config/tc-arc.c:861 -msgid "expected comma after symbol name" -msgstr "" +#. Reject [Rn]! +#: config/tc-aarch64.c:3632 +msgid "missing offset in the pre-indexed address" +msgstr "отсутствует смещение в адресе с предваряющим индексом" -#: config/tc-arc.c:871 -msgid "negative symbol length" -msgstr "" +#: config/tc-aarch64.c:3861 +msgid "unknown or missing option to PSB" +msgstr "неизвестный или отсутствующий параметр у PSB" -#: config/tc-arc.c:882 -msgid "ignoring attempt to re-define symbol" -msgstr "" +#: config/tc-aarch64.c:3869 +msgid "the specified option is not accepted for PSB" +msgstr "указанный параметр неприемлем для PSB" -#: config/tc-arc.c:889 +#: config/tc-aarch64.c:3926 #, c-format -msgid "length of symbol \"%s\" already %ld, ignoring %d" -msgstr "" - -#: config/tc-arc.c:903 -msgid "assuming symbol alignment of zero" -msgstr "" +msgid "selected processor does not support PSTATE field name '%s'" +msgstr "выбранный процессор не поддерживает имя поля PSTATE «%s»" -#: config/tc-arc.c:970 -msgid "\".option\" directive must appear before any instructions" -msgstr "" +#: config/tc-aarch64.c:3929 config/tc-aarch64.c:3962 +#, c-format +msgid "selected processor does not support system register name '%s'" +msgstr "выбранный процессор не поддерживает имя системного регистра «%s»" -#: config/tc-arc.c:980 -msgid "\".option\" directive conflicts with initial definition" -msgstr "" +#: config/tc-aarch64.c:3932 +#, c-format +msgid "system register name '%s' is deprecated and may be removed in a future release" +msgstr "имя системного регистра «%s» устарело и может быть удалено в будущих выпусках" -#: config/tc-arc.c:988 -msgid "\".option\" directive overrides command-line (default) value" -msgstr "" +#: config/tc-aarch64.c:4004 +msgid "immediate value out of range " +msgstr "непосредственное значение за пределами диапазона" -#: config/tc-arc.c:998 -msgid "invalid identifier for \".option\"" -msgstr "" +#: config/tc-aarch64.c:4512 +#, c-format +msgid "Info: " +msgstr "Информация:" -#: config/tc-arc.c:1036 config/tc-i860.c:1034 config/tc-ip2k.c:249 -msgid "relaxation not supported\n" -msgstr "" +#: config/tc-aarch64.c:4545 config/tc-score.c:2750 config/tc-score.c:6503 +#, c-format +msgid "%s -- `%s'" +msgstr "%s — «%s»" -#: config/tc-arc.c:1080 -msgid "expression too complex code symbol" -msgstr "" +#: config/tc-aarch64.c:4547 +#, c-format +msgid "%s at operand %d -- `%s'" +msgstr "%s в операнде %d — «%s»" -#: config/tc-arc.c:1107 +#: config/tc-aarch64.c:4553 #, c-format -msgid "missing ')' in %%-op" -msgstr "" +msgid "operand %d must be %s -- `%s'" +msgstr "операнд %d должен быть %s — «%s»" -#: config/tc-arc.c:1362 config/tc-dlx.c:1201 config/tc-i960.c:2641 -#: config/tc-m32r.c:2281 config/tc-sparc.c:3508 +#: config/tc-aarch64.c:4559 #, c-format -msgid "internal error: can't export reloc type %d (`%s')" -msgstr "" +msgid "operand mismatch -- `%s'" +msgstr "несоответствие операнда — «%s»" -#: config/tc-arc.c:1494 +#. Print the hint. +#: config/tc-aarch64.c:4619 +msgid " did you mean this?" +msgstr " вы имели в виду это?" + +#: config/tc-aarch64.c:4622 config/tc-aarch64.c:4649 #, c-format -msgid "unknown syntax format character `%c'" -msgstr "" +msgid " %s" +msgstr " %s" -#: config/tc-arc.c:1632 -msgid "too many suffixes" -msgstr "" +#: config/tc-aarch64.c:4627 +msgid " other valid variant(s):" +msgstr " другой корректный вариант(ы):" -#: config/tc-arc.c:1671 -msgid "symbol as destination register" -msgstr "" +#: config/tc-aarch64.c:4656 +#, c-format +msgid "operand %d must be the same register as operand 1 -- `%s'" +msgstr "операнд %d должен быть тем же регистром как у 1 операнда — «%s»" -#: config/tc-arc.c:1756 config/tc-i370.c:2211 config/tc-mn10200.c:1141 -#: config/tc-mn10300.c:1820 config/tc-ppc.c:2891 config/tc-s390.c:1460 -#: config/tc-v850.c:2009 +#: config/tc-aarch64.c:4662 #, c-format -msgid "junk at end of line: `%s'" -msgstr "" +msgid "%s out of range %d to %d at operand %d -- `%s'" +msgstr "%s за пределами диапазона %d - %d в операнде %d — «%s»" -#: config/tc-arc.c:1795 -msgid "8 byte instruction in delay slot" -msgstr "" +#: config/tc-aarch64.c:4663 config/tc-aarch64.c:4667 config/tc-aarch64.c:6447 +msgid "immediate value" +msgstr "непосредственное значение" -#. except for jl addr -#: config/tc-arc.c:1798 -msgid "8 byte jump instruction with delay slot" -msgstr "" +#: config/tc-aarch64.c:4666 +#, c-format +msgid "%s must be %d at operand %d -- `%s'" +msgstr "%s должно быть %d в операнде %d — «%s»" -#: config/tc-arc.c:1806 -msgid "conditional branch follows set of flags" -msgstr "" +#: config/tc-aarch64.c:4673 +#, c-format +msgid "invalid number of registers in the list; only 1 register is expected at operand %d -- `%s'" +msgstr "некорректное количество регистров в списке; только 1 регистр ожидается в операнде %d — «%s»" -#: config/tc-arc.c:1890 config/tc-arm.c:15434 +#: config/tc-aarch64.c:4677 #, c-format -msgid "bad instruction `%s'" -msgstr "" +msgid "invalid number of registers in the list; %d registers are expected at operand %d -- `%s'" +msgstr "некорректное количество регистров в списке; %d регистров ожидается в операнде %d — «%s»" -#: config/tc-arm.c:516 -msgid "ARM register expected" -msgstr "" +#: config/tc-aarch64.c:4683 +#, c-format +msgid "immediate value must be a multiple of %d at operand %d -- `%s'" +msgstr "непосредственное значение должно быть кратно %d в операнде %d — «%s»" -#: config/tc-arm.c:517 -msgid "bad or missing co-processor number" -msgstr "" +#: config/tc-aarch64.c:4970 +msgid "bad vector arrangement type" +msgstr "плохой тип векторного расположения" -#: config/tc-arm.c:518 -msgid "co-processor register expected" -msgstr "" +#: config/tc-aarch64.c:5087 +msgid "the specified relocation type is not allowed for MOVK" +msgstr "указанный тип перемещения недопустим для MOVK" -#: config/tc-arm.c:519 -msgid "FPA register expected" -msgstr "" +#: config/tc-aarch64.c:5129 config/tc-aarch64.c:5139 +msgid "the specified relocation type is not allowed for 32-bit register" +msgstr "указанный тип перемещения недопустим для 32-битного регистра" -#: config/tc-arm.c:520 -msgid "VFP single precision register expected" -msgstr "" +#: config/tc-aarch64.c:5310 +msgid "comma expected between operands" +msgstr "между операндами ожидается запятая" -#: config/tc-arm.c:521 -msgid "VFP/Neon double precision register expected" -msgstr "" +#: config/tc-aarch64.c:5444 +msgid "the top half of a 128-bit FP/SIMD register is expected" +msgstr "ожидается верхняя половина 128-битного регистра FP/SIMD" -#: config/tc-arm.c:522 -msgid "Neon quad precision register expected" -msgstr "" +#: config/tc-aarch64.c:5515 config/tc-arm.c:1906 config/tc-arm.c:1951 +#: config/tc-h8300.c:1048 +msgid "invalid register list" +msgstr "некорректный список регистров" + +#: config/tc-aarch64.c:5535 +msgid "missing type suffix" +msgstr "отсутствует суффикс типа" + +#: config/tc-aarch64.c:5554 +msgid "C0 - C15 expected" +msgstr "ожидается C0 - C15" + +#: config/tc-aarch64.c:5655 config/tc-aarch64.c:5679 +msgid "immediate zero expected" +msgstr "ожидается непосредственный ноль" + +#: config/tc-aarch64.c:5775 +msgid "shift not allowed for bitmask immediate" +msgstr "сдвиг недопустим для непосредственной маски битов" + +#: config/tc-aarch64.c:5829 +msgid "can't mix relocation modifier with explicit shift" +msgstr "нельзя смешивать модификатор перемещения и явный сдвиг" + +#: config/tc-aarch64.c:5877 +msgid "invalid condition" +msgstr "некорректное условие" + +#: config/tc-aarch64.c:5903 +msgid "invalid pc-relative address" +msgstr "некорректный адрес, относительный pc" + +#. Only permit "=value" in the literal load instructions. +#. The literal will be generated by programmer_friendly_fixup. +#: config/tc-aarch64.c:5911 +msgid "invalid use of \"=immediate\"" +msgstr "некорректное употребление «=immediate»" + +#: config/tc-aarch64.c:5976 config/tc-aarch64.c:6008 config/tc-aarch64.c:6026 +#: config/tc-aarch64.c:6048 config/tc-aarch64.c:6068 config/tc-aarch64.c:6087 +#: config/tc-aarch64.c:6106 config/tc-aarch64.c:6141 config/tc-aarch64.c:6148 +#: config/tc-aarch64.c:6177 config/tc-aarch64.c:6202 config/tc-aarch64.c:6218 +#: config/tc-aarch64.c:6242 +msgid "invalid addressing mode" +msgstr "некорректный режим адресации" + +#: config/tc-aarch64.c:5992 +msgid "the optional immediate offset can only be 0" +msgstr "необязательным непоредственным смещением может быть только 0" + +#: config/tc-aarch64.c:6031 config/tc-aarch64.c:6053 config/tc-aarch64.c:6073 +msgid "relocation not allowed" +msgstr "перемещение не допускается" + +#: config/tc-aarch64.c:6116 +msgid "writeback value must be an immediate constant" +msgstr "значение обратной записи должно быть непосредственное константой" + +#. Make sure this has priority over +#. "invalid addressing mode". +#: config/tc-aarch64.c:6156 +msgid "constant offset required" +msgstr "требуется константное смещение" + +#: config/tc-aarch64.c:6252 +msgid "unknown or missing system register name" +msgstr "неизвестное или отсутствующее имя системного регистра" + +#: config/tc-aarch64.c:6262 +msgid "unknown or missing PSTATE field name" +msgstr "неизвестное или отсутствующее имя поля PSTATE" + +#: config/tc-aarch64.c:6286 +msgid "unknown or missing operation name" +msgstr "неизвестное или отсутствующее имя операции" + +#: config/tc-aarch64.c:6299 +msgid "the specified option is not accepted in ISB" +msgstr "указанный параметр неприемлем для ISB" + +#: config/tc-aarch64.c:6325 config/tc-aarch64.c:7458 config/tc-arm.c:7211 +#, c-format +msgid "unhandled operand code %d" +msgstr "необработанный код операнда %d" -#: config/tc-arm.c:523 -msgid "VFP single or double precision register expected" -msgstr "" +#: config/tc-aarch64.c:6367 +msgid "unexpected comma before the omitted optional operand" +msgstr "ожидается запятая перед пропущенным необязательным операндом" -#: config/tc-arm.c:524 -msgid "Neon double or quad precision register expected" -msgstr "" +#: config/tc-aarch64.c:6395 +msgid "unexpected characters following instruction" +msgstr "неожиданные символы после инструкции" -#: config/tc-arm.c:525 -msgid "VFP single, double or Neon quad precision register expected" -msgstr "" +#: config/tc-aarch64.c:6473 config/tc-arm.c:5248 config/tc-arm.c:5809 +#: config/tc-arm.c:7973 +msgid "constant expression expected" +msgstr "ожидается константное выражение" -#: config/tc-arm.c:526 -msgid "VFP system register expected" -msgstr "" +#: config/tc-aarch64.c:6480 +msgid "literal pool insertion failed" +msgstr "невозможно вставить в пул литералов" -#: config/tc-arm.c:527 -msgid "Maverick MVF register expected" -msgstr "" +#: config/tc-aarch64.c:6549 config/tc-aarch64.c:6561 +#, c-format +msgid "unpredictable transfer with writeback -- `%s'" +msgstr "непредсказуемая передача с обратной записью — «%s»" -#: config/tc-arm.c:528 -msgid "Maverick MVD register expected" -msgstr "" +#: config/tc-aarch64.c:6565 +#, c-format +msgid "unpredictable load of register pair -- `%s'" +msgstr "непредсказумая загрузка пары регистров — «%s»" -#: config/tc-arm.c:529 -msgid "Maverick MVFX register expected" -msgstr "" +#: config/tc-aarch64.c:6642 +#, c-format +msgid "unknown mnemonic `%s' -- `%s'" +msgstr "неизвестная мнемоника «%s» — «%s»" -#: config/tc-arm.c:530 -msgid "Maverick MVDX register expected" -msgstr "" +#: config/tc-aarch64.c:6650 +#, c-format +msgid "unexpected comma after the mnemonic name `%s' -- `%s'" +msgstr "неожиданная запятая после мнемонического имени «%s» — «%s»" -#: config/tc-arm.c:531 -msgid "Maverick MVAX register expected" -msgstr "" +#: config/tc-aarch64.c:6708 +#, c-format +msgid "selected processor does not support `%s'" +msgstr "выбранный процессор не поддерживает «%s»" -#: config/tc-arm.c:532 -msgid "Maverick DSPSC register expected" -msgstr "" +#: config/tc-aarch64.c:7121 config/tc-arm.c:22852 +msgid "GOT already in the symbol table" +msgstr "GOT уже в таблице символов" -#: config/tc-arm.c:533 -msgid "iWMMXt data register expected" -msgstr "" +#: config/tc-aarch64.c:7283 +msgid "immediate cannot be moved by a single instruction" +msgstr "непосредственный элемент невозможно передвинуть одной инструкцией" -#: config/tc-arm.c:534 config/tc-arm.c:6248 -msgid "iWMMXt control register expected" -msgstr "" +#: config/tc-aarch64.c:7326 config/tc-aarch64.c:7371 config/tc-aarch64.c:7397 +#: config/tc-arm.c:15411 config/tc-arm.c:15438 config/tc-arm.c:16080 +#: config/tc-arm.c:16694 config/tc-arm.c:17516 config/tc-arm.c:17556 +#: config/tc-metag.c:2444 config/tc-metag.c:2453 config/tc-metag.c:2492 +#: config/tc-metag.c:2501 config/tc-metag.c:3021 config/tc-metag.c:3030 +msgid "immediate out of range" +msgstr "непосредственный элемент за пределами диапазона" -#: config/tc-arm.c:535 -msgid "iWMMXt scalar register expected" -msgstr "" +#: config/tc-aarch64.c:7390 config/tc-metag.c:4656 config/tc-xtensa.c:4183 +msgid "invalid immediate" +msgstr "некорректный непосредственный элемент" -#: config/tc-arm.c:536 -msgid "XScale accumulator register expected" -msgstr "" +#: config/tc-aarch64.c:7453 config/tc-tic6x.c:3861 config/tc-tic6x.c:3926 +#: config/tc-tic6x.c:3953 config/tc-tic6x.c:3981 +msgid "immediate offset out of range" +msgstr "непосредственное смещение за пределами диапазона" -#. For score5u : div/mul will pop warning message, mmu/alw/asw will pop error message. -#: config/tc-arm.c:685 config/tc-score.c:259 -msgid "bad arguments to instruction" -msgstr "" +#: config/tc-aarch64.c:7527 config/tc-arm.c:23190 config/tc-arm.c:23258 +#: config/tc-arm.c:23540 +#, c-format +msgid "undefined symbol %s used as an immediate value" +msgstr "неопределенный символ %s используется как непосредственное значение" -#: config/tc-arm.c:686 -msgid "r13 not allowed here" -msgstr "" +#: config/tc-aarch64.c:7539 +msgid "pc-relative load offset not word aligned" +msgstr "загрузочное смещение, относительное pc, не выровнено по границе слова" -#: config/tc-arm.c:687 -msgid "r15 not allowed here" -msgstr "" +#: config/tc-aarch64.c:7542 +msgid "pc-relative load offset out of range" +msgstr "загрузочное смещение, относительное pc, за пределами диапазона" -#: config/tc-arm.c:688 -msgid "instruction cannot be conditional" -msgstr "" +#: config/tc-aarch64.c:7554 +msgid "pc-relative address offset out of range" +msgstr "адресное смещение, относительное pc, за пределами диапазона" -#: config/tc-arm.c:689 -msgid "registers may not be the same" -msgstr "" +#: config/tc-aarch64.c:7566 config/tc-aarch64.c:7581 +msgid "conditional branch target not word aligned" +msgstr "цель условного ветвления не выровнена по границе слова" -#: config/tc-arm.c:690 -msgid "lo register required" -msgstr "" +#: config/tc-aarch64.c:7569 config/tc-aarch64.c:7584 config/tc-arm.c:23831 +msgid "conditional branch out of range" +msgstr "цель условного ветвления за пределами диапазона" -#: config/tc-arm.c:691 -msgid "instruction not supported in Thumb16 mode" -msgstr "" +#: config/tc-aarch64.c:7597 +msgid "branch target not word aligned" +msgstr "цель ветвления не выровнена по границе слова" -#: config/tc-arm.c:692 -msgid "instruction does not accept this addressing mode" -msgstr "" +#: config/tc-aarch64.c:7600 config/tc-arm.c:822 config/tc-mips.c:15683 +#: config/tc-mips.c:15699 config/tc-mips.c:15789 +msgid "branch out of range" +msgstr "ветвление за пределами диапазона" -#: config/tc-arm.c:693 -msgid "branch must be last instruction in IT block" -msgstr "" +#: config/tc-aarch64.c:7652 config/tc-arm.c:23431 config/tc-arm.c:23446 +#: config/tc-arm.c:23461 config/tc-arm.c:23472 config/tc-arm.c:23495 +#: config/tc-arm.c:24293 config/tc-moxie.c:716 config/tc-pj.c:452 +#: config/tc-sh.c:4293 +msgid "offset out of range" +msgstr "смещение вне диапазона" -#: config/tc-arm.c:694 -msgid "instruction not allowed in IT block" -msgstr "" +#: config/tc-aarch64.c:7667 +msgid "unsigned value out of range" +msgstr "беззнаковое значение за пределами диапазона" -#: config/tc-arm.c:695 -msgid "selected FPU does not support instruction" -msgstr "" +#: config/tc-aarch64.c:7675 +msgid "signed value out of range" +msgstr "знаковое значение за пределами диапазона" -#: config/tc-arm.c:696 -msgid "thumb conditional instruction should be in IT block" -msgstr "" +#: config/tc-aarch64.c:7817 +#, c-format +msgid "unexpected %s fixup" +msgstr "неожиданное местоположение %s" -#: config/tc-arm.c:697 -msgid "incorrect condition in IT block" -msgstr "" +#: config/tc-aarch64.c:7883 config/tc-arm.c:24802 config/tc-arm.c:24823 +#: config/tc-mips.c:18038 config/tc-or1k.c:348 config/tc-score.c:7480 +#, c-format +msgid "cannot represent %s relocation in this object file format" +msgstr "невозможно представить перемещение %s в данном формате объектного файла" -#: config/tc-arm.c:698 -msgid "IT falling in the range of a previous IT block" -msgstr "" +#: config/tc-aarch64.c:7916 +#, c-format +msgid "cannot do %u-byte relocation" +msgstr "невозможно выполнить %u-байтовое перемещение" -#: config/tc-arm.c:699 -msgid "missing .fnstart before unwinding directive" -msgstr "" +#: config/tc-aarch64.c:8227 config/tc-arm.c:25283 config/tc-score.c:6297 +#: config/tc-score.c:6527 config/tc-score.c:6532 +msgid "virtual memory exhausted" +msgstr "закончилась виртуальная память" -#: config/tc-arm.c:890 -msgid "immediate expression requires a # prefix" -msgstr "" +#: config/tc-aarch64.c:8385 config/tc-arm.c:25622 +msgid "assemble for big-endian" +msgstr "ассемблирование в порядке от старшего к младшему" -#: config/tc-arm.c:918 read.c:3617 -msgid "missing expression" -msgstr "" +#: config/tc-aarch64.c:8386 config/tc-arm.c:25623 +msgid "assemble for little-endian" +msgstr "ассемблирование в порядке от младшего к старшему" -#: config/tc-arm.c:918 config/tc-score.c:6520 expr.c:1352 read.c:2464 -msgid "bad expression" -msgstr "" +#: config/tc-aarch64.c:8389 +msgid "temporary switch for dumping" +msgstr "временное переключение для дампа" -#: config/tc-arm.c:929 config/tc-i860.c:1003 config/tc-sparc.c:2880 -msgid "bad segment" -msgstr "" +#: config/tc-aarch64.c:8391 +msgid "output verbose error messages" +msgstr "выводить подробные сообщения об ошибках" -#: config/tc-arm.c:946 config/tc-arm.c:4744 config/tc-i960.c:1300 -#: config/tc-score.c:1211 -msgid "invalid constant" -msgstr "" +#: config/tc-aarch64.c:8393 +msgid "do not output verbose error messages" +msgstr "не выводить подробные сообщения об ошибках" -#: config/tc-arm.c:1076 -msgid "expected #constant" -msgstr "" +#: config/tc-aarch64.c:8601 config/tc-arm.c:26444 +msgid "invalid architectural extension" +msgstr "недопустимое расширение архитектуры" -#: config/tc-arm.c:1237 -#, c-format -msgid "unexpected character `%c' in type specifier" -msgstr "" +#: config/tc-aarch64.c:8626 config/tc-arm.c:26476 +msgid "must specify extensions to add before specifying those to remove" +msgstr "добавляемые расширения должны быть указаны до указания их удаления" -#: config/tc-arm.c:1254 -#, c-format -msgid "bad size %d in type specifier" -msgstr "" +#: config/tc-aarch64.c:8634 config/tc-arm.c:26484 +msgid "missing architectural extension" +msgstr "отсутствует расширение архитектуры" -#: config/tc-arm.c:1304 -msgid "only one type should be specified for operand" -msgstr "" +#: config/tc-aarch64.c:8661 config/tc-arm.c:26536 +#, c-format +msgid "unknown architectural extension `%s'" +msgstr "неизвестное расширение архитектуры «%s»" -#: config/tc-arm.c:1310 -msgid "vector type expected" -msgstr "" +#: config/tc-aarch64.c:8685 config/tc-arm.c:26570 config/tc-metag.c:5834 +#, c-format +msgid "missing cpu name `%s'" +msgstr "отсутствует имя ЦП «%s»" -#: config/tc-arm.c:1382 -msgid "can't redefine type for operand" -msgstr "" +#: config/tc-aarch64.c:8699 config/tc-aarch64.c:8916 config/tc-arm.c:26605 +#: config/tc-arm.c:27369 config/tc-metag.c:5845 +#, c-format +msgid "unknown cpu `%s'" +msgstr "неизвестный ЦП «%s»" -#: config/tc-arm.c:1393 -msgid "only D registers may be indexed" -msgstr "" +#: config/tc-aarch64.c:8717 config/tc-arm.c:26623 +#, c-format +msgid "missing architecture name `%s'" +msgstr "отсутствует название архитектуры «%s»" -#: config/tc-arm.c:1399 -msgid "can't change index for operand" -msgstr "" +#: config/tc-aarch64.c:8731 config/tc-aarch64.c:8963 config/tc-arm.c:26640 +#: config/tc-arm.c:27404 config/tc-arm.c:27434 config/tc-score.c:7715 +#, c-format +msgid "unknown architecture `%s'\n" +msgstr "неизвестная архитектура «%s»\n" -#: config/tc-arm.c:1415 config/tc-arm.c:3274 config/tc-arm.c:4345 -msgid "constant expression required" -msgstr "" +#: config/tc-aarch64.c:8754 +#, c-format +msgid "missing abi name `%s'" +msgstr "отсутствует имя abi «%s»" -#: config/tc-arm.c:1458 -msgid "register operand expected, but got scalar" -msgstr "" +#: config/tc-aarch64.c:8765 +#, c-format +msgid "unknown abi `%s'\n" +msgstr "неизвестный abi «%s»\n" -#: config/tc-arm.c:1491 -msgid "scalar must have an index" -msgstr "" +#: config/tc-aarch64.c:8771 +msgid "\t specify for ABI " +msgstr "<имя abi>\t указать для ABI <имя abi>" -#: config/tc-arm.c:1496 config/tc-arm.c:14062 config/tc-arm.c:14110 -#: config/tc-arm.c:14512 -msgid "scalar index out of range" -msgstr "" +#: config/tc-aarch64.c:8774 config/tc-arm.c:26727 config/tc-metag.c:5911 +msgid "\t assemble for CPU " +msgstr "<имя ЦП>\t ассемблировать для ЦП <имя ЦП>" -#: config/tc-arm.c:1544 -msgid "bad range in register list" -msgstr "" +#: config/tc-aarch64.c:8776 config/tc-arm.c:26729 +msgid "\t assemble for architecture " +msgstr "<имя арх>\t ассемблировать для архитектуры <имя арх>" -#: config/tc-arm.c:1552 config/tc-arm.c:1561 config/tc-arm.c:1602 +#: config/tc-aarch64.c:8815 config/tc-aarch64.c:8835 config/tc-arm.c:26785 +#: config/tc-arm.c:26803 config/tc-arm.c:26823 config/tc-metag.c:5936 #, c-format -msgid "Warning: duplicated register (r%d) in register list" -msgstr "" +msgid "option `-%c%s' is deprecated: %s" +msgstr "параметр «-%c%s» устарел: %s" -#: config/tc-arm.c:1564 -msgid "Warning: register range not in ascending order" -msgstr "" +#: config/tc-aarch64.c:8855 +#, c-format +msgid " AArch64-specific assembler options:\n" +msgstr "Специализированные параметры ассемблера для AArch64:\n" -#: config/tc-arm.c:1575 -msgid "missing `}'" -msgstr "" +#: config/tc-aarch64.c:8866 config/tc-arc.c:3536 config/tc-arm.c:26854 +#, c-format +msgid " -EB assemble code for a big-endian cpu\n" +msgstr " -EB ассемблерный код для ЦП с прямым порядком байт\n" -#: config/tc-arm.c:1591 -msgid "invalid register mask" -msgstr "" +#: config/tc-aarch64.c:8871 config/tc-arc.c:3538 config/tc-arm.c:26859 +#, c-format +msgid " -EL assemble code for a little-endian cpu\n" +msgstr " -EL ассемблерный код для ЦП с обратным порядком байт\n" -#: config/tc-arm.c:1673 -msgid "expecting {" -msgstr "" +#: config/tc-alpha.c:653 +#, c-format +msgid "No !literal!%ld was found" +msgstr "Не найден !literal!%ld" -#: config/tc-arm.c:1728 config/tc-arm.c:1772 -msgid "register out of range in list" -msgstr "" +#: config/tc-alpha.c:660 +#, c-format +msgid "No !tlsgd!%ld was found" +msgstr "Не найден !tlsgd!%ld" -#: config/tc-arm.c:1744 config/tc-arm.c:1789 config/tc-h8300.c:990 -#: config/tc-mips.c:10561 config/tc-mips.c:10583 -msgid "invalid register list" -msgstr "" +#: config/tc-alpha.c:667 +#, c-format +msgid "No !tlsldm!%ld was found" +msgstr "Не найден !tlsldm!%ld" -#: config/tc-arm.c:1750 config/tc-arm.c:3788 config/tc-arm.c:3921 -msgid "register list not in ascending order" -msgstr "" +#: config/tc-alpha.c:676 +#, c-format +msgid "No ldah !gpdisp!%ld was found" +msgstr "Не найден ldah !gpdisp!%ld" -#: config/tc-arm.c:1781 -msgid "register range not in ascending order" -msgstr "" +#: config/tc-alpha.c:726 +#, c-format +msgid "too many !literal!%ld for %s" +msgstr "слишком много !literal!%ld для %s" -#: config/tc-arm.c:1814 -msgid "non-contiguous register range" -msgstr "" +#: config/tc-alpha.c:756 +#, c-format +msgid "No lda !gpdisp!%ld was found" +msgstr "Не найден lda !gpdisp!%ld" -#: config/tc-arm.c:1874 -msgid "register stride must be 1 or 2" -msgstr "" +#. Only support one relocation op per insn. +#: config/tc-alpha.c:915 +msgid "More than one relocation op per insn" +msgstr "Более одного операции перемещения на инструкцию" -#: config/tc-arm.c:1875 -msgid "mismatched element/structure types in list" -msgstr "" +#: config/tc-alpha.c:930 config/tc-arc.c:1197 +msgid "No relocation operand" +msgstr "Не операнд перемещения" -#: config/tc-arm.c:1940 -msgid "don't use Rn-Rm syntax with non-unit stride" -msgstr "" +#: config/tc-alpha.c:940 +#, c-format +msgid "Unknown relocation operand: !%s" +msgstr "Неизвестный операнд перемещения: !%s" -#: config/tc-arm.c:1995 -msgid "error parsing element/structure list" -msgstr "" +#: config/tc-alpha.c:950 +#, c-format +msgid "no sequence number after !%s" +msgstr "отсутствует номер последовательности после !%s" -#: config/tc-arm.c:2001 -msgid "expected }" -msgstr "" +#: config/tc-alpha.c:960 +#, c-format +msgid "!%s does not use a sequence number" +msgstr "!%s не использует номер последовательности" -#: config/tc-arm.c:2057 +#: config/tc-alpha.c:970 #, c-format -msgid "ignoring attempt to redefine built-in register '%s'" -msgstr "" +msgid "Bad sequence number: !%s!%s" +msgstr "Плохой номер последовательности: !%s!%s" -#: config/tc-arm.c:2062 +#: config/tc-alpha.c:1186 config/tc-alpha.c:3360 #, c-format -msgid "ignoring redefinition of register alias '%s'" -msgstr "" +msgid "inappropriate arguments for opcode `%s'" +msgstr "неподходящие аргументы для кода операции «%s»" -#: config/tc-arm.c:2090 -msgid "attempt to redefine typed alias" -msgstr "" +#: config/tc-alpha.c:1188 config/tc-alpha.c:3362 +#, c-format +msgid "opcode `%s' not supported for target %s" +msgstr "код операции «%s» не поддерживается для цели %s" -#: config/tc-arm.c:2128 +#: config/tc-alpha.c:1192 config/tc-alpha.c:3366 config/tc-avr.c:1904 +#: config/tc-msp430.c:3988 config/tc-wasm32.c:753 #, c-format -msgid "unknown register '%s' -- .req ignored" -msgstr "" +msgid "unknown opcode `%s'" +msgstr "неизвестный код операции «%s»" -#: config/tc-arm.c:2223 -msgid "bad type for register" -msgstr "" +#: config/tc-alpha.c:1273 config/tc-alpha.c:1532 +msgid "overflow in literal (.lita) table" +msgstr "переполнение в таблице литералов (.lita)" -#: config/tc-arm.c:2234 -msgid "expression must be constant" -msgstr "" +#: config/tc-alpha.c:1280 config/tc-alpha.c:1304 config/tc-alpha.c:1545 +#: config/tc-alpha.c:2232 config/tc-alpha.c:2277 config/tc-alpha.c:2346 +#: config/tc-alpha.c:2429 config/tc-alpha.c:2654 config/tc-alpha.c:2752 +msgid "macro requires $at register while noat in effect" +msgstr "для макроса требуется регистр $at, но в действительности его нет" -#: config/tc-arm.c:2251 -msgid "can't redefine the type of a register alias" -msgstr "" +#: config/tc-alpha.c:1282 config/tc-alpha.c:1306 config/tc-alpha.c:1547 +msgid "macro requires $at while $at in use" +msgstr "для макроса требуется регистр $at, но $at уже используется" -#: config/tc-arm.c:2258 -msgid "you must specify a single type only" -msgstr "" +#: config/tc-alpha.c:1491 +msgid "bignum invalid; zero assumed" +msgstr "некорректный bignum; предполагается ноль" -#: config/tc-arm.c:2271 -msgid "can't redefine the index of a scalar alias" -msgstr "" +#: config/tc-alpha.c:1493 +msgid "floating point number invalid; zero assumed" +msgstr "некорректное число с плавающей точкой; предполагается ноль" -#: config/tc-arm.c:2279 -msgid "scalar index must be constant" -msgstr "" +#: config/tc-alpha.c:1498 +msgid "can't handle expression" +msgstr "невозможно обработать выражение" -#: config/tc-arm.c:2288 -msgid "expecting ]" -msgstr "" +#: config/tc-alpha.c:1538 +msgid "overflow in literal (.lit8) table" +msgstr "переполнение в таблице литералов (.lit8)" -#: config/tc-arm.c:2326 -msgid "invalid syntax for .req directive" -msgstr "" +#: config/tc-alpha.c:1835 +#, c-format +msgid "too many ldah insns for !gpdisp!%ld" +msgstr "слишком много инструкций ldah для !gpdisp!%ld" -#: config/tc-arm.c:2332 -msgid "invalid syntax for .dn directive" -msgstr "" +#: config/tc-alpha.c:1837 config/tc-alpha.c:1849 +#, c-format +msgid "both insns for !gpdisp!%ld must be in the same section" +msgstr "обе инструкции для !gpdisp!%ld должны быть в одном разделе" -#: config/tc-arm.c:2338 -msgid "invalid syntax for .qn directive" -msgstr "" +#: config/tc-alpha.c:1847 +#, c-format +msgid "too many lda insns for !gpdisp!%ld" +msgstr "слишком много инструкций lda для !gpdisp!%ld" -#: config/tc-arm.c:2364 -msgid "invalid syntax for .unreq directive" -msgstr "" +#: config/tc-alpha.c:1903 +#, c-format +msgid "too many lituse insns for !lituse_tlsgd!%ld" +msgstr "слишком много инструкций lituse для !lituse_tlsgd!%ld" -#: config/tc-arm.c:2370 +#: config/tc-alpha.c:1906 #, c-format -msgid "unknown register alias '%s'" -msgstr "" +msgid "too many lituse insns for !lituse_tlsldm!%ld" +msgstr "слишком много инструкций lituse для !lituse_tlsldm!%ld" -#: config/tc-arm.c:2372 +#: config/tc-alpha.c:1923 #, c-format -msgid "ignoring attempt to undefine built-in register '%s'" -msgstr "" +msgid "duplicate !tlsgd!%ld" +msgstr "повторный !tlsgd!%ld" -#: config/tc-arm.c:2610 +#: config/tc-alpha.c:1925 #, c-format -msgid "Failed to find real start of function: %s\n" -msgstr "" +msgid "sequence number in use for !tlsldm!%ld" +msgstr "номер последовательности задействован для !tlsldm!%ld" -#: config/tc-arm.c:2627 -msgid "selected processor does not support THUMB opcodes" -msgstr "" - -#: config/tc-arm.c:2640 -msgid "selected processor does not support ARM opcodes" -msgstr "" - -#: config/tc-arm.c:2652 +#: config/tc-alpha.c:1939 #, c-format -msgid "invalid instruction size selected (%d)" -msgstr "" +msgid "duplicate !tlsldm!%ld" +msgstr "повторный !tlsldm!%ld" -#: config/tc-arm.c:2684 +#: config/tc-alpha.c:1941 #, c-format -msgid "invalid operand to .code directive (%d) (expecting 16 or 32)" -msgstr "" +msgid "sequence number in use for !tlsgd!%ld" +msgstr "номер последовательности задействован для !tlsgd!%ld" -#: config/tc-arm.c:2740 -#, c-format -msgid "expected comma after name \"%s\"" -msgstr "" +#: config/tc-alpha.c:1996 config/tc-arc.c:2806 config/tc-mn10200.c:854 +#: config/tc-mn10300.c:1150 config/tc-ppc.c:1953 config/tc-s390.c:675 +#: config/tc-tilegx.c:427 config/tc-tilegx.c:477 config/tc-tilepro.c:383 +msgid "operand" +msgstr "операнд" -#: config/tc-arm.c:2790 config/tc-m32r.c:588 -#, c-format -msgid "symbol `%s' already defined" -msgstr "" +#: config/tc-alpha.c:2135 +msgid "invalid relocation for instruction" +msgstr "некорректное перемещение для инструкции" -#: config/tc-arm.c:2824 -#, c-format -msgid "unrecognized syntax mode \"%s\"" -msgstr "" +#: config/tc-alpha.c:2149 +msgid "invalid relocation for field" +msgstr "некорректное перемещение для поля" + +#: config/tc-alpha.c:2981 +msgid "can not resolve expression" +msgstr "невозможно разобрать выражение" -#: config/tc-arm.c:2845 +#: config/tc-alpha.c:3514 config/tc-i370.c:1056 config/tc-microblaze.c:200 +#: config/tc-ppc.c:2275 config/tc-ppc.c:5394 #, c-format -msgid "alignment too large: %d assumed" -msgstr "" +msgid ".COMMon length (%ld.) <0! Ignored." +msgstr "Длина .COMMon (%ld.) <0! Игнорируется." -#: config/tc-arm.c:2848 -msgid "alignment negative. 0 assumed." -msgstr "" +#: config/tc-alpha.c:3525 config/tc-ia64.c:1094 config/tc-sparc.c:4435 +#: config/tc-v850.c:306 +msgid "Ignoring attempt to re-define symbol" +msgstr "Игнорируется попытка переопределения символа" -#: config/tc-arm.c:2998 -msgid "literal pool overflow" -msgstr "" +#: config/tc-alpha.c:3617 config/tc-sparc.c:4443 +#, c-format +msgid "Length of .comm \"%s\" is already %ld. Not changed to %ld." +msgstr "Длина .comm \"%s\" уже равна %ld. Не изменяется на %ld." -#: config/tc-arm.c:3154 config/tc-arm.c:6183 -msgid "unrecognized relocation suffix" -msgstr "" +#: config/tc-alpha.c:3724 +msgid ".ent directive has no name" +msgstr "директива .ent не имеет имени" -#: config/tc-arm.c:3167 -msgid "(plt) is only valid on branch targets" -msgstr "" +#: config/tc-alpha.c:3732 +msgid "nested .ent directives" +msgstr "вложенные директивы .ent" -#: config/tc-arm.c:3173 config/tc-s390.c:1100 config/tc-s390.c:1725 -#: config/tc-xtensa.c:1591 -#, c-format -msgid "%s relocations do not fit in %d bytes" -msgstr "" +#: config/tc-alpha.c:3776 ecoff.c:3008 +msgid ".end directive has no name" +msgstr "директива .end не имеет имени" -#: config/tc-arm.c:3250 -msgid ".inst.n operand too big. Use .inst.w instead" -msgstr "" +#: config/tc-alpha.c:3784 +msgid ".end directive without matching .ent" +msgstr "директива .end без надлежащего .ent" -#: config/tc-arm.c:3270 -msgid "cannot determine Thumb instruction size. Use .inst.n/.inst.w instead" -msgstr "" +#: config/tc-alpha.c:3786 +msgid ".end directive names different symbol than .ent" +msgstr "имя директивы .end указывает на другой символ, отличный от .ent" -#: config/tc-arm.c:3300 -msgid "width suffixes are invalid in ARM mode" -msgstr "" +#: config/tc-alpha.c:3829 ecoff.c:3145 +msgid ".fmask outside of .ent" +msgstr ".fmask вне .ent" -#: config/tc-arm.c:3342 dwarf2dbg.c:701 -msgid "expected 0 or 1" -msgstr "" +#: config/tc-alpha.c:3831 config/tc-score.c:5598 ecoff.c:3209 +msgid ".mask outside of .ent" +msgstr ".mask вне .ent" -#: config/tc-arm.c:3346 -msgid "missing comma" -msgstr "" +#: config/tc-alpha.c:3839 ecoff.c:3152 +msgid "bad .fmask directive" +msgstr "неверная директива .fmask" -#: config/tc-arm.c:3379 -msgid "duplicate .fnstart directive" -msgstr "" +#: config/tc-alpha.c:3841 ecoff.c:3216 +msgid "bad .mask directive" +msgstr "неверная директива .mask" -#: config/tc-arm.c:3410 -msgid "duplicate .handlerdata directive" -msgstr "" +#: config/tc-alpha.c:3874 config/tc-mips.c:19507 config/tc-score.c:5739 +#: ecoff.c:3173 +msgid ".frame outside of .ent" +msgstr ".frame вне .ent" -#: config/tc-arm.c:3429 -msgid ".fnend directive without .fnstart" -msgstr "" +#: config/tc-alpha.c:3885 config/tc-mips.c:19518 ecoff.c:3184 +msgid "bad .frame directive" +msgstr "неверная директива .frame" -#: config/tc-arm.c:3495 -msgid "personality routine specified for cantunwind frame" -msgstr "" +#: config/tc-alpha.c:3919 +msgid ".prologue directive without a preceding .ent directive" +msgstr "директива .prologue без предшествующей директивы .ent" -#: config/tc-arm.c:3512 -msgid "duplicate .personalityindex directive" -msgstr "" +#: config/tc-alpha.c:3937 +#, c-format +msgid "Invalid argument %d to .prologue." +msgstr "Неверный аргумент %d в .prologue." -#: config/tc-arm.c:3519 -msgid "bad personality routine number" -msgstr "" +#: config/tc-alpha.c:4026 +msgid "ECOFF debugging is disabled." +msgstr "Отладка ECOFF выключена." -#: config/tc-arm.c:3541 -msgid "duplicate .personality directive" -msgstr "" +#: config/tc-alpha.c:4040 +msgid ".ent directive without matching .end" +msgstr "директива .ent без надлежащего .end" -#: config/tc-arm.c:3564 config/tc-arm.c:3692 config/tc-arm.c:3740 -msgid "expected register list" -msgstr "" +#: config/tc-alpha.c:4133 +msgid ".usepv directive has no name" +msgstr "директива .usepv не имеет имени" -#: config/tc-arm.c:3646 -msgid "expected , " -msgstr "" +#: config/tc-alpha.c:4146 +msgid ".usepv directive has no type" +msgstr "директива .usepv не имеет типа" -#: config/tc-arm.c:3655 -msgid "number of registers must be in the range [1:4]" -msgstr "" +#: config/tc-alpha.c:4161 +msgid "unknown argument for .usepv" +msgstr "неизвестный аргумент .usepv" -#: config/tc-arm.c:3802 config/tc-arm.c:3935 -msgid "bad register range" -msgstr "" +#: config/tc-alpha.c:4274 +#, c-format +msgid "unknown section attribute %s" +msgstr "неизвестный атрибут раздела %s" -#: config/tc-arm.c:3992 -msgid "register expected" -msgstr "" +#: config/tc-alpha.c:4369 +msgid "previous .ent not closed by a .end" +msgstr "предыдущая .ent не закрыта .end" -#: config/tc-arm.c:4002 -msgid "FPA .unwind_save does not take a register list" -msgstr "" +#: config/tc-alpha.c:4390 +msgid ".ent directive has no symbol" +msgstr "директива .ent не имеет символа" -#: config/tc-arm.c:4021 -msgid ".unwind_save does not support this kind of register" -msgstr "" +#: config/tc-alpha.c:4415 +msgid ".handler directive has no name" +msgstr "директива .handler не имеет имени" -#: config/tc-arm.c:4060 -msgid "SP and PC not permitted in .unwind_movsp directive" -msgstr "" +#: config/tc-alpha.c:4446 +msgid "Bad .frame directive 1./2. param" +msgstr "Неверный параметр 1./2. директивы .frame" -#: config/tc-arm.c:4065 -msgid "unexpected .unwind_movsp directive" -msgstr "" +#: config/tc-alpha.c:4456 +#, c-format +msgid "Bad RA (%d) register for .frame" +msgstr "Неверный регистр RA (%d) у .frame" -#: config/tc-arm.c:4092 -msgid "stack increment must be multiple of 4" -msgstr "" +#: config/tc-alpha.c:4461 +msgid "Bad .frame directive 3./4. param" +msgstr "Неверный параметр 3./4. директивы .frame" -#: config/tc-arm.c:4124 -msgid "expected , " -msgstr "" +#: config/tc-alpha.c:4497 +msgid ".pdesc directive not in link (.link) section" +msgstr "директива .pdesc не в разделе связей (.link)" -#: config/tc-arm.c:4142 -msgid "register must be either sp or set by a previousunwind_movsp directive" -msgstr "" +#: config/tc-alpha.c:4504 +msgid ".pdesc directive has no entry symbol" +msgstr "директива .pdesc не имеет входного символа" -#: config/tc-arm.c:4181 -msgid "expected , " -msgstr "" +#: config/tc-alpha.c:4515 +msgid ".pdesc has a bad entry symbol" +msgstr "у директивы .pdesc указан неверный входной символ" -#: config/tc-arm.c:4193 -msgid "unwind opcode too long" -msgstr "" +#: config/tc-alpha.c:4526 +msgid ".pdesc doesn't match with last .ent" +msgstr ".pdesc не совпадает с последней .ent" -#: config/tc-arm.c:4198 -msgid "invalid unwind opcode" -msgstr "" +#: config/tc-alpha.c:4541 +msgid "No comma after .pdesc " +msgstr "Отсутствует запятая после .pdesc <входное_имя>" -#: config/tc-arm.c:4351 config/tc-arm.c:5213 config/tc-arm.c:8917 -#: config/tc-arm.c:9440 config/tc-arm.c:12568 config/tc-arm.c:20329 -#: config/tc-arm.c:20354 config/tc-arm.c:20362 config/tc-z8k.c:1144 -#: config/tc-z8k.c:1154 -msgid "immediate value out of range" -msgstr "" +#: config/tc-alpha.c:4561 +msgid "unknown procedure kind" +msgstr "неизвестный вид процедуры" -#: config/tc-arm.c:4498 -msgid "invalid FPA immediate expression" -msgstr "" +#: config/tc-alpha.c:4656 +msgid ".name directive not in link (.link) section" +msgstr "директива .name не в разделе связей (.link)" -#: config/tc-arm.c:4622 config/tc-arm.c:4630 -msgid "shift expression expected" -msgstr "" +#: config/tc-alpha.c:4664 +msgid ".name directive has no symbol" +msgstr "директива .name не имеет символа" -#: config/tc-arm.c:4644 -msgid "'LSL' or 'ASR' required" -msgstr "" +#: config/tc-alpha.c:4698 +msgid "No symbol after .linkage" +msgstr "Отсутствует символ после .linkage" -#: config/tc-arm.c:4652 -msgid "'LSL' required" -msgstr "" +#: config/tc-alpha.c:4745 +msgid "No symbol after .code_address" +msgstr "Отсутствует символ после .code_address" -#: config/tc-arm.c:4660 -msgid "'ASR' required" -msgstr "" +#: config/tc-alpha.c:4771 config/tc-score.c:5604 +msgid "Bad .mask directive" +msgstr "Неверная директива .mask" -#: config/tc-arm.c:4732 config/tc-arm.c:5207 config/tc-arm.c:6832 -#: config/tc-v850.c:1827 config/tc-v850.c:1848 -msgid "constant expression expected" -msgstr "" +#: config/tc-alpha.c:4789 +msgid "Bad .fmask directive" +msgstr "Неверная директива .fmask" -#: config/tc-arm.c:4739 -msgid "invalid rotation" -msgstr "" +#: config/tc-alpha.c:4946 +#, c-format +msgid "Expected comma after name \"%s\"" +msgstr "Ожидается запятая после имени «\"%s»" -#: config/tc-arm.c:4899 config/tc-arm.c:5043 -msgid "unknown group relocation" -msgstr "" +#: config/tc-alpha.c:4958 +#, c-format +msgid "unhandled: .proc %s,%d" +msgstr "не обработано: .proc %s,%d" -#: config/tc-arm.c:5012 -msgid "alignment must be constant" -msgstr "" +#: config/tc-alpha.c:4991 +#, c-format +msgid "Tried to .set unrecognized mode `%s'" +msgstr "Попытка задать .set нераспознанный режим «%s»" -#: config/tc-arm.c:5074 -msgid "this group relocation is not allowed on this instruction" -msgstr "" +#: config/tc-alpha.c:5017 +#, c-format +msgid "Bad base register, using $%d." +msgstr "Неверный базовый регистр, используется $%d." -#: config/tc-arm.c:5086 config/tc-arm.c:5486 -msgid "']' expected" -msgstr "" +#: config/tc-alpha.c:5038 config/tc-nios2.c:351 config/tc-nios2.c:476 +#, c-format +msgid "Alignment too large: %d. assumed" +msgstr "Слишком большое выравнивание: предполагается %d" -#: config/tc-arm.c:5104 -msgid "'}' expected at end of 'option' field" -msgstr "" +#: config/tc-alpha.c:5042 config/tc-d30v.c:2057 config/tc-nios2.c:355 +#: config/tc-nios2.c:480 config/tc-pru.c:220 config/tc-pru.c:336 +msgid "Alignment negative: 0 assumed" +msgstr "Отрицательное выравнивание: предполагается 0" -#: config/tc-arm.c:5109 -msgid "cannot combine index with option" -msgstr "" +#: config/tc-alpha.c:5137 config/tc-alpha.c:5630 +#, c-format +msgid "Unknown CPU identifier `%s'" +msgstr "Неизвестный идентификатор ЦП «%s»" -#: config/tc-arm.c:5122 -msgid "cannot combine pre- and post-indexing" -msgstr "" +#: config/tc-alpha.c:5328 +#, c-format +msgid "Chose GP value of %lx\n" +msgstr "Выбираем значение %lx для GP\n" -#: config/tc-arm.c:5283 -msgid "flag for {c}psr instruction expected" -msgstr "" +#: config/tc-alpha.c:5342 +msgid "bad .section directive: want a,s,w,x,M,S,G,T in string" +msgstr "неправильная директива .section: в строке требуется a,s,w,x,M,S,G,T" -#: config/tc-arm.c:5308 -msgid "unrecognized CPS flag" -msgstr "" +#: config/tc-alpha.c:5431 +#, c-format +msgid "internal error: can't hash opcode `%s': %s" +msgstr "внутренняя ошибка: невозможно получить хеш кода операции «%s»: %s" -#: config/tc-arm.c:5315 -msgid "missing CPS flags" -msgstr "" +#: config/tc-alpha.c:5467 +#, c-format +msgid "internal error: can't hash macro `%s': %s" +msgstr "внутренняя ошибка: невозможно получить хеш макроса «%s»: %s" -#: config/tc-arm.c:5338 config/tc-arm.c:5344 -msgid "valid endian specifiers are be or le" -msgstr "" +#: config/tc-alpha.c:5551 config/tc-arc.c:2459 config/tc-arc.c:2473 +#: config/tc-arm.c:7288 config/tc-arm.c:7300 config/tc-i960.c:706 +#: config/tc-xtensa.c:5432 config/tc-xtensa.c:5508 config/tc-xtensa.c:5625 +#: config/tc-z80.c:1935 +msgid "syntax error" +msgstr "синтаксическая ошибка" -#: config/tc-arm.c:5366 -msgid "missing rotation field after comma" +#: config/tc-alpha.c:5681 +msgid "" +"Alpha options:\n" +"-32addr\t\t\ttreat addresses as 32-bit values\n" +"-F\t\t\tlack floating point instructions support\n" +"-mev4 | -mev45 | -mev5 | -mev56 | -mpca56 | -mev6 | -mev67 | -mev68 | -mall\n" +"\t\t\tspecify variant of Alpha architecture\n" +"-m21064 | -m21066 | -m21164 | -m21164a | -m21164pc | -m21264 | -m21264a | -m21264b\n" +"\t\t\tthese variants include PALcode opcodes\n" msgstr "" +"Параметры Alpha:\n" +"-32addr\t\t\tсчитать адреса 32-битными значениями\n" +"-F\t\t\tубрать поддержку инструкций с плавающей запятой\n" +"-mev4 | -mev45 | -mev5 | -mev56 | -mpca56 | -mev6 | -mev67 | -mev68 | -mall\n" +"\t\t\tзадать вариант архитектуры Alpha\n" +"-m21064 | -m21066 | -m21164 | -m21164a | -m21164pc | -m21264 | -m21264a | -m21264b\n" +"\t\t\tэти варианты содержат коды операций PALcode\n" -#: config/tc-arm.c:5381 -msgid "rotation can only be 0, 8, 16, or 24" +#: config/tc-alpha.c:5691 +msgid "" +"VMS options:\n" +"-+\t\t\tencode (don't truncate) names longer than 64 characters\n" +"-H\t\t\tshow new symbol after hash truncation\n" +"-replace/-noreplace\tenable or disable the optimization of procedure calls\n" msgstr "" +"Параметры VMS:\n" +"-+\t\t\tкодировать (не обрезать) имена длиннее 64 символов\n" +"-H\t\t\tпоказывать новый символа после хеш-обрезания\n" +"-replace/-noreplace\tвключить/выключить оптимизацию вызовов процедур\n" -#: config/tc-arm.c:5410 -msgid "condition required" -msgstr "" +#: config/tc-alpha.c:5942 config/tc-arc.c:3086 +#, c-format +msgid "unhandled relocation type %s" +msgstr "необработанный тип перемещения %s" -#: config/tc-arm.c:5448 config/tc-arm.c:7385 -msgid "'[' expected" -msgstr "" +#: config/tc-alpha.c:5955 config/tc-arc.c:3094 +msgid "non-absolute expression in constant field" +msgstr "не абсолютное выражение в поле-константе" -#: config/tc-arm.c:5461 -msgid "',' expected" -msgstr "" +#: config/tc-alpha.c:5969 +#, c-format +msgid "type %d reloc done?\n" +msgstr "выполнено перемещение типа %d?\n" -#: config/tc-arm.c:5478 -msgid "invalid shift" -msgstr "" +#: config/tc-alpha.c:6016 config/tc-alpha.c:6023 +msgid "Used $at without \".set noat\"" +msgstr "Используется $at без «.set noat»" -#: config/tc-arm.c:5551 -msgid "can't use Neon quad register here" -msgstr "" +#: config/tc-alpha.c:6192 +#, c-format +msgid "!samegp reloc against symbol without .prologue: %s" +msgstr "перемещение !samegp для символа без .prologue: %s" -#: config/tc-arm.c:5617 -msgid "expected or or operand" -msgstr "" +#: config/tc-alpha.c:6236 config/tc-arc.c:3217 config/tc-tilegx.c:1751 +#: config/tc-tilepro.c:1531 config/tc-wasm32.c:813 config/tc-xtensa.c:6118 +#, c-format +msgid "cannot represent `%s' relocation in object file" +msgstr "невозможно представить перемещение «%s» в объектном файле" -#: config/tc-arm.c:5697 -msgid "parse error" -msgstr "" +#: config/tc-alpha.c:6242 config/tc-arc.c:3223 +#, c-format +msgid "internal error? cannot generate `%s' relocation" +msgstr "внутренняя ошибка? невозможно сгенерировать перемещение «%s»" -#: config/tc-arm.c:5707 read.c:2135 -msgid "expected comma" -msgstr "" +#: config/tc-alpha.c:6338 +#, c-format +msgid "frame reg expected, using $%d." +msgstr "ожидается регистр кадра, используется $%d." -#: config/tc-arm.c:6018 config/tc-arm.c:6088 -msgid "immediate value is out of range" -msgstr "" +#: config/tc-arc.c:771 +#, c-format +msgid "internal error: can't hash opcode '%s': %s" +msgstr "внутренняя ошибка: невозможно получить хеш кода операции «%s»: %s" -#: config/tc-arm.c:6233 -msgid "iWMMXt data or control register expected" -msgstr "" +#: config/tc-arc.c:779 config/tc-arc.c:2556 config/tc-arc.c:2574 +#: config/tc-arc.c:2627 config/tc-arc.c:2651 config/tc-arc.c:4850 +#: config/tc-arc.c:4917 config/tc-cr16.c:805 config/tc-cr16.c:828 +#: config/tc-cris.c:1195 config/tc-crx.c:535 config/tc-crx.c:562 +#: config/tc-crx.c:580 config/tc-pdp11.c:193 +msgid "Virtual memory exhausted" +msgstr "Закончилась виртуальная память" -#: config/tc-arm.c:6386 +#: config/tc-arc.c:829 #, c-format -msgid "unhandled operand code %d" -msgstr "" +msgid "invalid %s option for %s cpu" +msgstr "неверный параметр %s для ЦП %s" -#: config/tc-arm.c:6465 config/tc-score.c:264 -msgid "garbage following instruction" -msgstr "" +#: config/tc-arc.c:834 +msgid "conflicting ISA extension attributes." +msgstr "не согласующиеся атрибуты расширения ISA." -#. If REG is R13 (the stack pointer), warn that its use is -#. deprecated. -#: config/tc-arm.c:6505 -msgid "use of r13 is deprecated" -msgstr "" +#: config/tc-arc.c:853 +msgid "Multiple .cpu directives found" +msgstr "Найдено несколько директив .cpu" -#: config/tc-arm.c:6575 -msgid "D register out of range for selected VFP version" -msgstr "" +#: config/tc-arc.c:871 +msgid "Command-line value overrides \".cpu\" directive" +msgstr "Значение командной строки заменяет директиву «.cpu»" -#: config/tc-arm.c:6654 -msgid "instruction does not accept preindexed addressing" -msgstr "" +#: config/tc-arc.c:888 +#, c-format +msgid "unknown architecture: %s\n" +msgstr "неизвестная архитектура: %s\n" -#. unindexed - only for coprocessor -#: config/tc-arm.c:6670 config/tc-arm.c:8710 -msgid "instruction does not accept unindexed addressing" -msgstr "" +#: config/tc-arc.c:1187 +msgid "No valid label relocation operand" +msgstr "Некорректный операнд метки перемещения" -#: config/tc-arm.c:6678 -msgid "destination register same as write-back base" -msgstr "" +#: config/tc-arc.c:1209 +#, c-format +msgid "Unknown relocation operand: @%s" +msgstr "Неизвестный операнд перемещения: @%s" -#: config/tc-arm.c:6679 -msgid "source register same as write-back base" -msgstr "" +#: config/tc-arc.c:1222 +#, c-format +msgid "Unable to parse TLS base: %s" +msgstr "Невозможно разобрать базу TLS: %s" -#: config/tc-arm.c:6725 -msgid "instruction does not accept scaled register index" -msgstr "" +#: config/tc-arc.c:1246 +#, c-format +msgid "@%s is not a complex relocation." +msgstr "Значение @%s не является сложным перемещением." -#: config/tc-arm.c:6765 -msgid "instruction does not support unindexed addressing" -msgstr "" +#: config/tc-arc.c:1252 +#, c-format +msgid "Bad expression: @%s + %s." +msgstr "Ошибка в выражении: @%s + %s." -#: config/tc-arm.c:6780 -msgid "pc may not be used with write-back" -msgstr "" +#: config/tc-arc.c:1313 +msgid "Brackets in operand field incorrect" +msgstr "Неверные скобки в поле операнда" -#: config/tc-arm.c:6785 -msgid "instruction does not support writeback" -msgstr "" +#: config/tc-arc.c:1315 config/tc-xtensa.c:2038 +msgid "extra comma" +msgstr "лишняя запятая" -#: config/tc-arm.c:6827 -msgid "invalid pseudo operation" -msgstr "" +#: config/tc-arc.c:1317 config/tc-pru.c:1443 config/tc-pru.c:1710 +#: config/tc-xtensa.c:2042 +msgid "missing argument" +msgstr "пропущен аргумент" -#: config/tc-arm.c:6873 -msgid "literal pool insertion failed" -msgstr "" +#: config/tc-arc.c:1319 config/tc-xtensa.c:2044 +msgid "missing comma or colon" +msgstr "отсутствует запятая или двоеточие" -#: config/tc-arm.c:6931 -msgid "Rn must not overlap other operands" -msgstr "" +#: config/tc-arc.c:1388 +msgid "extra dot" +msgstr "лишняя точка" -#: config/tc-arm.c:7020 config/tc-arm.c:9276 -msgid "bad barrier type" -msgstr "" +#: config/tc-arc.c:1390 +msgid "unrecognized flag" +msgstr "нераспознанный флаг" -#: config/tc-arm.c:7031 config/tc-arm.c:7050 config/tc-arm.c:7063 -#: config/tc-arm.c:9288 config/tc-arm.c:9319 config/tc-arm.c:9341 -msgid "bit-field extends past end of register" -msgstr "" +#: config/tc-arc.c:1392 +msgid "failed to parse flags" +msgstr "ошибка при разборе флагов" -#: config/tc-arm.c:7092 -msgid "the only suffix valid here is '(plt)'" -msgstr "" +#: config/tc-arc.c:1418 +msgid "Unhandled reloc type" +msgstr "необработанный тип перемещения" -#: config/tc-arm.c:7145 -msgid "use of r15 in blx in ARM mode is not really useful" -msgstr "" +#: config/tc-arc.c:2427 +#, c-format +msgid "%s for instruction '%s'" +msgstr "%s в инструкции «%s»" -#: config/tc-arm.c:7167 -msgid "use of r15 in bx in ARM mode is not really useful" -msgstr "" +#: config/tc-arc.c:2429 +#, c-format +msgid "inappropriate arguments for opcode '%s'" +msgstr "неподходящие аргументы для кода операции «%s»" -#: config/tc-arm.c:7192 -msgid "use of r15 in bxj is not really useful" -msgstr "" +#: config/tc-arc.c:2431 +#, c-format +msgid "opcode '%s' not supported for target %s" +msgstr "код операции «%s» не поддерживается для цели %s" -#: config/tc-arm.c:7352 config/tc-arm.c:7361 -msgid "writeback of base register is UNPREDICTABLE" -msgstr "" +#: config/tc-arc.c:2435 config/tc-tic6x.c:3195 +#, c-format +msgid "unknown opcode '%s'" +msgstr "неизвестный код операции «%s»" -#: config/tc-arm.c:7355 -msgid "writeback of base register when in register list is UNPREDICTABLE" -msgstr "" +#: config/tc-arc.c:2493 +#, c-format +msgid "Inserting \"%s\" into register table failed: %s" +msgstr "Не удалось вставить «%s» в таблицу регистров: %s" -#: config/tc-arm.c:7365 -msgid "if writeback register is in list, it must be the lowest reg in the list" -msgstr "" +#: config/tc-arc.c:2529 +#, c-format +msgid "Inserting \"%s\" into address type table failed: %s" +msgstr "Не удалось вставить «%s» в таблицу типов адресов: %s" -#: config/tc-arm.c:7380 -msgid "first destination register must be even" -msgstr "" +#: config/tc-arc.c:2548 config/tc-arc.c:5015 config/tc-h8300.c:81 +#: config/tc-h8300.c:90 config/tc-h8300.c:100 config/tc-h8300.c:110 +#: config/tc-h8300.c:120 config/tc-h8300.c:131 config/tc-h8300.c:248 +#: config/tc-hppa.c:6821 config/tc-hppa.c:6827 config/tc-hppa.c:6833 +#: config/tc-hppa.c:6839 config/tc-hppa.c:8228 config/tc-lm32.c:197 +#: config/tc-mips.c:3588 config/tc-mips.c:4097 config/tc-mn10300.c:935 +#: config/tc-mn10300.c:940 config/tc-mn10300.c:2440 config/tc-xc16x.c:79 +#: config/tc-xc16x.c:86 config/tc-xc16x.c:93 +msgid "could not set architecture and machine" +msgstr "не задана архитектура и машина" -#: config/tc-arm.c:7383 config/tc-arm.c:7450 -msgid "can only load two consecutive registers" -msgstr "" +#: config/tc-arc.c:2644 config/tc-arc.c:4837 +#, c-format +msgid "internal error: can't hash aux register '%s': %s" +msgstr "внутренняя ошибка: невозможно получить хеш регистра aux «%s»: %s" -#. If op 1 were present and equal to PC, this function wouldn't -#. have been called in the first place. -#. If op 2 were present and equal to PC, this function wouldn't -#. have been called in the first place. -#: config/tc-arm.c:7384 config/tc-arm.c:7453 config/tc-arm.c:7982 -#: config/tc-arm.c:9988 -msgid "r14 not allowed here" -msgstr "" +#: config/tc-arc.c:2751 +#, c-format +msgid "unhandled reloc %s in md_pcrel_from_section" +msgstr "необработанное перемещение %s в md_pcrel_from_section" -#: config/tc-arm.c:7398 -msgid "base register written back, and overlaps second destination register" -msgstr "" +#: config/tc-arc.c:2816 +msgid "Unaligned operand. Needs to be 32bit aligned" +msgstr "Невыровненный операнд. Требует 32-битного выравнивания." -#: config/tc-arm.c:7406 -msgid "index register overlaps destination register" -msgstr "" +#: config/tc-arc.c:2821 +msgid "Unaligned operand. Needs to be 16bit aligned" +msgstr "Невыровненный операнд. Требует 16-битного выравнивания." -#: config/tc-arm.c:7436 config/tc-arm.c:7964 -msgid "offset must be zero in ARM encoding" -msgstr "" +#: config/tc-arc.c:2898 config/tc-cr16.c:573 config/tc-crx.c:345 +#: config/tc-mn10200.c:766 write.c:1024 +#, c-format +msgid "can't resolve `%s' {%s section} - `%s' {%s section}" +msgstr "невозможно определить «%s» {раздел %s} — «%s» {раздел %s}" -#: config/tc-arm.c:7447 config/tc-arm.c:7976 -msgid "even register required" -msgstr "" +#: config/tc-arc.c:2957 +#, c-format +msgid "PC relative relocation not allowed for (internal) type %d" +msgstr "PC-относительное перемещение запрещено для (внутреннего) типа %d" -#: config/tc-arm.c:7478 config/tc-arm.c:7509 -msgid "this instruction requires a post-indexed address" -msgstr "" +#. FIXME! Check for the conditionality of +#. the insn. +#. FIXME! Check for the conditionality of +#. the insn. +#: config/tc-arc.c:3002 config/tc-arc.c:3980 +msgid "TLS_*_S9 relocs are not supported yet" +msgstr "Перемещения TLS_*_S9 пока не поддерживаются" -#: config/tc-arm.c:7536 -msgid "Rd and Rm should be different in mla" -msgstr "" +#. I cannot fix an GOTPC relocation because I need to relax it +#. from ld rx,[pcl,@sym@gotpc] to add rx,pcl,@sym@gotpc. +#: config/tc-arc.c:3038 +msgid "Unsupported operation on reloc" +msgstr "неподдерживаемая операция с перемещением" -#: config/tc-arm.c:7560 config/tc-arm.c:10317 -msgid ":lower16: not allowed this instruction" -msgstr "" +#: config/tc-arc.c:3114 config/tc-arc.c:3130 +msgid "unknown fixup size" +msgstr "неизвестный размер местоположения" -#: config/tc-arm.c:7562 -msgid ":upper16: not allowed instruction" -msgstr "" +#: config/tc-arc.c:3264 +msgid "no relaxation found for this instruction." +msgstr "отсутствует ослабление для этой инструкции." -#: config/tc-arm.c:7581 -msgid "operand 1 must be FPSCR" -msgstr "" +#: config/tc-arc.c:3514 +#, c-format +msgid "ARC-specific assembler options:\n" +msgstr "Специализированные параметры ассемблера для ARC:\n" -#: config/tc-arm.c:7614 config/tc-arm.c:10442 -msgid "'CPSR' or 'SPSR' expected" -msgstr "" +#: config/tc-arc.c:3540 +#, c-format +msgid " -mrelax enable relaxation\n" +msgstr " -mrelax включить ослабление\n" -#: config/tc-arm.c:7651 -msgid "Rd and Rm should be different in mul" +#: config/tc-arc.c:3543 +#, c-format +msgid "" +"The following ARC-specific assembler options are deprecated and are accepted\n" +"for compatibility only:\n" msgstr "" +"Следующие специализированные параметры ассемблера для ARC устарели и\n" +"рассматриваются только для совместимости:\n" -#: config/tc-arm.c:7670 config/tc-arm.c:7909 config/tc-arm.c:10572 -msgid "rdhi and rdlo must be different" -msgstr "" +#: config/tc-arc.c:3546 +#, c-format +msgid "" +" -mEA\n" +" -mbarrel-shifter\n" +" -mbarrel_shifter\n" +" -mcrc\n" +" -mdsp-packa\n" +" -mdsp_packa\n" +" -mdvbf\n" +" -mld-extension-reg-mask\n" +" -mlock\n" +" -mmac-24\n" +" -mmac-d16\n" +" -mmac_24\n" +" -mmac_d16\n" +" -mmin-max\n" +" -mmin_max\n" +" -mmul64\n" +" -mno-mpy\n" +" -mnorm\n" +" -mrtsc\n" +" -msimd\n" +" -mswap\n" +" -mswape\n" +" -mtelephony\n" +" -muser-mode-only\n" +" -mxy\n" +msgstr "" +" -mEA\n" +" -mbarrel-shifter\n" +" -mbarrel_shifter\n" +" -mcrc\n" +" -mdsp-packa\n" +" -mdsp_packa\n" +" -mdvbf\n" +" -mld-extension-reg-mask\n" +" -mlock\n" +" -mmac-24\n" +" -mmac-d16\n" +" -mmac_24\n" +" -mmac_d16\n" +" -mmin-max\n" +" -mmin_max\n" +" -mmul64\n" +" -mno-mpy\n" +" -mnorm\n" +" -mrtsc\n" +" -msimd\n" +" -mswap\n" +" -mswape\n" +" -mtelephony\n" +" -muser-mode-only\n" +" -mxy\n" + +#: config/tc-arc.c:3636 +#, c-format +msgid "Unable to find %s relocation for instruction %s" +msgstr "Не удалось найти перемещение %s для инструкции %s" + +#: config/tc-arc.c:3931 +#, c-format +msgid "Unable to use @plt relocation for insn %s" +msgstr "Невозможно использовать перемещение @plt для инструкции %s" + +#: config/tc-arc.c:3950 +#, c-format +msgid "Unable to use @pcl relocation for insn %s" +msgstr "Невозможно использовать перемещение @pcl для инструкции %s" + +#: config/tc-arc.c:4006 +#, c-format +msgid "invalid relocation %s for field" +msgstr "некорректное перемещение %s для поля" + +#: config/tc-arc.c:4117 +#, c-format +msgid "Insn %s has a jump/branch instruction %s in its delay slot." +msgstr "Инструкция %s содержит инструкцию прыжка/ветвления %s в своём слоте задержки." + +#: config/tc-arc.c:4122 +#, c-format +msgid "Insn %s has an instruction %s with limm in its delay slot." +msgstr "Инструкция %s содержит инструкцию %s с limm в своём слоте задержки." + +#: config/tc-arc.c:4232 config/tc-microblaze.c:2531 config/tc-mn10300.c:1069 +#: config/tc-sh.c:801 config/tc-z80.c:700 read.c:4600 +#, c-format +msgid "unsupported BFD relocation size %u" +msgstr "неподдерживаемое перемещение BFD размером %u" -#: config/tc-arm.c:7676 -msgid "rdhi, rdlo and rm must all be different" -msgstr "" +#: config/tc-arc.c:4252 +#, c-format +msgid "Jump/Branch instruction detected at the end of the ZOL label @%s" +msgstr "Обнаружена инструкция прыжка/ветвления в конце метки ZOL @%s" -#: config/tc-arm.c:7741 -msgid "'[' expected after PLD mnemonic" -msgstr "" +#: config/tc-arc.c:4259 +#, c-format +msgid "Kernel instruction detected at the end of the ZOL label @%s" +msgstr "Обнаружена инструкция ядра в конце метки ZOL @%s" -#: config/tc-arm.c:7743 config/tc-arm.c:7758 -msgid "post-indexed expression used in preload instruction" -msgstr "" +#: config/tc-arc.c:4264 +#, c-format +msgid "A jump instruction with long immediate detected at the end of the ZOL label @%s" +msgstr "Обнаружена инструкция прыжка с явным длинным в конце метки ZOL @%s" -#: config/tc-arm.c:7745 config/tc-arm.c:7760 -msgid "writeback used in preload instruction" -msgstr "" +#: config/tc-arc.c:4270 +#, c-format +msgid "An illegal use of delay slot detected at the end of the ZOL label @%s" +msgstr "Обнаружено некорректное использование слота задержки ядра в конце метки ZOL @%s" -#: config/tc-arm.c:7747 config/tc-arm.c:7762 -msgid "unindexed addressing used in preload instruction" -msgstr "" +#: config/tc-arc.c:4375 +msgid "expected comma after instruction name" +msgstr "ожидается запятая после имени инструкции" -#: config/tc-arm.c:7756 -msgid "'[' expected after PLI mnemonic" -msgstr "" +#: config/tc-arc.c:4387 +msgid "expected comma after major opcode" +msgstr "ожидается запятая после основного кода операции" -#: config/tc-arm.c:7935 -msgid "SRS base register must be r13" -msgstr "" +#: config/tc-arc.c:4573 +#, c-format +msgid "Pseudocode already used %s" +msgstr "Псевдокод уже используется %s" -#: config/tc-arm.c:7979 -msgid "can only store two consecutive registers" -msgstr "" +#: config/tc-arc.c:4581 +#, c-format +msgid "major opcode not in range [0x%02x - 0x%02x]" +msgstr "основной код операции не в диапазоне [0x%02x - 0x%02x]" -#: config/tc-arm.c:8074 config/tc-arm.c:8091 -msgid "only two consecutive VFP SP registers allowed here" -msgstr "" +#: config/tc-arc.c:4585 +msgid "minor opcode not in range [0x00 - 0x3f]" +msgstr "вспомогательный код операции не в диапазоне [0x00 - 0x3f]" -#: config/tc-arm.c:8119 config/tc-arm.c:8134 -msgid "this addressing mode requires base-register writeback" -msgstr "" +#: config/tc-arc.c:4591 +msgid "Improper use of OP1_IMM_IMPLIED" +msgstr "Некорректное использование OP1_IMM_IMPLIED" -#: config/tc-arm.c:8308 -msgid "this instruction does not support indexing" -msgstr "" +#: config/tc-arc.c:4597 +msgid "Improper use of OP1_MUST_BE_IMM" +msgstr "Некорректное использование OP1_MUST_BE_IMM" -#: config/tc-arm.c:8331 -msgid "only r15 allowed here" -msgstr "" +#: config/tc-arc.c:4609 +msgid "Couldn't generate extension instruction opcodes" +msgstr "Не удалось сгенерировать коды операций расширенной инструкции" -#: config/tc-arm.c:8466 -msgid "immediate operand requires iWMMXt2" -msgstr "" +#: config/tc-arc.c:4645 +msgid "expected comma after name" +msgstr "ожидается запятая после имени" -#: config/tc-arm.c:8610 -msgid "shift by register not allowed in thumb mode" -msgstr "" +#: config/tc-arc.c:4656 +#, c-format +msgid "%s second argument cannot be a negative number %d" +msgstr "второй аргумент %s не может быть отрицательным числом %d" -#: config/tc-arm.c:8622 config/tc-arm.c:11085 config/tc-arm.c:19719 -msgid "shift expression is too large" -msgstr "" +#: config/tc-arc.c:4671 +msgid "expected comma after register number" +msgstr "ожидается запятая после номера регистра" -#: config/tc-arm.c:8648 -msgid "Instruction does not support =N addresses" -msgstr "" +#: config/tc-arc.c:4692 +msgid "invalid mode" +msgstr "неверный режим" -#: config/tc-arm.c:8653 -msgid "cannot use register index with PC-relative addressing" -msgstr "" +#: config/tc-arc.c:4710 +msgid "expected comma after register mode" +msgstr "ожидается запятая после режима регистра" -#: config/tc-arm.c:8654 -msgid "cannot use register index with this instruction" -msgstr "" +#: config/tc-arc.c:4725 +msgid "shortcut designator invalid" +msgstr "неверное обозначение сокращения" -#: config/tc-arm.c:8656 -msgid "Thumb does not support negative register indexing" -msgstr "" +#: config/tc-arc.c:4824 +#, c-format +msgid "core register %s value (%d) too large" +msgstr "значение ключевого регистра %s (%d) слишком большое" -#: config/tc-arm.c:8658 -msgid "Thumb does not support register post-indexing" -msgstr "" +#: config/tc-arc.c:4843 +#, c-format +msgid "condition code %s value (%d) too large" +msgstr "значение кода условия %s (%d) слишком большое" -#: config/tc-arm.c:8660 -msgid "Thumb does not support register indexing with writeback" -msgstr "" +#: config/tc-arc.c:4862 +msgid "Unknown extension" +msgstr "Неизвестное расширение" -#: config/tc-arm.c:8662 -msgid "Thumb supports only LSL in shifted register indexing" -msgstr "" +#: config/tc-arc.c:4967 +msgid "Overwrite explicitly set Tag_ARC_CPU_base" +msgstr "Перезаписать явное указание Tag_ARC_CPU_base" -#: config/tc-arm.c:8671 config/tc-arm.c:13865 -msgid "shift out of range" -msgstr "" +#: config/tc-arm.c:619 +msgid "ARM register expected" +msgstr "ожидается регистр ARM" -#: config/tc-arm.c:8679 -msgid "cannot use writeback with PC-relative addressing" -msgstr "" +#: config/tc-arm.c:620 +msgid "bad or missing co-processor number" +msgstr "плохой или отсутствующий номер сопроцессора" -#: config/tc-arm.c:8681 -msgid "cannot use writeback with this instruction" -msgstr "" +#: config/tc-arm.c:621 +msgid "co-processor register expected" +msgstr "ожидается регистр сопроцессора" -#: config/tc-arm.c:8700 -msgid "cannot use post-indexing with PC-relative addressing" -msgstr "" +#: config/tc-arm.c:622 +msgid "FPA register expected" +msgstr "ожидается регистр FPA" -#: config/tc-arm.c:8701 -msgid "cannot use post-indexing with this instruction" -msgstr "" +#: config/tc-arm.c:623 +msgid "VFP single precision register expected" +msgstr "ожидается регистр одинарной точности VFP" -#: config/tc-arm.c:8912 -msgid "only SUBS PC, LR, #const allowed" -msgstr "" +#: config/tc-arm.c:624 +msgid "VFP/Neon double precision register expected" +msgstr "ожидается регистр двойной точности VFP/Neon" -#: config/tc-arm.c:8991 config/tc-arm.c:9142 config/tc-arm.c:9239 -#: config/tc-arm.c:10396 config/tc-arm.c:10678 -msgid "shift must be constant" -msgstr "" +#: config/tc-arm.c:625 +msgid "Neon quad precision register expected" +msgstr "ожидается регистр четверной точности Neon" -#: config/tc-arm.c:9018 config/tc-arm.c:9157 config/tc-arm.c:9254 -#: config/tc-arm.c:10409 -msgid "unshifted register required" -msgstr "" +#: config/tc-arm.c:626 +msgid "VFP single or double precision register expected" +msgstr "ожидается регистр одинарной или двойной точности VFP" -#: config/tc-arm.c:9033 config/tc-arm.c:9265 config/tc-arm.c:10533 -msgid "dest must overlap one source register" -msgstr "" +#: config/tc-arm.c:627 +msgid "Neon double or quad precision register expected" +msgstr "ожидается регистр двойной или четверной точности Neon" -#: config/tc-arm.c:9160 -msgid "dest and source1 must be the same register" -msgstr "" +#: config/tc-arm.c:628 +msgid "Neon single or double precision register expected" +msgstr "ожидается регистр одинарной или двойной точности Neon" -#: config/tc-arm.c:9436 -msgid "instruction is always unconditional" -msgstr "" +#: config/tc-arm.c:629 +msgid "VFP single, double or Neon quad precision register expected" +msgstr "ожидается регистр одинарной двойной точности VFP или четверной точности Neon" -#: config/tc-arm.c:9531 -msgid "selected processor does not support 'A' form of this instruction" -msgstr "" +#: config/tc-arm.c:631 +msgid "VFP system register expected" +msgstr "ожидается регистр системный регистр VFP" -#: config/tc-arm.c:9534 -msgid "Thumb does not support the 2-argument form of this instruction" -msgstr "" +#: config/tc-arm.c:632 +msgid "Maverick MVF register expected" +msgstr "ожидается регистр Maverick MVF" -#: config/tc-arm.c:9642 -msgid "SP not allowed in register list" -msgstr "" +#: config/tc-arm.c:633 +msgid "Maverick MVD register expected" +msgstr "ожидается регистр Maverick MVD" -#: config/tc-arm.c:9648 -msgid "LR and PC should not both be in register list" -msgstr "" +#: config/tc-arm.c:634 +msgid "Maverick MVFX register expected" +msgstr "ожидается регистр Maverick MVFX" -#: config/tc-arm.c:9655 -msgid "base register should not be in register list when written back" -msgstr "" +#: config/tc-arm.c:635 +msgid "Maverick MVDX register expected" +msgstr "ожидается регистр Maverick MVDX" -#: config/tc-arm.c:9661 -msgid "PC not allowed in register list" -msgstr "" +#: config/tc-arm.c:636 +msgid "Maverick MVAX register expected" +msgstr "ожидается регистр Maverick MVAX" -#: config/tc-arm.c:9664 config/tc-arm.c:9730 config/tc-arm.c:9770 -#, c-format -msgid "value stored for r%d is UNPREDICTABLE" -msgstr "" +#: config/tc-arm.c:637 +msgid "Maverick DSPSC register expected" +msgstr "ожидается регистр Maverick DSPSC" -#: config/tc-arm.c:9706 -msgid "Thumb load/store multiple does not support {reglist}^" -msgstr "" +#: config/tc-arm.c:638 +msgid "iWMMXt data register expected" +msgstr "ожидается регистр данных iWMMXt" -#: config/tc-arm.c:9763 -msgid "Thumb-2 instruction only valid in unified syntax" -msgstr "" +#: config/tc-arm.c:639 config/tc-arm.c:7061 +msgid "iWMMXt control register expected" +msgstr "ожидается управляющий регистр iWMMXt" -#: config/tc-arm.c:9767 config/tc-arm.c:9777 -msgid "this instruction will write back the base register" -msgstr "" +#: config/tc-arm.c:640 +msgid "iWMMXt scalar register expected" +msgstr "ожидается скалярный регистр iWMMXt" -#: config/tc-arm.c:9780 -msgid "this instruction will not write back the base register" -msgstr "" +#: config/tc-arm.c:641 +msgid "XScale accumulator register expected" +msgstr "ожидается аккумуляторный регистр XScale" -#: config/tc-arm.c:9809 -msgid "r14 not allowed as first register when second register is omitted" -msgstr "" +#. For score5u : div/mul will pop warning message, mmu/alw/asw will pop error message. +#: config/tc-arm.c:803 config/tc-score.c:259 +msgid "bad arguments to instruction" +msgstr "Неправильные аргументы для инструкции" -#: config/tc-arm.c:9911 config/tc-arm.c:9924 config/tc-arm.c:9960 -msgid "Thumb does not support this addressing mode" -msgstr "" +#: config/tc-arm.c:804 +msgid "r13 not allowed here" +msgstr "r13 здесь запрещён" -#: config/tc-arm.c:9928 -msgid "byte or halfword not valid for base register" -msgstr "" +#: config/tc-arm.c:805 +msgid "r15 not allowed here" +msgstr "r15 здесь запрещён" -#: config/tc-arm.c:9931 -msgid "r15 based store not allowed" -msgstr "" +#: config/tc-arm.c:806 +msgid "instruction cannot be conditional" +msgstr "инструкция не может быть условной" -#: config/tc-arm.c:9933 -msgid "invalid base register for register offset" -msgstr "" +#: config/tc-arm.c:807 +msgid "registers may not be the same" +msgstr "регистры не могут быть одинаковыми" -#: config/tc-arm.c:10273 -msgid "shifts in CMP/MOV instructions are only supported in unified syntax" -msgstr "" +#: config/tc-arm.c:808 +msgid "lo register required" +msgstr "требуется другой регистр" -#: config/tc-arm.c:10301 -msgid "only lo regs allowed with immediate" -msgstr "" +#: config/tc-arm.c:809 +msgid "instruction not supported in Thumb16 mode" +msgstr "инструкция не поддерживается в режиме Thumb16" -#: config/tc-arm.c:10322 -msgid ":upper16: not allowed this instruction" -msgstr "" +#: config/tc-arm.c:810 +msgid "instruction does not accept this addressing mode" +msgstr "инструкция не принимает данный режим адресации" -#: config/tc-arm.c:10432 config/tc-arm.c:10438 config/tc-arm.c:10468 -#: config/tc-arm.c:10474 -msgid "selected processor does not support requested special purpose register" -msgstr "" +#: config/tc-arm.c:811 +msgid "branch must be last instruction in IT block" +msgstr "ветвление должно быть последней инструкцией в блоке IT" -#: config/tc-arm.c:10463 -msgid "Thumb encoding does not support an immediate here" -msgstr "" +#: config/tc-arm.c:812 +msgid "instruction not allowed in IT block" +msgstr "инструкция не допускается в блоке IT" -#: config/tc-arm.c:10538 -msgid "Thumb-2 MUL must not set flags" -msgstr "" +#: config/tc-arm.c:813 +msgid "selected FPU does not support instruction" +msgstr "выбранный FPU не поддерживает инструкцию" -#: config/tc-arm.c:10603 -msgid "Thumb does not support NOP with hints" -msgstr "" +#: config/tc-arm.c:814 +msgid "thumb conditional instruction should be in IT block" +msgstr "thumb-инструкция условия должна быть в блоке IT" -#: config/tc-arm.c:10741 -msgid "push/pop do not support {reglist}^" -msgstr "" +#: config/tc-arm.c:815 +msgid "incorrect condition in IT block" +msgstr "некорректное условие в блоке IT" -#: config/tc-arm.c:10764 -msgid "invalid register list to push/pop instruction" -msgstr "" +#: config/tc-arm.c:816 +msgid "IT falling in the range of a previous IT block" +msgstr "IT попадает в диапазон предыдущего блока IT" -#: config/tc-arm.c:10997 -msgid "source1 and dest must be same register" -msgstr "" +#: config/tc-arm.c:817 +msgid "missing .fnstart before unwinding directive" +msgstr "отсутствует .fnstart до раскручивающей директивы" -#: config/tc-arm.c:11018 -msgid "ror #imm not supported" -msgstr "" +#: config/tc-arm.c:819 +msgid "cannot use register index with PC-relative addressing" +msgstr "невозможно использовать индексный регистр с относительной PC адресацией" -#: config/tc-arm.c:11201 -msgid "Thumb encoding does not support rotation" -msgstr "" +#: config/tc-arm.c:821 +msgid "cannot use writeback with PC-relative addressing" +msgstr "невозможно использовать обратную запись с относительной PC адресацией" -#: config/tc-arm.c:11221 -msgid "instruction requires register index" -msgstr "" +#: config/tc-arm.c:823 +msgid "selected processor does not support fp16 instruction" +msgstr "выбранный процессор не поддерживает инструкцию fp16" -#: config/tc-arm.c:11230 -msgid "instruction does not allow shifted index" -msgstr "" +#: config/tc-arm.c:824 +msgid "using " +msgstr "использует " -#: config/tc-arm.c:11640 -msgid "invalid instruction shape" -msgstr "" +#: config/tc-arm.c:825 +msgid "relocation valid in thumb1 code only" +msgstr "перемещение корректно только в коде thumb1" -#: config/tc-arm.c:11883 -msgid "types specified in both the mnemonic and operands" -msgstr "" +#: config/tc-arm.c:1032 +msgid "immediate expression requires a # prefix" +msgstr "для непосредственного выражения требуется префикс #" -#: config/tc-arm.c:11920 -msgid "operand types can't be inferred" -msgstr "" +#: config/tc-arm.c:1061 read.c:3816 +msgid "missing expression" +msgstr "отсутствующее выражение" -#: config/tc-arm.c:11926 -msgid "type specifier has the wrong number of parts" -msgstr "" +#: config/tc-arm.c:1091 config/tc-arm.c:5260 config/tc-i960.c:1298 +#: config/tc-score.c:1210 +msgid "invalid constant" +msgstr "некорректная константа" -#: config/tc-arm.c:11981 config/tc-arm.c:13618 config/tc-arm.c:13625 -msgid "operand size must match register width" -msgstr "" +#: config/tc-arm.c:1223 +msgid "expected #constant" +msgstr "ожидается #константа" -#: config/tc-arm.c:11992 -msgid "bad type in Neon instruction" -msgstr "" +#: config/tc-arm.c:1387 +#, c-format +msgid "unexpected character `%c' in type specifier" +msgstr "неожиданный символ «%c» в определителе типа" -#: config/tc-arm.c:12003 -msgid "inconsistent types in Neon instruction" -msgstr "" +#: config/tc-arm.c:1404 +#, c-format +msgid "bad size %d in type specifier" +msgstr "неправильный размер %d в определителе типа" -#: config/tc-arm.c:13052 -msgid "scalar out of range for multiply instruction" -msgstr "" +#: config/tc-arm.c:1454 +msgid "only one type should be specified for operand" +msgstr "для операнда должен быть задан только один тип" -#: config/tc-arm.c:13216 config/tc-arm.c:13228 -msgid "immediate out of range for insert" -msgstr "" +#: config/tc-arm.c:1460 +msgid "vector type expected" +msgstr "ожидается векторный тип" -#: config/tc-arm.c:13240 config/tc-arm.c:14210 -msgid "immediate out of range for shift" -msgstr "" +#: config/tc-arm.c:1534 +msgid "can't redefine type for operand" +msgstr "для операнда невозможно переопределить тип" -#: config/tc-arm.c:13297 config/tc-arm.c:13324 config/tc-arm.c:13711 -#: config/tc-arm.c:14156 -msgid "immediate out of range" -msgstr "" +#: config/tc-arm.c:1547 +msgid "only D registers may be indexed" +msgstr "только регистры D могут быть проиндексированы" -#: config/tc-arm.c:13361 -msgid "immediate out of range for narrowing operation" -msgstr "" +#: config/tc-arm.c:1553 +msgid "can't change index for operand" +msgstr "для операнда невозможно изменить индекс" -#: config/tc-arm.c:13486 -msgid "operands 0 and 1 must be the same register" -msgstr "" +#: config/tc-arm.c:1616 +msgid "register operand expected, but got scalar" +msgstr "ожидается регистровый операнд, но получен скаляр" -#: config/tc-arm.c:13685 -msgid "operand size must be specified for immediate VMOV" -msgstr "" +#: config/tc-arm.c:1653 +msgid "scalar must have an index" +msgstr "у скаляра должен быть индекс" -#: config/tc-arm.c:13695 -msgid "immediate has bits set outside the operand size" -msgstr "" +#: config/tc-arm.c:1658 config/tc-arm.c:16583 config/tc-arm.c:16643 +#: config/tc-arm.c:17097 +msgid "scalar index out of range" +msgstr "индекс скаляра вне диапазона" -#: config/tc-arm.c:13891 -msgid "elements must be smaller than reversal region" -msgstr "" +#: config/tc-arm.c:1708 +msgid "bad range in register list" +msgstr "некорректный диапазон в списке регистров" -#: config/tc-arm.c:14061 config/tc-arm.c:14109 -msgid "bad type for scalar" -msgstr "" +#: config/tc-arm.c:1716 config/tc-arm.c:1725 config/tc-arm.c:1766 +#, c-format +msgid "Warning: duplicated register (r%d) in register list" +msgstr "Предупреждение: повторяющийся регистр (r%d) в списке регистров" -#: config/tc-arm.c:14173 config/tc-arm.c:14181 -msgid "VFP registers must be adjacent" -msgstr "" +#: config/tc-arm.c:1728 +msgid "Warning: register range not in ascending order" +msgstr "Предупреждение: регистровый диапазон не упорядочен по возрастанию" -#: config/tc-arm.c:14322 -msgid "bad list length for table lookup" -msgstr "" +#: config/tc-arm.c:1739 +msgid "missing `}'" +msgstr "отсутствует «}»" -#: config/tc-arm.c:14352 -msgid "writeback (!) must be used for VLDMDB and VSTMDB" -msgstr "" +#: config/tc-arm.c:1755 +msgid "invalid register mask" +msgstr "некорректная маска регистров" -#: config/tc-arm.c:14355 -msgid "register list must contain at least 1 and at most 16 registers" -msgstr "" +#: config/tc-arm.c:1890 config/tc-arm.c:1934 +msgid "register out of range in list" +msgstr "регистр вне диапазона списка" -#: config/tc-arm.c:14432 -msgid "bad alignment" -msgstr "" +#: config/tc-arm.c:1912 config/tc-arm.c:4197 config/tc-arm.c:4331 +msgid "register list not in ascending order" +msgstr "список регистров не упорядочен по возрастанию" -#: config/tc-arm.c:14449 -msgid "bad list type for instruction" -msgstr "" +#: config/tc-arm.c:1943 +msgid "register range not in ascending order" +msgstr "регистровый диапазон не упорядочен по возрастанию" -#: config/tc-arm.c:14491 -msgid "unsupported alignment for instruction" -msgstr "" +#: config/tc-arm.c:1976 +msgid "non-contiguous register range" +msgstr "не соблюдается непрерывность диапазона регистров" -#: config/tc-arm.c:14510 config/tc-arm.c:14604 config/tc-arm.c:14615 -#: config/tc-arm.c:14625 config/tc-arm.c:14639 -msgid "bad list length" -msgstr "" +#: config/tc-arm.c:2035 +msgid "register stride must be 1 or 2" +msgstr "регистровый шаг должен быть 1 или 2" -#: config/tc-arm.c:14515 -msgid "stride of 2 unavailable when element size is 8" -msgstr "" +#: config/tc-arm.c:2036 +msgid "mismatched element/structure types in list" +msgstr "несовпадение типов элементов/структур в списке" -#: config/tc-arm.c:14548 config/tc-arm.c:14623 -msgid "can't use alignment with this instruction" -msgstr "" +#: config/tc-arm.c:2104 +msgid "don't use Rn-Rm syntax with non-unit stride" +msgstr "не используйте синтаксис Rn-Rm с не элементным шагом" -#: config/tc-arm.c:14687 -msgid "post-index must be a register" -msgstr "" +#: config/tc-arm.c:2159 +msgid "error parsing element/structure list" +msgstr "ошибка при разборе списка элементов/структур" -#: config/tc-arm.c:14689 -msgid "bad register for post-index" -msgstr "" +#: config/tc-arm.c:2165 +msgid "expected }" +msgstr "ожидается }" -#: config/tc-arm.c:15003 config/tc-arm.c:15087 -msgid "conditional infixes are deprecated in unified syntax" -msgstr "" +#: config/tc-arm.c:2256 +msgid "attempt to redefine typed alias" +msgstr "попытка переопределить типизированный псевдоним" -#: config/tc-arm.c:15235 -msgid "Warning: conditional outside an IT block for Thumb." -msgstr "" +#: config/tc-arm.c:2391 +msgid "bad type for register" +msgstr "некорректный тип для регистра" -#: config/tc-arm.c:15440 -msgid "s suffix on comparison instruction is deprecated" -msgstr "" +#: config/tc-arm.c:2402 config/tc-nios2.c:1804 +msgid "expression must be constant" +msgstr "выражение должно быть константой" -#: config/tc-arm.c:15459 config/tc-arm.c:15484 config/tc-arm.c:15548 -#, c-format -msgid "selected processor does not support `%s'" -msgstr "" +#: config/tc-arm.c:2419 +msgid "can't redefine the type of a register alias" +msgstr "невозможно переопределить тип псевдонима регистра" -#: config/tc-arm.c:15465 -msgid "Thumb does not support conditional execution" -msgstr "" +#: config/tc-arm.c:2426 +msgid "you must specify a single type only" +msgstr "необходимо указать только один тип" -#: config/tc-arm.c:15509 -#, c-format -msgid "cannot honor width suffix -- `%s'" -msgstr "" +#: config/tc-arm.c:2439 +msgid "can't redefine the index of a scalar alias" +msgstr "невозможно переопределить индекс псевдонима скаляра" -#: config/tc-arm.c:15553 -#, c-format -msgid "width suffixes are invalid in ARM mode -- `%s'" -msgstr "" +#: config/tc-arm.c:2447 +msgid "scalar index must be constant" +msgstr "скалярный индекс должен быть константой" -#: config/tc-arm.c:15583 -#, c-format -msgid "attempt to use an ARM instruction on a Thumb-only processor -- `%s'" -msgstr "" +#: config/tc-arm.c:2456 +msgid "expecting ]" +msgstr "ожидается ]" -#: config/tc-arm.c:15600 -#, c-format -msgid "section '%s' finished with an open IT block." -msgstr "" +#: config/tc-arm.c:2508 +msgid "invalid syntax for .dn directive" +msgstr "некорректный синтаксис директивы .dn" -#: config/tc-arm.c:15605 -msgid "file finished with an open IT block." -msgstr "" +#: config/tc-arm.c:2514 +msgid "invalid syntax for .qn directive" +msgstr "некорректный синтаксис директивы .qn" -#: config/tc-arm.c:18509 +#: config/tc-arm.c:2549 #, c-format -msgid "alignments greater than %d bytes not supported in .text sections." -msgstr "" +msgid "ignoring attempt to use .unreq on fixed register name: '%s'" +msgstr "игнорируется попытка использовать .unreq для постоянного имени регистра: «%s»" -#: config/tc-arm.c:18777 config/tc-ia64.c:3458 +#: config/tc-arm.c:2814 #, c-format -msgid "Group section `%s' has no group signature" -msgstr "" - -#: config/tc-arm.c:18822 -msgid "handlerdata in cantunwind frame" -msgstr "" - -#: config/tc-arm.c:18839 -msgid "too many unwind opcodes for personality routine 0" -msgstr "" - -#: config/tc-arm.c:18871 -msgid "too many unwind opcodes" -msgstr "" +msgid "Failed to find real start of function: %s\n" +msgstr "Не удалось найти реальное начало функции: %s\n" -#: config/tc-arm.c:19123 -msgid "GOT already in the symbol table" -msgstr "" +#: config/tc-arm.c:2831 +msgid "selected processor does not support THUMB opcodes" +msgstr "выбранный процессор не поддерживает коды операций THUMB" -#: config/tc-arm.c:19435 config/tc-arm.c:19476 config/tc-arm.c:19746 -#, c-format -msgid "undefined symbol %s used as an immediate value" -msgstr "" +#: config/tc-arm.c:2844 +msgid "selected processor does not support ARM opcodes" +msgstr "выбранный процессор не поддерживает коды операций ARM" -#: config/tc-arm.c:19444 config/tc-arm.c:19485 +#: config/tc-arm.c:2856 #, c-format -msgid "symbol %s is in a different section" -msgstr "" +msgid "invalid instruction size selected (%d)" +msgstr "выбран некорректный размер инструкции (%d)" -#: config/tc-arm.c:19458 config/tc-arm.c:19785 +#: config/tc-arm.c:2888 #, c-format -msgid "invalid constant (%lx) after fixup" -msgstr "" +msgid "invalid operand to .code directive (%d) (expecting 16 or 32)" +msgstr "некорректный операнд в директиве .code (%d) (ожидается 16 или 32)" -#: config/tc-arm.c:19513 +#: config/tc-arm.c:2943 #, c-format -msgid "unable to compute ADRL instructions for PC offset of 0x%lx" -msgstr "" - -#: config/tc-arm.c:19548 config/tc-arm.c:19573 -msgid "invalid literal constant: pool needs to be closer" -msgstr "" +msgid "expected comma after name \"%s\"" +msgstr "ожидается запятая после имени «%s»" -#: config/tc-arm.c:19551 config/tc-arm.c:19589 +#: config/tc-arm.c:2993 config/tc-m32r.c:584 #, c-format -msgid "bad immediate value for offset (%ld)" -msgstr "" +msgid "symbol `%s' already defined" +msgstr "символ «%s» уже определён" -#: config/tc-arm.c:19575 +#: config/tc-arm.c:3026 #, c-format -msgid "bad immediate value for 8-bit offset (%ld)" -msgstr "" +msgid "unrecognized syntax mode \"%s\"" +msgstr "нераспознанный синтаксис режима «%s»" -#: config/tc-arm.c:19630 -msgid "offset not a multiple of 4" -msgstr "" +#: config/tc-arm.c:3069 +msgid ".ref pseudo-op only available with -mccs flag." +msgstr "Псевдооперация .ref доступна только с флагом -mccs." -#: config/tc-arm.c:19637 config/tc-arm.c:19652 config/tc-arm.c:19667 -#: config/tc-arm.c:19678 config/tc-arm.c:19701 config/tc-arm.c:20413 -#: config/tc-moxie.c:664 config/tc-pj.c:449 config/tc-sh.c:4190 -msgid "offset out of range" -msgstr "" +#: config/tc-arm.c:3110 +msgid ".asmfunc repeated." +msgstr "повтор .asmfunc." -#: config/tc-arm.c:19801 -msgid "invalid smc expression" -msgstr "" +#: config/tc-arm.c:3114 +msgid ".asmfunc without function." +msgstr ".asmfunc без функции." -#: config/tc-arm.c:19812 config/tc-arm.c:19821 -msgid "invalid swi expression" -msgstr "" +#: config/tc-arm.c:3120 +msgid ".asmfunc pseudo-op only available with -mccs flag." +msgstr "Псевдооперация .asmfunc доступна только с флагом -mccs." -#: config/tc-arm.c:19831 -msgid "invalid expression in load/store multiple" -msgstr "" +#: config/tc-arm.c:3131 +msgid ".endasmfunc without a .asmfunc." +msgstr ".endasmfunc без .asmfunc." -#: config/tc-arm.c:19892 -#, c-format -msgid "blx to '%s' an ARM ISA state function changed to bl" -msgstr "" +#: config/tc-arm.c:3135 +msgid ".endasmfunc without function." +msgstr ".endasmfunc без function." -#: config/tc-arm.c:19911 -msgid "misaligned branch destination" -msgstr "" +#: config/tc-arm.c:3146 +msgid ".endasmfunc pseudo-op only available with -mccs flag." +msgstr "Псевдооперация .endasmfunc доступна только с флагом -mccs." -#: config/tc-arm.c:19915 config/tc-arm.c:19952 config/tc-arm.c:19966 -#: config/tc-arm.c:19979 config/tc-arm.c:20078 config/tc-arm.c:20103 -msgid "branch out of range" -msgstr "" +#: config/tc-arm.c:3155 +msgid ".def pseudo-op only available with -mccs flag." +msgstr "Псевдооперация .def доступна только с флагом -mccs." -#: config/tc-arm.c:20002 -msgid "conditional branch out of range" -msgstr "" +#: config/tc-arm.c:3313 +msgid "invalid type for literal pool" +msgstr "неправильный тип пула литералов" -#: config/tc-arm.c:20038 +#: config/tc-arm.c:3393 config/tc-tic54x.c:5354 #, c-format -msgid "blx to Thumb func '%s' from Thumb ISA state changed to bl" -msgstr "" - -#: config/tc-arm.c:20187 -msgid "rel31 relocation overflow" -msgstr "" +msgid "Invalid label '%s'" +msgstr "Некорректная метка «%s»" -#: config/tc-arm.c:20199 config/tc-arm.c:20222 -msgid "co-processor offset out of range" -msgstr "" +#: config/tc-arm.c:3569 +msgid "(plt) is only valid on branch targets" +msgstr "(plt) допустима только в целях ветвления" -#: config/tc-arm.c:20239 +#: config/tc-arm.c:3575 config/tc-s390.c:1209 config/tc-s390.c:1865 +#: config/tc-xtensa.c:1664 #, c-format -msgid "invalid offset, target not word aligned (0x%08lX)" -msgstr "" +msgid "%s relocations do not fit in %d byte" +msgid_plural "%s relocations do not fit in %d bytes" +msgstr[0] "перемещения %s не помещаются в %d байт" +msgstr[1] "перемещения %s не помещаются в %d байта" +msgstr[2] "перемещения %s не помещаются в %d байт" -#: config/tc-arm.c:20246 config/tc-arm.c:20255 config/tc-arm.c:20263 -#: config/tc-arm.c:20271 config/tc-arm.c:20279 -#, c-format -msgid "invalid offset, value too big (0x%08lX)" -msgstr "" +#: config/tc-arm.c:3657 +msgid ".inst.n operand too big. Use .inst.w instead" +msgstr "Операнд .inst.n слишком большой. Вместо него используйте .inst.w." -#: config/tc-arm.c:20320 -msgid "invalid Hi register with immediate" -msgstr "" +#: config/tc-arm.c:3677 +msgid "cannot determine Thumb instruction size. Use .inst.n/.inst.w instead" +msgstr "Невозможно определить размер инструкции Thumb. Вместо этого используйте .inst.n/.inst.w." -#: config/tc-arm.c:20336 -msgid "invalid immediate for stack address calculation" -msgstr "" +#: config/tc-arm.c:3707 +msgid "width suffixes are invalid in ARM mode" +msgstr "некорректная ширина суффиксов в режиме ARM" -#: config/tc-arm.c:20344 -#, c-format -msgid "invalid immediate for address calculation (value = 0x%08lX)" -msgstr "" +#: config/tc-arm.c:3749 dwarf2dbg.c:990 +msgid "expected 0 or 1" +msgstr "ожидался 0 или 1" -#: config/tc-arm.c:20374 -#, c-format -msgid "invalid immediate: %ld is out of range" -msgstr "" +#: config/tc-arm.c:3753 +msgid "missing comma" +msgstr "отсутствует запятая" -#: config/tc-arm.c:20386 -#, c-format -msgid "invalid shift value: %ld" -msgstr "" +#: config/tc-arm.c:3786 +msgid "duplicate .fnstart directive" +msgstr "повторное употребление .fnstart" -#: config/tc-arm.c:20465 -#, c-format -msgid "the offset 0x%08lX is not representable" -msgstr "" +#: config/tc-arm.c:3817 config/tc-tic6x.c:412 +msgid "duplicate .handlerdata directive" +msgstr "повторное употребление .handlerdata" -#: config/tc-arm.c:20505 -#, c-format -msgid "bad offset 0x%08lX (only 12 bits available for the magnitude)" -msgstr "" +#: config/tc-arm.c:3836 +msgid ".fnend directive without .fnstart" +msgstr "директива .fnend без .fnstart" -#: config/tc-arm.c:20544 -#, c-format -msgid "bad offset 0x%08lX (only 8 bits available for the magnitude)" -msgstr "" +#: config/tc-arm.c:3903 config/tc-tic6x.c:393 +msgid "personality routine specified for cantunwind frame" +msgstr "персонализационная процедура указана для кадра cantunwind" -#: config/tc-arm.c:20584 -#, c-format -msgid "bad offset 0x%08lX (must be word-aligned)" -msgstr "" +#: config/tc-arm.c:3920 config/tc-tic6x.c:454 +msgid "duplicate .personalityindex directive" +msgstr "повторное употребление .personalityindex" -#: config/tc-arm.c:20589 -#, c-format -msgid "bad offset 0x%08lX (must be an 8-bit number of words)" -msgstr "" +#: config/tc-arm.c:3927 config/tc-tic6x.c:461 +msgid "bad personality routine number" +msgstr "Плохой номер персонализационной процедуры" -#: config/tc-arm.c:20620 config/tc-score.c:7398 -#, c-format -msgid "bad relocation fixup type (%d)" -msgstr "" +#: config/tc-arm.c:3949 config/tc-tic6x.c:478 +msgid "duplicate .personality directive" +msgstr "повторное употребление .personality" -#: config/tc-arm.c:20731 -msgid "literal referenced across section boundary" -msgstr "" +#: config/tc-arm.c:3973 config/tc-arm.c:4101 config/tc-arm.c:4149 +msgid "expected register list" +msgstr "ожидается список регистров" -#: config/tc-arm.c:20792 -msgid "internal relocation (type: IMMEDIATE) not fixed up" -msgstr "" +#: config/tc-arm.c:4055 +msgid "expected , " +msgstr "ожидается , <константа>" -#: config/tc-arm.c:20797 -msgid "ADRL used for a symbol not defined in the same file" -msgstr "" +#: config/tc-arm.c:4064 +msgid "number of registers must be in the range [1:4]" +msgstr "количество регистров должно быть в диапазоне [1:4]" -#: config/tc-arm.c:20812 -#, c-format -msgid "undefined local label `%s'" -msgstr "" +#: config/tc-arm.c:4211 config/tc-arm.c:4345 +msgid "bad register range" +msgstr "неверный диапазон регистров" -#: config/tc-arm.c:20818 -msgid "internal_relocation (type: OFFSET_IMM) not fixed up" -msgstr "" +#: config/tc-arm.c:4411 +msgid "FPA .unwind_save does not take a register list" +msgstr "FPA .unwind_save не работает со списком регистров" -#: config/tc-arm.c:20839 config/tc-cris.c:3985 config/tc-mcore.c:1926 -#: config/tc-microblaze.c:1834 config/tc-mmix.c:2862 config/tc-moxie.c:759 -#: config/tc-ns32k.c:2248 config/tc-score.c:7491 -msgid "" -msgstr "" +#: config/tc-arm.c:4439 +msgid ".unwind_save does not support this kind of register" +msgstr ".unwind_save не поддерживает такой вид регистров" -#: config/tc-arm.c:20842 config/tc-arm.c:20863 config/tc-score.c:7493 -#, c-format -msgid "cannot represent %s relocation in this object file format" -msgstr "" +#: config/tc-arm.c:4478 +msgid "SP and PC not permitted in .unwind_movsp directive" +msgstr "SP и PC не допускаются в директиве .unwind_movsp" -#: config/tc-arm.c:21203 -#, c-format -msgid "%s: unexpected function type: %d" -msgstr "" +#: config/tc-arm.c:4483 +msgid "unexpected .unwind_movsp directive" +msgstr "неожиданная директива .unwind_movsp" -#: config/tc-arm.c:21330 -msgid "use of old and new-style options to set CPU type" -msgstr "" +#: config/tc-arm.c:4510 +msgid "stack increment must be multiple of 4" +msgstr "увеличение стека должно быть кратно 4" -#: config/tc-arm.c:21340 -msgid "use of old and new-style options to set FPU type" -msgstr "" +#: config/tc-arm.c:4542 +msgid "expected , " +msgstr "ожидается <регистр>, <регистр>" -#: config/tc-arm.c:21416 -msgid "hard-float conflicts with specified fpu" -msgstr "" +#: config/tc-arm.c:4560 +msgid "register must be either sp or set by a previousunwind_movsp directive" +msgstr "регистр должен быть sp или задаваться директивой previousunwind_movsp" -#: config/tc-arm.c:21603 -msgid "generate PIC code" -msgstr "" +#: config/tc-arm.c:4599 +msgid "expected , " +msgstr "ожидается <смещение>, <код операции>" -#: config/tc-arm.c:21604 -msgid "assemble Thumb code" -msgstr "" +#: config/tc-arm.c:4611 +msgid "unwind opcode too long" +msgstr "раскрученный код операции слишком длинен" -#: config/tc-arm.c:21605 -msgid "support ARM/Thumb interworking" -msgstr "" +#: config/tc-arm.c:4616 +msgid "invalid unwind opcode" +msgstr "неверный раскрученный код операции" -#: config/tc-arm.c:21607 -msgid "code uses 32-bit program counter" -msgstr "" +#: config/tc-arm.c:4804 config/tc-arm.c:5815 config/tc-arm.c:10659 +#: config/tc-arm.c:11192 config/tc-arm.c:13219 config/tc-arm.c:14801 +#: config/tc-arm.c:24170 config/tc-arm.c:24234 config/tc-arm.c:24242 +#: config/tc-metag.c:5176 config/tc-z8k.c:1151 config/tc-z8k.c:1161 +msgid "immediate value out of range" +msgstr "непосредственное значение за пределами диапазона" -#: config/tc-arm.c:21608 -msgid "code uses 26-bit program counter" -msgstr "" +#: config/tc-arm.c:4974 +msgid "invalid FPA immediate expression" +msgstr "неверное непосредственное выражение FPA" -#: config/tc-arm.c:21609 -msgid "floating point args are in fp regs" -msgstr "" +#: config/tc-arm.c:5160 +msgid "'LSL' or 'ASR' required" +msgstr "требуется «LSL» или «ASR»" -#: config/tc-arm.c:21611 -msgid "re-entrant code" -msgstr "" +#: config/tc-arm.c:5168 +msgid "'LSL' required" +msgstr "требуется «LSL»" -#: config/tc-arm.c:21612 -msgid "code is ATPCS conformant" -msgstr "" +#: config/tc-arm.c:5176 +msgid "'ASR' required" +msgstr "требуется «ASR»" -#: config/tc-arm.c:21613 -msgid "assemble for big-endian" -msgstr "" +#: config/tc-arm.c:5255 +msgid "invalid rotation" +msgstr "неверное вращение" -#: config/tc-arm.c:21614 -msgid "assemble for little-endian" -msgstr "" +#: config/tc-arm.c:5435 config/tc-arm.c:5604 +msgid "unknown group relocation" +msgstr "неизвестная группа перемещения" -#. These are recognized by the assembler, but have no affect on code. -#: config/tc-arm.c:21618 -msgid "use frame pointer" -msgstr "" +#: config/tc-arm.c:5471 +msgid "alignment must be constant" +msgstr "выравнивание должно быть константой" -#: config/tc-arm.c:21619 -msgid "use stack size checking" -msgstr "" +#: config/tc-arm.c:5635 +msgid "this group relocation is not allowed on this instruction" +msgstr "данная группа перемещения недопустима для этой инструкции" -#: config/tc-arm.c:21622 -msgid "do not warn on use of deprecated feature" -msgstr "" +#: config/tc-arm.c:5691 +msgid "'}' expected at end of 'option' field" +msgstr "ожидается «}» в конце поля «option»" -#. DON'T add any new processors to this list -- we want the whole list -#. to go away... Add them to the processors table instead. -#: config/tc-arm.c:21639 config/tc-arm.c:21640 -msgid "use -mcpu=arm1" -msgstr "" +#: config/tc-arm.c:5696 +msgid "cannot combine index with option" +msgstr "нельзя объединять индекс с параметром" -#: config/tc-arm.c:21641 config/tc-arm.c:21642 -msgid "use -mcpu=arm2" -msgstr "" +#: config/tc-arm.c:5953 +msgid "unexpected bit specified after APSR" +msgstr "указан неожиданный бит после APSR" -#: config/tc-arm.c:21643 config/tc-arm.c:21644 -msgid "use -mcpu=arm250" -msgstr "" +#: config/tc-arm.c:5965 +msgid "selected processor does not support DSP extension" +msgstr "выбранный процессор не поддерживает расширение DSP" -#: config/tc-arm.c:21645 config/tc-arm.c:21646 -msgid "use -mcpu=arm3" -msgstr "" +#: config/tc-arm.c:5977 +msgid "bad bitmask specified after APSR" +msgstr "указана плохая битовая маска после APSR" -#: config/tc-arm.c:21647 config/tc-arm.c:21648 -msgid "use -mcpu=arm6" -msgstr "" +#: config/tc-arm.c:6001 +msgid "writing to APSR without specifying a bitmask is deprecated" +msgstr "запись в APSR без указания битовой маски устарела" -#: config/tc-arm.c:21649 config/tc-arm.c:21650 -msgid "use -mcpu=arm600" -msgstr "" +#: config/tc-arm.c:6013 config/tc-arm.c:12353 config/tc-arm.c:12398 +#: config/tc-arm.c:12402 +msgid "selected processor does not support requested special purpose register" +msgstr "выбранный процессор не поддерживает запрошенный регистр специальных возможностей" -#: config/tc-arm.c:21651 config/tc-arm.c:21652 -msgid "use -mcpu=arm610" -msgstr "" +#: config/tc-arm.c:6018 +msgid "flag for {c}psr instruction expected" +msgstr "ожидается флаг для инструкции {c}ps" -#: config/tc-arm.c:21653 config/tc-arm.c:21654 -msgid "use -mcpu=arm620" -msgstr "" +#: config/tc-arm.c:6043 +msgid "unrecognized CPS flag" +msgstr "нераспознанный флаг CPS" -#: config/tc-arm.c:21655 config/tc-arm.c:21656 -msgid "use -mcpu=arm7" -msgstr "" +#: config/tc-arm.c:6050 +msgid "missing CPS flags" +msgstr "отсутствуют флаги CPS" -#: config/tc-arm.c:21657 config/tc-arm.c:21658 -msgid "use -mcpu=arm70" -msgstr "" +#: config/tc-arm.c:6073 config/tc-arm.c:6079 +msgid "valid endian specifiers are be or le" +msgstr "определителем порядка байт могут быть be или le" -#: config/tc-arm.c:21659 config/tc-arm.c:21660 -msgid "use -mcpu=arm700" -msgstr "" +#: config/tc-arm.c:6101 +msgid "missing rotation field after comma" +msgstr "отсутствует поле вращения после запятой" -#: config/tc-arm.c:21661 config/tc-arm.c:21662 -msgid "use -mcpu=arm700i" -msgstr "" +#: config/tc-arm.c:6116 +msgid "rotation can only be 0, 8, 16, or 24" +msgstr "значением вращения могут быть только 0, 8, 16 или 24" -#: config/tc-arm.c:21663 config/tc-arm.c:21664 -msgid "use -mcpu=arm710" -msgstr "" +#: config/tc-arm.c:6145 +msgid "condition required" +msgstr "требуется условие" -#: config/tc-arm.c:21665 config/tc-arm.c:21666 -msgid "use -mcpu=arm710c" -msgstr "" +#: config/tc-arm.c:6213 config/tc-arm.c:8943 +msgid "'[' expected" +msgstr "ожидается «[»" -#: config/tc-arm.c:21667 config/tc-arm.c:21668 -msgid "use -mcpu=arm720" -msgstr "" +#: config/tc-arm.c:6226 +msgid "',' expected" +msgstr "ожидается «,»" -#: config/tc-arm.c:21669 config/tc-arm.c:21670 -msgid "use -mcpu=arm7d" -msgstr "" +#: config/tc-arm.c:6243 +msgid "invalid shift" +msgstr "некорректный сдвиг" -#: config/tc-arm.c:21671 config/tc-arm.c:21672 -msgid "use -mcpu=arm7di" -msgstr "" +#: config/tc-arm.c:6316 +msgid "can't use Neon quad register here" +msgstr "здесь нельзя использовать четверной регистр Neon" -#: config/tc-arm.c:21673 config/tc-arm.c:21674 -msgid "use -mcpu=arm7m" -msgstr "" +#: config/tc-arm.c:6383 +msgid "expected or or operand" +msgstr "ожидается операнд , или " -#: config/tc-arm.c:21675 config/tc-arm.c:21676 -msgid "use -mcpu=arm7dm" -msgstr "" +#: config/tc-arm.c:6463 +msgid "parse error" +msgstr "ошибка разбора" -#: config/tc-arm.c:21677 config/tc-arm.c:21678 -msgid "use -mcpu=arm7dmi" -msgstr "" +#. ISB can only take SY as an option. +#: config/tc-arm.c:6732 +msgid "invalid barrier type" +msgstr "неверный тип барьера" -#: config/tc-arm.c:21679 config/tc-arm.c:21680 -msgid "use -mcpu=arm7100" -msgstr "" +#: config/tc-arm.c:6829 +msgid "only floating point zero is allowed as immediate value" +msgstr "непосредственным значением в качестве числа с плавающей точкой разрешён только ноль" -#: config/tc-arm.c:21681 config/tc-arm.c:21682 -msgid "use -mcpu=arm7500" -msgstr "" +#: config/tc-arm.c:6899 +msgid "immediate value is out of range" +msgstr "непосредственное значение за пределами диапазона" -#: config/tc-arm.c:21683 config/tc-arm.c:21684 -msgid "use -mcpu=arm7500fe" -msgstr "" +#: config/tc-arm.c:7046 +msgid "iWMMXt data or control register expected" +msgstr "ожидается управляющий регистр или регистр данных iWMMXt" -#: config/tc-arm.c:21685 config/tc-arm.c:21686 config/tc-arm.c:21687 -#: config/tc-arm.c:21688 -msgid "use -mcpu=arm7tdmi" -msgstr "" +#: config/tc-arm.c:7086 +msgid "Banked registers are not available with this architecture." +msgstr "Банкование регистров недоступно на этой архитектуре." -#: config/tc-arm.c:21689 config/tc-arm.c:21690 -msgid "use -mcpu=arm710t" -msgstr "" +#: config/tc-arm.c:7314 config/tc-score.c:264 +msgid "garbage following instruction" +msgstr "мусор после инструкции" -#: config/tc-arm.c:21691 config/tc-arm.c:21692 -msgid "use -mcpu=arm720t" -msgstr "" +#. If REG is R13 (the stack pointer), warn that its use is +#. deprecated. +#: config/tc-arm.c:7364 +msgid "use of r13 is deprecated" +msgstr "использование r13 устарело" -#: config/tc-arm.c:21693 config/tc-arm.c:21694 -msgid "use -mcpu=arm740t" -msgstr "" +#: config/tc-arm.c:7382 +msgid "ARMv8.2 scalar fp16 instruction cannot be conditional, the behaviour is UNPREDICTABLE" +msgstr "скалярная инструкция ARMv8.2 fp16 не может быть условной, поведение НЕПРЕДСКАЗУЕМО" -#: config/tc-arm.c:21695 config/tc-arm.c:21696 -msgid "use -mcpu=arm8" -msgstr "" +#: config/tc-arm.c:7457 +msgid "D register out of range for selected VFP version" +msgstr "регистр D вне диапазона выбранной версии VFP" -#: config/tc-arm.c:21697 config/tc-arm.c:21698 -msgid "use -mcpu=arm810" -msgstr "" +#: config/tc-arm.c:7554 config/tc-arm.c:10378 +msgid "Instruction does not support =N addresses" +msgstr "инструкция не поддерживает адреса =N" -#: config/tc-arm.c:21699 config/tc-arm.c:21700 -msgid "use -mcpu=arm9" -msgstr "" +#: config/tc-arm.c:7562 +msgid "instruction does not accept preindexed addressing" +msgstr "инструкция не принимает прединдексированную адресацию" -#: config/tc-arm.c:21701 config/tc-arm.c:21702 -msgid "use -mcpu=arm9tdmi" -msgstr "" +#. unindexed - only for coprocessor +#: config/tc-arm.c:7578 config/tc-arm.c:10441 +msgid "instruction does not accept unindexed addressing" +msgstr "инструкция не принимает неиндексированную адресацию" -#: config/tc-arm.c:21703 config/tc-arm.c:21704 -msgid "use -mcpu=arm920" -msgstr "" +#: config/tc-arm.c:7586 +msgid "destination register same as write-back base" +msgstr "регистр назначения совпадает с базовым обратной записи" -#: config/tc-arm.c:21705 config/tc-arm.c:21706 -msgid "use -mcpu=arm940" -msgstr "" +#: config/tc-arm.c:7587 +msgid "source register same as write-back base" +msgstr "регистр-источник совпадает с базовым обратной записи" -#: config/tc-arm.c:21707 -msgid "use -mcpu=strongarm" -msgstr "" +#: config/tc-arm.c:7637 +msgid "use of PC in this instruction is deprecated" +msgstr "использование PC в этой инструкции устарело" -#: config/tc-arm.c:21709 -msgid "use -mcpu=strongarm110" -msgstr "" +#: config/tc-arm.c:7660 +msgid "instruction does not accept scaled register index" +msgstr "инструкция не принимает масштабированный регистровый индекс" -#: config/tc-arm.c:21711 -msgid "use -mcpu=strongarm1100" -msgstr "" +#: config/tc-arm.c:7965 +msgid "invalid pseudo operation" +msgstr "неверная псевдооперация" -#: config/tc-arm.c:21713 -msgid "use -mcpu=strongarm1110" -msgstr "" +#: config/tc-arm.c:8203 +msgid "invalid co-processor operand" +msgstr "некорректный операнд сопроцессора" -#: config/tc-arm.c:21714 -msgid "use -mcpu=xscale" -msgstr "" +#: config/tc-arm.c:8219 +msgid "instruction does not support unindexed addressing" +msgstr "инструкция не поддерживает неиндексированную адресацию" -#: config/tc-arm.c:21715 -msgid "use -mcpu=iwmmxt" -msgstr "" +#: config/tc-arm.c:8234 +msgid "pc may not be used with write-back" +msgstr "pc нельзя использовать с обратной записью" -#: config/tc-arm.c:21716 -msgid "use -mcpu=all" -msgstr "" +#: config/tc-arm.c:8239 +msgid "instruction does not support writeback" +msgstr "инструкция не поддерживает обратную запись" -#. Architecture variants -- don't add any more to this list either. -#: config/tc-arm.c:21719 config/tc-arm.c:21720 -msgid "use -march=armv2" -msgstr "" +#: config/tc-arm.c:8345 +msgid "Rn must not overlap other operands" +msgstr "Rn не должен пересекаться с другими операндами" -#: config/tc-arm.c:21721 config/tc-arm.c:21722 -msgid "use -march=armv2a" -msgstr "" +#: config/tc-arm.c:8350 +msgid "swp{b} use is obsoleted for ARMv8 and later" +msgstr "использование swp{b} устарело в ARMv8 и более новых" -#: config/tc-arm.c:21723 config/tc-arm.c:21724 -msgid "use -march=armv3" -msgstr "" +#: config/tc-arm.c:8353 +msgid "swp{b} use is deprecated for ARMv6 and ARMv7" +msgstr "использование swp{b} устарело в ARMv6 и ARMv7" -#: config/tc-arm.c:21725 config/tc-arm.c:21726 -msgid "use -march=armv3m" -msgstr "" +#: config/tc-arm.c:8470 config/tc-arm.c:8489 config/tc-arm.c:8502 +#: config/tc-arm.c:11029 config/tc-arm.c:11060 config/tc-arm.c:11082 +msgid "bit-field extends past end of register" +msgstr "битовое поле выходит за границы регистра" -#: config/tc-arm.c:21727 config/tc-arm.c:21728 -msgid "use -march=armv4" -msgstr "" +#: config/tc-arm.c:8532 +msgid "the only valid suffixes here are '(plt)' and '(tlscall)'" +msgstr "допустимыми суффиксами здесь могут быть только «(plt)» и «(tlscall)»" -#: config/tc-arm.c:21729 config/tc-arm.c:21730 -msgid "use -march=armv4t" -msgstr "" +#: config/tc-arm.c:8585 +msgid "use of r15 in blx in ARM mode is not really useful" +msgstr "использование r15 в blx в режиме ARM не особенно полезно" -#: config/tc-arm.c:21731 config/tc-arm.c:21732 -msgid "use -march=armv5" -msgstr "" +#: config/tc-arm.c:8607 +msgid "use of r15 in bx in ARM mode is not really useful" +msgstr "использование r15 в bx в режиме ARM не особенно полезно" -#: config/tc-arm.c:21733 config/tc-arm.c:21734 -msgid "use -march=armv5t" -msgstr "" +#: config/tc-arm.c:8632 +msgid "use of r15 in bxj is not really useful" +msgstr "использование r15 в bxj не особенно полезно" -#: config/tc-arm.c:21735 config/tc-arm.c:21736 -msgid "use -march=armv5te" -msgstr "" +#: config/tc-arm.c:8680 +msgid "This coprocessor register access is deprecated in ARMv8" +msgstr "Такой доступ к регистру сопроцессора устарел в ARMv8" -#. Floating point variants -- don't add any more to this list either. -#: config/tc-arm.c:21739 -msgid "use -mfpu=fpe" -msgstr "" +#: config/tc-arm.c:8888 config/tc-arm.c:8897 +msgid "writeback of base register is UNPREDICTABLE" +msgstr "обратная запись в базовый регистр вызывает НЕПРЕДСКАЗУЕМОСТЬ" -#: config/tc-arm.c:21740 -msgid "use -mfpu=fpa10" -msgstr "" +#: config/tc-arm.c:8891 +msgid "writeback of base register when in register list is UNPREDICTABLE" +msgstr "обратная запись в базовый регистр при его нахождении в списке регистров вызывает НЕПРЕДСКАЗУЕМОСТЬ" -#: config/tc-arm.c:21741 -msgid "use -mfpu=fpa11" -msgstr "" +#: config/tc-arm.c:8901 +msgid "if writeback register is in list, it must be the lowest reg in the list" +msgstr "если регистр обратной записи в списке, то он должен быть самым нижним регистром в списке" -#: config/tc-arm.c:21743 -msgid "use either -mfpu=softfpa or -mfpu=softvfp" -msgstr "" +#: config/tc-arm.c:8938 +msgid "first transfer register must be even" +msgstr "первый регистр передачи должен быть чётным" -#: config/tc-arm.c:22018 -msgid "invalid architectural extension" -msgstr "" +#: config/tc-arm.c:8941 +msgid "can only transfer two consecutive registers" +msgstr "передача допустима только для двух последовательных регистра" -#: config/tc-arm.c:22032 -msgid "missing architectural extension" -msgstr "" +#. If op 1 were present and equal to PC, this function wouldn't +#. have been called in the first place. +#. If op 2 were present and equal to PC, this function wouldn't +#. have been called in the first place. +#: config/tc-arm.c:8942 config/tc-arm.c:9012 config/tc-arm.c:9676 +#: config/tc-arm.c:11844 +msgid "r14 not allowed here" +msgstr "r14 здесь запрещён" -#: config/tc-arm.c:22045 -#, c-format -msgid "unknown architectural extension `%s'" -msgstr "" +#: config/tc-arm.c:8954 +msgid "base register written back, and overlaps second transfer register" +msgstr "в базовый регистр выполняется обратная запись и он пересекается со вторым регистром передачи" -#: config/tc-arm.c:22069 -#, c-format -msgid "missing cpu name `%s'" -msgstr "" +#: config/tc-arm.c:8964 +msgid "index register overlaps transfer register" +msgstr "индексный регистр пересекается с регистром передачи" -#: config/tc-arm.c:22095 config/tc-arm.c:22530 -#, c-format -msgid "unknown cpu `%s'" -msgstr "" +#: config/tc-arm.c:8993 config/tc-arm.c:9643 +msgid "offset must be zero in ARM encoding" +msgstr "смещение должно быть нулевым при кодировании ARM" -#: config/tc-arm.c:22113 -#, c-format -msgid "missing architecture name `%s'" -msgstr "" +#: config/tc-arm.c:9006 config/tc-arm.c:9670 +msgid "even register required" +msgstr "требуется чётный регистр" -#: config/tc-arm.c:22130 config/tc-arm.c:22564 config/tc-arm.c:22595 -#: config/tc-score.c:7728 -#, c-format -msgid "unknown architecture `%s'\n" -msgstr "" +#: config/tc-arm.c:9009 +msgid "can only load two consecutive registers" +msgstr "загрузка допустима только в два последовательных регистра" -#: config/tc-arm.c:22146 config/tc-arm.c:22625 -#, c-format -msgid "unknown floating point format `%s'\n" -msgstr "" +#: config/tc-arm.c:9027 +msgid "ldr to register 15 must be 4-byte aligned" +msgstr "ldr в регистр 15 должна быть выровнена по 4-байтовой границе" -#: config/tc-arm.c:22162 -#, c-format -msgid "unknown floating point abi `%s'\n" -msgstr "" +#: config/tc-arm.c:9050 config/tc-arm.c:9082 +msgid "this instruction requires a post-indexed address" +msgstr "для данной инструкции требуется пост-индексируемый адрес" -#: config/tc-arm.c:22178 -#, c-format -msgid "unknown EABI `%s'\n" -msgstr "" +#: config/tc-arm.c:9109 +msgid "Rd and Rm should be different in mla" +msgstr "Rd и Rm должны различаться в mla" + +#: config/tc-arm.c:9136 config/tc-arm.c:12217 +msgid ":lower16: not allowed in this instruction" +msgstr ":lower16: запрещён в этой инструкции" + +#: config/tc-arm.c:9138 config/tc-arm.c:12222 +msgid ":upper16: not allowed in this instruction" +msgstr ":upper16: запрещён в этой инструкции" + +#: config/tc-arm.c:9155 +msgid "operand 1 must be FPSCR" +msgstr "операнд 1 должен быть FPSCR" + +#: config/tc-arm.c:9247 config/tc-arm.c:12336 +msgid "bad register for mrs" +msgstr "неверный регистр для mrs" + +#: config/tc-arm.c:9254 config/tc-arm.c:12360 +msgid "'APSR', 'CPSR' or 'SPSR' expected" +msgstr "ожидается «APSR», «CPSR» или «SPSR»" + +#: config/tc-arm.c:9295 +msgid "Rd and Rm should be different in mul" +msgstr "Rd и Rm должны различаться в mul" + +#: config/tc-arm.c:9314 config/tc-arm.c:9588 config/tc-arm.c:12499 +msgid "rdhi and rdlo must be different" +msgstr "rdhi и rdlo должны различаться" + +#: config/tc-arm.c:9320 +msgid "rdhi, rdlo and rm must all be different" +msgstr "rdhi, rdlo и rm должны различаться" + +#: config/tc-arm.c:9386 +msgid "'[' expected after PLD mnemonic" +msgstr "после мнемоники PLD ожидается «[»" + +#: config/tc-arm.c:9388 config/tc-arm.c:9403 +msgid "post-indexed expression used in preload instruction" +msgstr "в инструкции предварительной загрузки используется пост-индексируемое выражение" + +#: config/tc-arm.c:9390 config/tc-arm.c:9405 +msgid "writeback used in preload instruction" +msgstr "в инструкции предварительной загрузки используется обратная запись" + +#: config/tc-arm.c:9392 config/tc-arm.c:9407 +msgid "unindexed addressing used in preload instruction" +msgstr "в инструкции предварительной загрузки используется неиндексированная адресация" + +#: config/tc-arm.c:9401 +msgid "'[' expected after PLI mnemonic" +msgstr "после мнемоники PLI ожидается «[»" + +#: config/tc-arm.c:9416 config/tc-arm.c:12668 +msgid "push/pop do not support {reglist}^" +msgstr "push/pop не поддерживают {reglist}^" + +#: config/tc-arm.c:9494 config/tc-arm.c:12815 +msgid "setend use is deprecated for ARMv8" +msgstr "использование setend устарело в ARMv8" + +#: config/tc-arm.c:9515 config/tc-arm.c:12876 config/tc-arm.c:12908 +#: config/tc-arm.c:12951 +msgid "extraneous shift as part of operand to shift insn" +msgstr "в инструкции сдвига излишний сдвиг как часть операнда" + +#: config/tc-arm.c:9546 config/tc-arm.c:9555 +msgid "selected processor does not support SETPAN instruction" +msgstr "выбранный процессор не поддерживает инструкцию SETPAN" + +#: config/tc-arm.c:9614 +msgid "SRS base register must be r13" +msgstr "базовый регистр SRS должен быть r13" + +#: config/tc-arm.c:9673 +msgid "can only store two consecutive registers" +msgstr "сохранение допустимо только в два последовательных регистра" + +#: config/tc-arm.c:9787 config/tc-arm.c:9804 +msgid "only two consecutive VFP SP registers allowed here" +msgstr "здесь разрешены только два последовательных регистра VFP SP" + +#: config/tc-arm.c:9832 config/tc-arm.c:9847 +msgid "this addressing mode requires base-register writeback" +msgstr "для данного режима адресации требуется базовый регистр обратной записи" + +#. If srcsize is 16, inst.operands[1].imm must be in the range 0-16. +#. i.e. immbits must be in range 0 - 16. +#: config/tc-arm.c:9964 +msgid "immediate value out of range, expected range [0, 16]" +msgstr "непосредственное значение за пределами диапазона, ожидаемый диапазон [0, 16]" + +#. If srcsize is 32, inst.operands[1].imm must be in the range 1-32. +#. i.e. immbits must be in range 0 - 31. +#: config/tc-arm.c:9971 +msgid "immediate value out of range, expected range [1, 32]" +msgstr "непосредственное значение за пределами диапазона, ожидаемый диапазон [1, 32]" + +#: config/tc-arm.c:10037 +msgid "this instruction does not support indexing" +msgstr "данная инструкция не поддерживает индексацию" + +#: config/tc-arm.c:10060 +msgid "only r15 allowed here" +msgstr "здесь разрешён только r15" + +#: config/tc-arm.c:10195 +msgid "immediate operand requires iWMMXt2" +msgstr "требуется непосредственный операнд iWMMXt2" + +#: config/tc-arm.c:10339 +msgid "shift by register not allowed in thumb mode" +msgstr "сдвиг регистром запрещён в режиме thumb" + +#: config/tc-arm.c:10351 config/tc-arm.c:13059 config/tc-arm.c:23513 +msgid "shift expression is too large" +msgstr "выражение сдвига слишком большое" + +#: config/tc-arm.c:10384 +msgid "cannot use register index with this instruction" +msgstr "невозможно использовать индексный регистр с этой инструкцией" + +#: config/tc-arm.c:10386 +msgid "Thumb does not support negative register indexing" +msgstr "Thumb не поддерживает отрицательные индексный регистры" + +#: config/tc-arm.c:10388 +msgid "Thumb does not support register post-indexing" +msgstr "Thumb не поддерживает регистровую пост-индексацию" + +#: config/tc-arm.c:10390 +msgid "Thumb does not support register indexing with writeback" +msgstr "Thumb не поддерживает регистровую индексацию с обратной записью" + +#: config/tc-arm.c:10392 +msgid "Thumb supports only LSL in shifted register indexing" +msgstr "Thumb поддерживает только LSL в регистровой индексации сдвигом" + +#: config/tc-arm.c:10401 config/tc-arm.c:16374 +msgid "shift out of range" +msgstr "сдвиг вне диапазона" + +#: config/tc-arm.c:10410 +msgid "cannot use writeback with this instruction" +msgstr "невозможно использовать обратную запись с этой инструкцией" + +#: config/tc-arm.c:10431 +msgid "cannot use post-indexing with PC-relative addressing" +msgstr "невозможно использовать пост-индексацию с относительной PC адресацией" + +#: config/tc-arm.c:10432 +msgid "cannot use post-indexing with this instruction" +msgstr "невозможно использовать пост-индексацию с этой инструкцией" + +#: config/tc-arm.c:10654 +msgid "only SUBS PC, LR, #const allowed" +msgstr "разрешены только SUBS PC, LR, #const" + +#: config/tc-arm.c:10737 config/tc-arm.c:10897 config/tc-arm.c:10994 +#: config/tc-arm.c:12297 config/tc-arm.c:12605 +msgid "shift must be constant" +msgstr "сдвиг должен быть константой" + +#: config/tc-arm.c:10742 +msgid "shift value over 3 not allowed in thumb mode" +msgstr "значения сдвига больше 3 запрещено в режиме thumb" + +#: config/tc-arm.c:10744 +msgid "only LSL shift allowed in thumb mode" +msgstr "в режиме thumb допускается только сдвиг LSL" + +#: config/tc-arm.c:10768 config/tc-arm.c:10912 config/tc-arm.c:11009 +#: config/tc-arm.c:12310 +msgid "unshifted register required" +msgstr "требуется не сдвиговый регистр" + +#: config/tc-arm.c:10783 config/tc-arm.c:11020 config/tc-arm.c:12460 +msgid "dest must overlap one source register" +msgstr "назначение должно пересекаться с одним из регистров источника" + +#: config/tc-arm.c:10915 +msgid "dest and source1 must be the same register" +msgstr "назначение и источник1 должны быть одним и тем же регистром" + +#: config/tc-arm.c:11155 +msgid "selected architecture does not support wide conditional branch instruction" +msgstr "выбранная архитектура не поддерживает инструкцию широкого условного ветвления" + +#: config/tc-arm.c:11188 +msgid "instruction is always unconditional" +msgstr "инструкция всегда безусловная" + +#: config/tc-arm.c:11309 +msgid "selected processor does not support 'A' form of this instruction" +msgstr "выбранный процессор не поддерживает форму «A» этой инструкции" + +#: config/tc-arm.c:11312 +msgid "Thumb does not support the 2-argument form of this instruction" +msgstr "Thumb не поддерживает 2-аргументную форму этой инструкции" + +#: config/tc-arm.c:11433 +msgid "SP not allowed in register list" +msgstr "SP не допускается указывать в списке регистров" + +#: config/tc-arm.c:11437 config/tc-arm.c:11543 +msgid "having the base register in the register list when using write back is UNPREDICTABLE" +msgstr "наличие в списке регистров базового регистра при использовании обратной записи создаёт НЕПРЕДСКАЗУЕМОСТЬ" + +#: config/tc-arm.c:11445 +msgid "LR and PC should not both be in register list" +msgstr "LR и PC не должны быть в списке регистров одновременно" + +#: config/tc-arm.c:11453 +msgid "PC not allowed in register list" +msgstr "PC не допускается указывать в списке регистров" + +#: config/tc-arm.c:11495 +msgid "Thumb load/store multiple does not support {reglist}^" +msgstr "множественная загрузка/сохранение в Thumb не поддерживает {reglist}^" + +#: config/tc-arm.c:11520 config/tc-arm.c:11597 +#, c-format +msgid "value stored for r%d is UNKNOWN" +msgstr "значение, сохранённое для r%d, НЕИЗВЕСТНО" + +#: config/tc-arm.c:11590 +msgid "Thumb-2 instruction only valid in unified syntax" +msgstr "инструкцию Thumb-2 допускается указывать только в объединённом синтаксисе" + +#: config/tc-arm.c:11594 config/tc-arm.c:11604 +msgid "this instruction will write back the base register" +msgstr "эта инструкция выполнит обратную запись в базовый регистр" + +#: config/tc-arm.c:11607 +msgid "this instruction will not write back the base register" +msgstr "эта инструкция не выполнит обратную запись в базовый регистр" + +#: config/tc-arm.c:11638 +msgid "r14 not allowed as first register when second register is omitted" +msgstr "r14 не допускается указывать первым регистром, если отсутствует второй регистр" + +#: config/tc-arm.c:11738 +msgid "This instruction may be unpredictable if executed on M-profile cores with interrupts enabled." +msgstr "Эта инструкция может приводить к непредсказумому поведению, если выполняется в ядрах M-профиля с включёнными прерываниями." + +#: config/tc-arm.c:11767 config/tc-arm.c:11780 config/tc-arm.c:11816 +msgid "Thumb does not support this addressing mode" +msgstr "Thumb не поддерживает данный режим адресации" + +#: config/tc-arm.c:11784 +msgid "byte or halfword not valid for base register" +msgstr "байт или полуслово недопустимо для базового регистра" + +#: config/tc-arm.c:11787 +msgid "r15 based store not allowed" +msgstr "хранилище на основе r15 не допускается" + +#: config/tc-arm.c:11789 +msgid "invalid base register for register offset" +msgstr "некорректный базовый регистр для регистрового смещения" + +#: config/tc-arm.c:11846 +msgid "r12 not allowed here" +msgstr "r12 здесь запрещён" + +#: config/tc-arm.c:11852 +msgid "base register written back, and overlaps one of transfer registers" +msgstr "в базовый регистр выполняется обратная запись и он пересекается с одним из регистром передачи" + +#: config/tc-arm.c:11980 +#, c-format +msgid "Use of r%u as a source register is deprecated when r%u is the destination register." +msgstr "Использование r%u в качестве регистра источника устарело, если r%u является регистром назначения." + +#: config/tc-arm.c:12173 +msgid "shifts in CMP/MOV instructions are only supported in unified syntax" +msgstr "сдвиги в инструкциях CMP/MOV поддерживаются только при указании в объединённом синтаксисе" + +#: config/tc-arm.c:12201 +msgid "only lo regs allowed with immediate" +msgstr "только нижние регистры допускаются с непосредственными значениями" + +#: config/tc-arm.c:12378 +msgid "Thumb encoding does not support an immediate here" +msgstr "кодирование Thumb не поддерживает здесь непосредственное значение" + +#: config/tc-arm.c:12465 +msgid "Thumb-2 MUL must not set flags" +msgstr "Thumb-2 MUL не должна устанавливать флаги" + +#: config/tc-arm.c:12530 +msgid "Thumb does not support NOP with hints" +msgstr "Thumb не поддерживает NOP с подсказками" + +#: config/tc-arm.c:12690 +msgid "invalid register list to push/pop instruction" +msgstr "некорректный список регистров в инструкции push/pop" + +#: config/tc-arm.c:12935 +msgid "source1 and dest must be same register" +msgstr "источник1 и назначение должны быть одним и тем же регистром" + +#: config/tc-arm.c:12960 +msgid "ror #imm not supported" +msgstr "ror #imm не поддерживается" + +#: config/tc-arm.c:13011 +msgid "SMC is not permitted on this architecture" +msgstr "SMC запрещена на этой архитектуре" + +#: config/tc-arm.c:13176 +msgid "Thumb encoding does not support rotation" +msgstr "кодирование Thumb не поддерживает вращение" + +#: config/tc-arm.c:13196 +msgid "instruction requires register index" +msgstr "для инструкции требуется регистровый индекс" + +#: config/tc-arm.c:13206 +msgid "instruction does not allow shifted index" +msgstr "инструкция запрещает сдвиговый индекс" + +#: config/tc-arm.c:13392 +msgid "invalid neon suffix for non neon instruction" +msgstr "неверный суффикс neon для инструкции не neon" + +#: config/tc-arm.c:13754 config/tc-arm.c:14100 config/tc-arm.c:15717 +#: config/tc-arm.c:17342 +msgid "invalid instruction shape" +msgstr "неверная форма инструкции" + +#: config/tc-arm.c:13999 +msgid "types specified in both the mnemonic and operands" +msgstr "типы указаны как в мнемонике так и в операндах" + +#: config/tc-arm.c:14036 +msgid "operand types can't be inferred" +msgstr "невозможно догадаться о типах операндов" + +#: config/tc-arm.c:14042 +msgid "type specifier has the wrong number of parts" +msgstr "определитель типа содержит ошибочное количество частей" + +#: config/tc-arm.c:14128 config/tc-arm.c:15905 config/tc-arm.c:15912 +msgid "operand size must match register width" +msgstr "размер операнда должен совпадать с шириной регистра" + +#: config/tc-arm.c:14139 +msgid "bad type in Neon instruction" +msgstr "неверный тип в инструкции Neon" + +#: config/tc-arm.c:14150 +msgid "inconsistent types in Neon instruction" +msgstr "несоответствие типов в инструкции Neon" + +#: config/tc-arm.c:14521 config/tc-arm.c:14536 config/tc-arm.c:16921 +msgid "register list must contain at least 1 and at most 16 registers" +msgstr "список регистров должен содержать не менее 1 и не более 16 регистров" + +#: config/tc-arm.c:14679 config/tc-arm.c:14715 config/tc-arm.c:15354 +#: config/tc-arm.c:16761 +msgid "immediate out of range for shift" +msgstr "непосредственное значение за пределами диапазона сдвига" + +#: config/tc-arm.c:14835 +msgid "first and second operands shall be the same register" +msgstr "первый и второй операнды должны быть одним и тем же регистром" + +#: config/tc-arm.c:15120 config/tc-arm.c:16210 +msgid "scalar out of range for multiply instruction" +msgstr "скаляр вне диапазона инструкции умножения" + +#: config/tc-arm.c:15244 +msgid "instruction form not available on this architecture." +msgstr "форма инструкции недоступна на этой архитектуре" + +#: config/tc-arm.c:15247 +msgid "this instruction implies use of ARMv8.1 AdvSIMD." +msgstr "данная инструкция подразумевает использование ARMv8.1 AdvSIMD." + +#: config/tc-arm.c:15330 config/tc-arm.c:15342 +msgid "immediate out of range for insert" +msgstr "непосредственное значение за пределами диапазона вставки" + +#: config/tc-arm.c:15475 +msgid "immediate out of range for narrowing operation" +msgstr "непосредственное значение за пределами диапазона операции сужения" + +#: config/tc-arm.c:15621 +msgid "operands 0 and 1 must be the same register" +msgstr "операнды 0 и 1 должны быть одним и тем же регистром" + +#: config/tc-arm.c:15727 config/tc-arm.c:17440 +msgid "invalid rounding mode" +msgstr "неверный режим округления" + +#: config/tc-arm.c:16054 +msgid "operand size must be specified for immediate VMOV" +msgstr "для непосредственного значения в VMOV должен быть указан размер операнда" + +#: config/tc-arm.c:16064 +msgid "immediate has bits set outside the operand size" +msgstr "непосредственное значение содержит установленные биты вне диапазона размера операнда" + +#: config/tc-arm.c:16226 +msgid "vfmal/vfmsl with FP16 type cannot be conditional, the behaviour is UNPREDICTABLE" +msgstr "vfmal/vfmsl с типом FP16 не могут быть условными, поведение НЕПРЕДСКАЗУЕМО" + +#: config/tc-arm.c:16356 +msgid "Instruction form not available on this architecture." +msgstr "Форма инструкции недоступна на этой архитектуре." + +#: config/tc-arm.c:16400 +msgid "elements must be smaller than reversal region" +msgstr "элементы должны быть меньше области возврата" + +#: config/tc-arm.c:16582 config/tc-arm.c:16642 +msgid "bad type for scalar" +msgstr "некорректный тип для скаляра" + +#: config/tc-arm.c:16719 config/tc-arm.c:16727 +msgid "VFP registers must be adjacent" +msgstr "регистры VFP должны быть расположенным рядом" + +#: config/tc-arm.c:16770 +msgid "invalid suffix" +msgstr "неверный суффикс" + +#: config/tc-arm.c:16888 +msgid "bad list length for table lookup" +msgstr "неверная длина списка для таблицы поиска" + +#: config/tc-arm.c:16918 +msgid "writeback (!) must be used for VLDMDB and VSTMDB" +msgstr "для VLDMDB и VSTMDB должна использоваться обратная запись" + +#: config/tc-arm.c:16946 +msgid "Use of PC here is UNPREDICTABLE" +msgstr "Использование PC в этом месте вызывает НЕПРЕДСКАЗУЕМОСТЬ" + +#: config/tc-arm.c:16948 +msgid "Use of PC here is deprecated" +msgstr "Использование PC в этом месте устарело" + +#: config/tc-arm.c:17015 +msgid "bad alignment" +msgstr "неверное выравнивание" + +#: config/tc-arm.c:17032 +msgid "bad list type for instruction" +msgstr "неверный тип списка для инструкции" + +#: config/tc-arm.c:17034 +msgid "bad element type for instruction" +msgstr "неверный тип элемента для инструкции" + +#: config/tc-arm.c:17076 +msgid "unsupported alignment for instruction" +msgstr "неподдерживаемое выравнивание для инструкции" + +#: config/tc-arm.c:17095 config/tc-arm.c:17189 config/tc-arm.c:17201 +#: config/tc-arm.c:17211 config/tc-arm.c:17225 +msgid "bad list length" +msgstr "неверная длина списка" + +#: config/tc-arm.c:17100 +msgid "stride of 2 unavailable when element size is 8" +msgstr "шаг 2 недоступен, если размер элемента равен 8" + +#: config/tc-arm.c:17133 config/tc-arm.c:17209 +msgid "can't use alignment with this instruction" +msgstr "невозможно использовать выравнивание с этой инструкцией" + +#: config/tc-arm.c:17281 +msgid "post-index must be a register" +msgstr "пост-индекс должен задаваться регистром" + +#: config/tc-arm.c:17283 +msgid "bad register for post-index" +msgstr "неверный регистр для пост-индекса" + +#: config/tc-arm.c:17504 +msgid "scalar out of range" +msgstr "скаляр вне диапазона" + +#: config/tc-arm.c:17577 +msgid "Dot Product instructions cannot be conditional, the behaviour is UNPREDICTABLE" +msgstr "Инструкции скалярного произведения не могут быть условными, поведение НЕПРЕДСКАЗУЕМО." + +#: config/tc-arm.c:18150 config/tc-arm.c:18236 +msgid "conditional infixes are deprecated in unified syntax" +msgstr "условные инфиксы устарели в объединённом синтаксисе" + +#: config/tc-arm.c:18387 +msgid "Warning: conditional outside an IT block for Thumb." +msgstr "Предупреждение: условие вне блока IT для Thumb." + +#: config/tc-arm.c:18539 +msgid "Short branches, Undefined, SVC, LDM/STM" +msgstr "Короткие ветвления, Не определено, SVC, LDM/STM" + +#: config/tc-arm.c:18540 +msgid "Miscellaneous 16-bit instructions" +msgstr "Различные 16-битные инструкции" + +#: config/tc-arm.c:18541 +msgid "ADR" +msgstr "ADR" + +#: config/tc-arm.c:18542 +msgid "Literal loads" +msgstr "Загрузка литерала" + +#: config/tc-arm.c:18543 +msgid "Hi-register ADD, MOV, CMP, BX, BLX using pc" +msgstr "Верхний регистр ADD, MOV, CMP, BX, BLX задаётся pc" + +#: config/tc-arm.c:18544 +msgid "Hi-register ADD, MOV, CMP using pc" +msgstr "Верхний регистр ADD, MOV, CMP задаётся pc" + +#. NOTE: 0x00dd is not the real encoding, instead, it is the 'tvalue' +#. field in asm_opcode. 'tvalue' is used at the stage this check happen. +#: config/tc-arm.c:18547 +msgid "ADD/SUB sp, sp #imm" +msgstr "ADD/SUB sp, sp #imm" + +#: config/tc-arm.c:18566 +msgid "IT blocks containing 32-bit Thumb instructions are deprecated in ARMv8" +msgstr "Блоки IT с 32-битными инструкциями Thumb устарели в ARMv8" + +#: config/tc-arm.c:18578 +#, c-format +msgid "IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: %s" +msgstr "Блоки IT с 16-битными инструкциями Thumb следующих классов устарели в ARMv8: %s" + +#: config/tc-arm.c:18591 +msgid "IT blocks containing more than one conditional instruction are deprecated in ARMv8" +msgstr "Блоки IT с более чем одной условной инструкцией устарели в ARMv8" + +#: config/tc-arm.c:18706 +#, c-format +msgid "bad instruction `%s'" +msgstr "плохая инструкция «%s»" + +#: config/tc-arm.c:18712 +msgid "s suffix on comparison instruction is deprecated" +msgstr "суффикс s в инструкциях сравнения устарел" + +#: config/tc-arm.c:18732 +msgid "SVC is not permitted on this architecture" +msgstr "SVC запрещена на этой архитектуре" + +#: config/tc-arm.c:18734 +#, c-format +msgid "selected processor does not support `%s' in Thumb mode" +msgstr "выбранный процессор не поддерживает «%s» в режиме Thumb" + +#: config/tc-arm.c:18740 +msgid "Thumb does not support conditional execution" +msgstr "Thumb не поддерживает условное выполнение" + +#: config/tc-arm.c:18760 +#, c-format +msgid "selected processor does not support 32bit wide variant of instruction `%s'" +msgstr "выбранный процессор не поддерживает 32-битный вариант инструкции «%s»" + +#: config/tc-arm.c:18763 +#, c-format +msgid "selected processor does not support `%s' in Thumb-2 mode" +msgstr "выбранный процессор не поддерживает «%s» в режиме Thumb-2" + +#: config/tc-arm.c:18788 +#, c-format +msgid "cannot honor width suffix -- `%s'" +msgstr "не удалось учесть суффикс ширины «%s»" + +#: config/tc-arm.c:18830 +#, c-format +msgid "selected processor does not support `%s' in ARM mode" +msgstr "выбранный процессор не поддерживает «%s» в режиме ARM" + +#: config/tc-arm.c:18835 +#, c-format +msgid "width suffixes are invalid in ARM mode -- `%s'" +msgstr "некорректная ширина суффиксов в режиме ARM — «%s»" + +#: config/tc-arm.c:18868 +#, c-format +msgid "attempt to use an ARM instruction on a Thumb-only processor -- `%s'" +msgstr "попытка использования инструкции ARM на процессоре, поддерживающем только Thumb — «%s»" + +#: config/tc-arm.c:18885 +#, c-format +msgid "section '%s' finished with an open IT block." +msgstr "раздел «%s» завершён с открытым блоком IT" + +#: config/tc-arm.c:18890 +msgid "file finished with an open IT block." +msgstr "файл завершён с открытым блоком IT" + +#: config/tc-arm.c:22166 +#, c-format +msgid "alignments greater than %d bytes not supported in .text sections." +msgstr "выравнивание больше чем %d байт не поддерживается в разделах .text" + +#: config/tc-arm.c:22433 config/tc-ia64.c:3594 +#, c-format +msgid "Group section `%s' has no group signature" +msgstr "Раздел групп «%s» не имеет подписи группы" + +#: config/tc-arm.c:22479 +msgid "handlerdata in cantunwind frame" +msgstr "handlerdata в кадре cantunwind" + +#: config/tc-arm.c:22496 +msgid "too many unwind opcodes for personality routine 0" +msgstr "слишком много раскрываемых кодов операций для персонализационной процедуры 0" + +#: config/tc-arm.c:22527 +msgid "attempt to recreate an unwind entry" +msgstr "попытаться пересоздать элемент раскрытия" + +#: config/tc-arm.c:22537 +msgid "too many unwind opcodes" +msgstr "слишком много раскрываемых кодов операций" + +#: config/tc-arm.c:22830 +#, c-format +msgid "[-mwarn-syms]: Assignment makes a symbol match an ARM instruction: %s" +msgstr "[-mwarn-syms]: Назначение делает символ, совпадающий с инструкцией ARM: %s" + +#: config/tc-arm.c:23192 config/tc-arm.c:23260 +#, c-format +msgid "symbol %s is in a different section" +msgstr "символ %s в другом разделе" + +#: config/tc-arm.c:23194 config/tc-arm.c:23262 +#, c-format +msgid "symbol %s is weak and may be overridden later" +msgstr "символ %s слаб и позднее может быть замещён" + +#: config/tc-arm.c:23239 config/tc-arm.c:23609 +#, c-format +msgid "invalid constant (%lx) after fixup" +msgstr "некорректная константа (%lx) после местоположения" + +#: config/tc-arm.c:23295 +#, c-format +msgid "unable to compute ADRL instructions for PC offset of 0x%lx" +msgstr "невозможно выслить инструкции ADRL для смещения относительно PC по адресу 0x%lx" + +#: config/tc-arm.c:23331 config/tc-arm.c:23361 +msgid "invalid literal constant: pool needs to be closer" +msgstr "некорректная литеральная константа: пул должен быт ближе" + +#: config/tc-arm.c:23334 config/tc-arm.c:23383 +#, c-format +msgid "bad immediate value for offset (%ld)" +msgstr "некорректное непосредственное значение для смещения (%ld)" + +#: config/tc-arm.c:23364 +#, c-format +msgid "bad immediate value for 8-bit offset (%ld)" +msgstr "некорректное непосредственное значение для 8-битного смещения (%ld)" + +#: config/tc-arm.c:23424 +msgid "offset not a multiple of 4" +msgstr "смещение не кратно 4" + +#: config/tc-arm.c:23625 +msgid "invalid smc expression" +msgstr "неверное выражение smc" + +#: config/tc-arm.c:23634 +msgid "invalid hvc expression" +msgstr "неверное выражение hvc" + +#: config/tc-arm.c:23645 config/tc-arm.c:23654 +msgid "invalid swi expression" +msgstr "неверное выражение swi" + +#: config/tc-arm.c:23664 +msgid "invalid expression in load/store multiple" +msgstr "неправильное выражение в многозначной загрузке/сохранении" + +#: config/tc-arm.c:23726 +#, c-format +msgid "blx to '%s' an ARM ISA state function changed to bl" +msgstr "blx в «%s» — функция состояния ARM ISA, изменяется на bl" + +#: config/tc-arm.c:23745 +msgid "misaligned branch destination" +msgstr "невыравненное назначение ветвления" + +#: config/tc-arm.c:23865 +#, c-format +msgid "blx to Thumb func '%s' from Thumb ISA state changed to bl" +msgstr "blx в функции Thumb«%s» из состояния Thumb ISA изменяется на bl" + +#: config/tc-arm.c:23915 +msgid "Thumb2 branch out of range" +msgstr "ветвление Thumb2 за пределами диапазона" + +#: config/tc-arm.c:23999 +msgid "rel31 relocation overflow" +msgstr "переполнение перемещения rel31" + +#: config/tc-arm.c:24020 config/tc-arm.c:24024 config/tc-arm.c:24063 +msgid "co-processor offset out of range" +msgstr "смещение сопроцессора вне диапазона" + +#: config/tc-arm.c:24080 +#, c-format +msgid "invalid offset, target not word aligned (0x%08lX)" +msgstr "неверное смещение, цель не выровнена по границе слова (0x%08lX)" + +#: config/tc-arm.c:24087 config/tc-arm.c:24096 config/tc-arm.c:24104 +#: config/tc-arm.c:24112 config/tc-arm.c:24120 +#, c-format +msgid "invalid offset, value too big (0x%08lX)" +msgstr "неверное смещение, слишком большое значение (0x%08lX)" + +#: config/tc-arm.c:24161 +msgid "invalid Hi register with immediate" +msgstr "неверный старший регистр с непосредственным значением" + +#: config/tc-arm.c:24177 +msgid "invalid immediate for stack address calculation" +msgstr "некорректный непосредственный элемент при вычислении адреса стека" + +#: config/tc-arm.c:24196 +msgid "address calculation needs a strongly defined nearby symbol" +msgstr "для вычисления адреса необходимо стойкий близко определённый символ" + +#: config/tc-arm.c:24212 +msgid "symbol too far away" +msgstr "символ слишком далеко" + +#: config/tc-arm.c:24224 +#, c-format +msgid "invalid immediate for address calculation (value = 0x%08lX)" +msgstr "некорректный непосредственный элемент при вычислении адреса (значение = 0x%08lX)" + +#: config/tc-arm.c:24254 +#, c-format +msgid "invalid immediate: %ld is out of range" +msgstr "неверное непосредственное значение: %ld за пределами диапазона" + +#: config/tc-arm.c:24266 +#, c-format +msgid "invalid shift value: %ld" +msgstr "некорректное значение сдвига: %ld" + +#: config/tc-arm.c:24336 config/tc-arm.c:24407 +#, c-format +msgid "the offset 0x%08lX is not representable" +msgstr "смещение 0x%08lX невозможно представить" + +#: config/tc-arm.c:24368 +#, c-format +msgid "Unable to process relocation for thumb opcode: %lx" +msgstr "Невозможно обработать перемещение для кода операции thumb: %lx" + +#: config/tc-arm.c:24447 +#, c-format +msgid "bad offset 0x%08lX (only 12 bits available for the magnitude)" +msgstr "неправильное смещение 0x%08lX (для представления доступно только 12 бит)" + +#: config/tc-arm.c:24486 +#, c-format +msgid "bad offset 0x%08lX (only 8 bits available for the magnitude)" +msgstr "неправильное смещение 0x%08lX (для представления доступно только 8 бит)" + +#: config/tc-arm.c:24526 +#, c-format +msgid "bad offset 0x%08lX (must be word-aligned)" +msgstr "неправильное смещение 0x%08lX (должно быть выровнено по границе слова)" + +#: config/tc-arm.c:24531 +#, c-format +msgid "bad offset 0x%08lX (must be an 8-bit number of words)" +msgstr "неправильное смещение 0x%08lX (должно быть 8-битный номер слова)" + +#: config/tc-arm.c:24562 config/tc-score.c:7391 +#, c-format +msgid "bad relocation fixup type (%d)" +msgstr "недопустимый тип перемещаемого местоположения (%d)" + +#: config/tc-arm.c:24680 +msgid "literal referenced across section boundary" +msgstr "литерал указывает за границу раздела" + +#: config/tc-arm.c:24751 +msgid "internal relocation (type: IMMEDIATE) not fixed up" +msgstr "внутреннее перемещение (тип: IMMEDIATE) не исправляется" + +#: config/tc-arm.c:24756 +msgid "ADRL used for a symbol not defined in the same file" +msgstr "ADRL, используемая для символа, не определена в том же файле" + +#: config/tc-arm.c:24771 +#, c-format +msgid "undefined local label `%s'" +msgstr "неопределенная локальная метка «%s»" + +#: config/tc-arm.c:24777 +msgid "internal_relocation (type: OFFSET_IMM) not fixed up" +msgstr "internal_relocation (тип: OFFSET_IMM) не исправляется" + +#: config/tc-arm.c:24799 config/tc-cris.c:4006 config/tc-ft32.c:709 +#: config/tc-mcore.c:1928 config/tc-microblaze.c:1978 config/tc-mmix.c:2895 +#: config/tc-moxie.c:825 config/tc-ns32k.c:2248 config/tc-score.c:7478 +msgid "" +msgstr "<неизвестно>" + +#: config/tc-arm.c:25188 +#, c-format +msgid "%s: unexpected function type: %d" +msgstr "%s: неожиданный тип функции: %d" + +#: config/tc-arm.c:25325 +msgid "use of old and new-style options to set CPU type" +msgstr "использование параметров в старом и новом стиле для задания типа ЦП" + +#: config/tc-arm.c:25340 +msgid "use of old and new-style options to set FPU type" +msgstr "использование параметров в старом и новом стиле для задания типа FPU" + +#: config/tc-arm.c:25424 +msgid "hard-float conflicts with specified fpu" +msgstr "hard-float конфликтует с заданным fpu" + +#: config/tc-arm.c:25612 +msgid "generate PIC code" +msgstr "генерировать код PIC" + +#: config/tc-arm.c:25613 +msgid "assemble Thumb code" +msgstr "ассемблировать код Thumb" + +#: config/tc-arm.c:25614 +msgid "support ARM/Thumb interworking" +msgstr "поддержка совместной работы ARM/Thumb" + +#: config/tc-arm.c:25616 +msgid "code uses 32-bit program counter" +msgstr "в коде используется 32-битный программный счётчик" + +#: config/tc-arm.c:25617 +msgid "code uses 26-bit program counter" +msgstr "в коде используется 26-битный программный счётчик" + +#: config/tc-arm.c:25618 +msgid "floating point args are in fp regs" +msgstr "аргументы значений с плавающей точкой не в регистрах fp" + +#: config/tc-arm.c:25620 +msgid "re-entrant code" +msgstr "реентерабельный код" + +#: config/tc-arm.c:25621 +msgid "code is ATPCS conformant" +msgstr "код совместимый с ATPCS" + +#. These are recognized by the assembler, but have no affect on code. +#: config/tc-arm.c:25627 +msgid "use frame pointer" +msgstr "использовать указатель кадра" + +#: config/tc-arm.c:25628 +msgid "use stack size checking" +msgstr "выполнять проверку размера стека" + +#: config/tc-arm.c:25631 +msgid "do not warn on use of deprecated feature" +msgstr "не предупреждать об использовании устаревших возможностей" + +#: config/tc-arm.c:25633 +msgid "warn about symbols that match instruction names [default]" +msgstr "предупреждать о символах, которые совпадают с именами инструкций [по умолчанию]" + +#: config/tc-arm.c:25634 +msgid "disable warnings about symobls that match instructions" +msgstr "выключить предупреждения о символах, совпадающих с инструкциями" + +#. DON'T add any new processors to this list -- we want the whole list +#. to go away... Add them to the processors table instead. +#: config/tc-arm.c:25650 config/tc-arm.c:25651 +msgid "use -mcpu=arm1" +msgstr "использовать -mcpu=arm1" + +#: config/tc-arm.c:25652 config/tc-arm.c:25653 +msgid "use -mcpu=arm2" +msgstr "использовать -mcpu=arm2" + +#: config/tc-arm.c:25654 config/tc-arm.c:25655 +msgid "use -mcpu=arm250" +msgstr "использовать -mcpu=arm250" + +#: config/tc-arm.c:25656 config/tc-arm.c:25657 +msgid "use -mcpu=arm3" +msgstr "использовать -mcpu=arm3" + +#: config/tc-arm.c:25658 config/tc-arm.c:25659 +msgid "use -mcpu=arm6" +msgstr "использовать -mcpu=arm6" + +#: config/tc-arm.c:25660 config/tc-arm.c:25661 +msgid "use -mcpu=arm600" +msgstr "использовать -mcpu=arm600" + +#: config/tc-arm.c:25662 config/tc-arm.c:25663 +msgid "use -mcpu=arm610" +msgstr "использовать -mcpu=arm610" + +#: config/tc-arm.c:25664 config/tc-arm.c:25665 +msgid "use -mcpu=arm620" +msgstr "использовать -mcpu=arm620" + +#: config/tc-arm.c:25666 config/tc-arm.c:25667 +msgid "use -mcpu=arm7" +msgstr "использовать -mcpu=arm7" + +#: config/tc-arm.c:25668 config/tc-arm.c:25669 +msgid "use -mcpu=arm70" +msgstr "использовать -mcpu=arm70" + +#: config/tc-arm.c:25670 config/tc-arm.c:25671 +msgid "use -mcpu=arm700" +msgstr "использовать -mcpu=arm700" + +#: config/tc-arm.c:25672 config/tc-arm.c:25673 +msgid "use -mcpu=arm700i" +msgstr "использовать -mcpu=arm700i" + +#: config/tc-arm.c:25674 config/tc-arm.c:25675 +msgid "use -mcpu=arm710" +msgstr "использовать -mcpu=arm710" + +#: config/tc-arm.c:25676 config/tc-arm.c:25677 +msgid "use -mcpu=arm710c" +msgstr "использовать -mcpu=arm710c" + +#: config/tc-arm.c:25678 config/tc-arm.c:25679 +msgid "use -mcpu=arm720" +msgstr "использовать -mcpu=arm720" + +#: config/tc-arm.c:25680 config/tc-arm.c:25681 +msgid "use -mcpu=arm7d" +msgstr "использовать -mcpu=arm7d" + +#: config/tc-arm.c:25682 config/tc-arm.c:25683 +msgid "use -mcpu=arm7di" +msgstr "использовать -mcpu=arm7di" + +#: config/tc-arm.c:25684 config/tc-arm.c:25685 +msgid "use -mcpu=arm7m" +msgstr "использовать -mcpu=arm7m" + +#: config/tc-arm.c:25686 config/tc-arm.c:25687 +msgid "use -mcpu=arm7dm" +msgstr "использовать -mcpu=arm7dm" + +#: config/tc-arm.c:25688 config/tc-arm.c:25689 +msgid "use -mcpu=arm7dmi" +msgstr "использовать -mcpu=arm7dmi" + +#: config/tc-arm.c:25690 config/tc-arm.c:25691 +msgid "use -mcpu=arm7100" +msgstr "использовать -mcpu=arm7100" + +#: config/tc-arm.c:25692 config/tc-arm.c:25693 +msgid "use -mcpu=arm7500" +msgstr "использовать -mcpu=arm7500" + +#: config/tc-arm.c:25694 config/tc-arm.c:25695 +msgid "use -mcpu=arm7500fe" +msgstr "использовать -mcpu=arm7500fe" + +#: config/tc-arm.c:25696 config/tc-arm.c:25697 config/tc-arm.c:25698 +#: config/tc-arm.c:25699 +msgid "use -mcpu=arm7tdmi" +msgstr "использовать -mcpu=arm7tdmi" + +#: config/tc-arm.c:25700 config/tc-arm.c:25701 +msgid "use -mcpu=arm710t" +msgstr "использовать -mcpu=arm710t" + +#: config/tc-arm.c:25702 config/tc-arm.c:25703 +msgid "use -mcpu=arm720t" +msgstr "использовать -mcpu=arm720t" + +#: config/tc-arm.c:25704 config/tc-arm.c:25705 +msgid "use -mcpu=arm740t" +msgstr "использовать -mcpu=arm740t" + +#: config/tc-arm.c:25706 config/tc-arm.c:25707 +msgid "use -mcpu=arm8" +msgstr "использовать -mcpu=arm8" + +#: config/tc-arm.c:25708 config/tc-arm.c:25709 +msgid "use -mcpu=arm810" +msgstr "использовать -mcpu=arm810" + +#: config/tc-arm.c:25710 config/tc-arm.c:25711 +msgid "use -mcpu=arm9" +msgstr "использовать -mcpu=arm9" + +#: config/tc-arm.c:25712 config/tc-arm.c:25713 +msgid "use -mcpu=arm9tdmi" +msgstr "использовать -mcpu=arm9tdmi" + +#: config/tc-arm.c:25714 config/tc-arm.c:25715 +msgid "use -mcpu=arm920" +msgstr "использовать -mcpu=arm920" + +#: config/tc-arm.c:25716 config/tc-arm.c:25717 +msgid "use -mcpu=arm940" +msgstr "использовать -mcpu=arm940" + +#: config/tc-arm.c:25718 +msgid "use -mcpu=strongarm" +msgstr "использовать -mcpu=strongarm" + +#: config/tc-arm.c:25720 +msgid "use -mcpu=strongarm110" +msgstr "использовать -mcpu=strongarm110" + +#: config/tc-arm.c:25722 +msgid "use -mcpu=strongarm1100" +msgstr "использовать -mcpu=strongarm1100" + +#: config/tc-arm.c:25724 +msgid "use -mcpu=strongarm1110" +msgstr "использовать -mcpu=strongarm1110" + +#: config/tc-arm.c:25725 +msgid "use -mcpu=xscale" +msgstr "использовать -mcpu=xscale" + +#: config/tc-arm.c:25726 +msgid "use -mcpu=iwmmxt" +msgstr "использовать -mcpu=iwmmxt" + +#: config/tc-arm.c:25727 +msgid "use -mcpu=all" +msgstr "использовать -mcpu=all" + +#. Architecture variants -- don't add any more to this list either. +#: config/tc-arm.c:25730 config/tc-arm.c:25731 +msgid "use -march=armv2" +msgstr "использовать -march=armv2" + +#: config/tc-arm.c:25732 config/tc-arm.c:25733 +msgid "use -march=armv2a" +msgstr "использовать -march=armv2" + +#: config/tc-arm.c:25734 config/tc-arm.c:25735 +msgid "use -march=armv3" +msgstr "использовать -march=armv3" + +#: config/tc-arm.c:25736 config/tc-arm.c:25737 +msgid "use -march=armv3m" +msgstr "использовать -march=armv3m" + +#: config/tc-arm.c:25738 config/tc-arm.c:25739 +msgid "use -march=armv4" +msgstr "использовать -march=armv4" + +#: config/tc-arm.c:25740 config/tc-arm.c:25741 +msgid "use -march=armv4t" +msgstr "использовать -march=armv4t" + +#: config/tc-arm.c:25742 config/tc-arm.c:25743 +msgid "use -march=armv5" +msgstr "использовать -march=armv5" + +#: config/tc-arm.c:25744 config/tc-arm.c:25745 +msgid "use -march=armv5t" +msgstr "использовать -march=armv5t" + +#: config/tc-arm.c:25746 config/tc-arm.c:25747 +msgid "use -march=armv5te" +msgstr "использовать -march=armv5te" + +#. Floating point variants -- don't add any more to this list either. +#: config/tc-arm.c:25750 +msgid "use -mfpu=fpe" +msgstr "использовать -mfpu=fpe" + +#: config/tc-arm.c:25751 +msgid "use -mfpu=fpa10" +msgstr "использовать -mfpu=fpa10" + +#: config/tc-arm.c:25752 +msgid "use -mfpu=fpa11" +msgstr "использовать -mfpu=fpa11" + +#: config/tc-arm.c:25754 +msgid "use either -mfpu=softfpa or -mfpu=softvfp" +msgstr "использовать -mfpu=softfpa или -mfpu=softvfp" + +#: config/tc-arm.c:26508 +msgid "extension does not apply to the base architecture" +msgstr "расширение не применяется к базовой архитектуре" + +#: config/tc-arm.c:26538 +msgid "architectural extensions must be specified in alphabetical order" +msgstr "архитектурные расширения должны указываться в алфавитном порядке" + +#: config/tc-arm.c:26656 config/tc-arm.c:27541 +#, c-format +msgid "unknown floating point format `%s'\n" +msgstr "неизвестный формат плавающей точки «%s»\n" + +#: config/tc-arm.c:26672 +#, c-format +msgid "unknown floating point abi `%s'\n" +msgstr "неизвестный abi плавающей точки «%s»\n" + +#: config/tc-arm.c:26688 +#, c-format +msgid "unknown EABI `%s'\n" +msgstr "неизвестный EABI «%s»\n" + +#: config/tc-arm.c:26708 +#, c-format +msgid "unknown implicit IT mode `%s', should be arm, thumb, always, or never." +msgstr "неизвестный неявный режим IT «%s», должно быть arm, thumb, always или never." + +#: config/tc-arm.c:26731 config/tc-metag.c:5913 +msgid "\t assemble for FPU architecture " +msgstr "<имя fpu>\t ассемблировать для архитектуры FPU <имя fpu>" + +#: config/tc-arm.c:26733 +msgid "\t assemble for floating point ABI " +msgstr "\t ассемблировать для ABI плавающей точки " + +#: config/tc-arm.c:26736 +msgid "\t\t assemble for eabi version " +msgstr "\t\t ассемблировать для версии eabi " + +#: config/tc-arm.c:26739 +msgid "\t controls implicit insertion of IT instructions" +msgstr "\t управлять неявной вставкой инструкций IT" + +#: config/tc-arm.c:26741 +msgid "\t\t\t TI CodeComposer Studio syntax compatibility mode" +msgstr "\t\t\t режим совместимости с синтаксисом TI CodeComposer Studio" + +#: config/tc-arm.c:26843 +#, c-format +msgid " ARM-specific assembler options:\n" +msgstr " Специализированные параметры ассемблера для ARM:\n" + +#: config/tc-arm.c:26863 +#, c-format +msgid " --fix-v4bx Allow BX in ARMv4 code\n" +msgstr " --fix-v4bx допускать BX в коде ARMv4\n" + +#: config/tc-arm.c:27160 +msgid "no architecture contains all the instructions used\n" +msgstr "не существует архитектуры со всеми используемыми инструкциями\n" + +#: config/tc-arm.c:27479 +#, c-format +msgid "architectural extension `%s' is not allowed for the current base architecture" +msgstr "расширение архитектуры «%s» недопустимо для текущей базовой архитектуры" + +#: config/tc-arm.c:27508 +#, c-format +msgid "unknown architecture extension `%s'\n" +msgstr "неизвестное расширение архитектуры «%s»\n" + +#: config/tc-avr.c:594 +#, c-format +msgid "Known MCU names:" +msgstr "Известные имена микроконтроллеров:" + +#: config/tc-avr.c:659 +#, c-format +msgid "" +"AVR Assembler options:\n" +" -mmcu=[avr-name] select microcontroller variant\n" +" [avr-name] can be:\n" +" avr1 - classic AVR core without data RAM\n" +" avr2 - classic AVR core with up to 8K program memory\n" +" avr25 - classic AVR core with up to 8K program memory\n" +" plus the MOVW instruction\n" +" avr3 - classic AVR core with up to 64K program memory\n" +" avr31 - classic AVR core with up to 128K program memory\n" +" avr35 - classic AVR core with up to 64K program memory\n" +" plus the MOVW instruction\n" +" avr4 - enhanced AVR core with up to 8K program memory\n" +" avr5 - enhanced AVR core with up to 64K program memory\n" +" avr51 - enhanced AVR core with up to 128K program memory\n" +" avr6 - enhanced AVR core with up to 256K program memory\n" +" avrxmega2 - XMEGA, > 8K, < 64K FLASH, < 64K RAM\n" +" avrxmega3 - XMEGA, RAM + FLASH < 64K, Flash visible in RAM\n" +" avrxmega4 - XMEGA, > 64K, <= 128K FLASH, <= 64K RAM\n" +" avrxmega5 - XMEGA, > 64K, <= 128K FLASH, > 64K RAM\n" +" avrxmega6 - XMEGA, > 128K, <= 256K FLASH, <= 64K RAM\n" +" avrxmega7 - XMEGA, > 128K, <= 256K FLASH, > 64K RAM\n" +" avrtiny - AVR Tiny core with 16 gp registers\n" +msgstr "" +"Параметры ассемблера AVR:\n" +" -mmcu=[имя-avr] выберите вариант микроконтроллера\n" +" [имя-avr] может быть:\n" +" avr1 - классическое ядро AVR без RAM данных\n" +" avr2 - классическое ядро AVR с до 8K памяти программы\n" +" avr25 - классическое ядро AVR с до 8K памяти программы\n" +" плюс инструкция MOVW\n" +" avr3 - классическое ядро AVR с до 64K памяти программы\n" +" avr31 - классическое ядро AVR с до 128K памяти программы\n" +" avr35 - классическое ядро AVR с до 64K памяти программы\n" +" плюс инструкция MOVW\n" +" avr4 - улучшенное ядро AVR с до 8K памяти программы\n" +" avr5 - улучшенное ядро AVR с до 64K памяти программы\n" +" avr51 - улучшенное ядро AVR с до 128K памяти программы\n" +" avr6 - улучшенное ядро AVR с до 256K памяти программы\n" +" avrxmega2 - XMEGA, > 8K, < 64K FLASH, < 64K RAM\n" +" avrxmega3 - XMEGA, RAM + FLASH < 64K, Flash видима в RAM\n" +" avrxmega4 - XMEGA, > 64K, <= 128K FLASH, <= 64K RAM\n" +" avrxmega5 - XMEGA, > 64K, <= 128K FLASH, > 64K RAM\n" +" avrxmega6 - XMEGA, > 128K, <= 256K FLASH, <= 64K RAM\n" +" avrxmega7 - XMEGA, > 128K, <= 256K FLASH, > 64K RAM\n" +" avrtiny - ядро AVR Tiny с 16 регистрами общего назначения\n" + +#: config/tc-avr.c:682 +#, c-format +msgid "" +" -mall-opcodes accept all AVR opcodes, even if not supported by MCU\n" +" -mno-skip-bug disable warnings for skipping two-word instructions\n" +" (default for avr4, avr5)\n" +" -mno-wrap reject rjmp/rcall instructions with 8K wrap-around\n" +" (default for avr3, avr5)\n" +" -mrmw accept Read-Modify-Write instructions\n" +" -mlink-relax generate relocations for linker relaxation (default)\n" +" -mno-link-relax don't generate relocations for linker relaxation.\n" +" -mgcc-isr accept the __gcc_isr pseudo-instruction.\n" +msgstr "" +" -mall-opcodes принимать все коды операций AVR, даже не поддерживаемые МК\n" +" -mno-skip-bug выключить предупреждения пропуска двусловных инструкций\n" +" (по умолчанию для avr4, avr5)\n" +" -mno-wrap браковать инструкции rjmp/rcall для обёрток 8K\n" +" (по умолчанию для avr3, avr5)\n" +" -mrmw принимать инструкции чтение-изменение-запись\n" +" -mlink-relax \n" +" (по умолчанию)\n" +" -mno-link-relax не генерировать перемещения для послаблений компоновщику\n" +" -mgcc-isr принимать псевдоинструкцию __gcc_isr\n" + +#: config/tc-avr.c:721 +#, c-format +msgid "unknown MCU: %s\n" +msgstr "неизвестный МК: %s\n" + +#: config/tc-avr.c:735 +#, c-format +msgid "redefinition of mcu type `%s' to `%s'" +msgstr "переопределение типа МК «%s» в «%s»" + +#: config/tc-avr.c:858 +msgid "constant value required" +msgstr "требуется константное значение" + +#: config/tc-avr.c:861 +#, c-format +msgid "number must be positive and less than %d" +msgstr "число должно быть положительным и меньше %d" + +#: config/tc-avr.c:887 config/tc-avr.c:1024 +#, c-format +msgid "constant out of 8-bit range: %d" +msgstr "константа вне 8-битного диапазона: %d" + +#: config/tc-avr.c:955 config/tc-score.c:1199 read.c:3814 +msgid "illegal expression" +msgstr "недопустимое выражение" + +#: config/tc-avr.c:984 config/tc-avr.c:1994 config/tc-pru.c:1874 +msgid "`)' required" +msgstr "требуется «)»" + +#: config/tc-avr.c:1094 +msgid "register name or number from 16 to 31 required" +msgstr "требуется имя регистра или номер от 16 до 31" + +#: config/tc-avr.c:1100 +msgid "register name or number from 0 to 31 required" +msgstr "требуется имя регистра или номер от 0 до 31" + +#: config/tc-avr.c:1108 +msgid "register r16-r23 required" +msgstr "требуется регистр r16-r23" + +#: config/tc-avr.c:1114 +msgid "register number above 15 required" +msgstr "требуется номер регистра больше 15" + +#: config/tc-avr.c:1120 +msgid "even register number required" +msgstr "требуется номер чётного регистра" + +#: config/tc-avr.c:1126 +msgid "register r24, r26, r28 or r30 required" +msgstr "требуется регистр r24, r26, r28 или r30" + +#: config/tc-avr.c:1147 +msgid "pointer register (X, Y or Z) required" +msgstr "требуется регистр указателя (X, Y или Z)" + +#: config/tc-avr.c:1154 +msgid "cannot both predecrement and postincrement" +msgstr "не допускается задание одновременно предуменьшения и постувеличения" + +#: config/tc-avr.c:1162 +msgid "addressing mode not supported" +msgstr "режим адресации не поддерживается" + +#: config/tc-avr.c:1168 +msgid "can't predecrement" +msgstr "предуменьшение невозможно" + +#: config/tc-avr.c:1171 +msgid "pointer register Z required" +msgstr "требуется регистр указателя Z" + +#: config/tc-avr.c:1190 +msgid "postincrement not supported" +msgstr "постувеличение не поддерживается" + +#: config/tc-avr.c:1200 +msgid "pointer register (Y or Z) required" +msgstr "требуется регистр указателя (Y или Z)" + +#: config/tc-avr.c:1322 config/tc-xgate.c:1352 +#, c-format +msgid "unknown constraint `%c'" +msgstr "неизвестное ограничение «%c»" + +#: config/tc-avr.c:1385 config/tc-avr.c:2677 +msgid "`,' required" +msgstr "требуется «,»" + +#: config/tc-avr.c:1406 +msgid "undefined combination of operands" +msgstr "неопределенная комбинация операндов" + +#: config/tc-avr.c:1415 +msgid "skipping two-word instruction" +msgstr "пропускается двусловная инструкция" + +#: config/tc-avr.c:1603 config/tc-avr.c:1619 config/tc-avr.c:1750 +#: config/tc-msp430.c:4125 config/tc-msp430.c:4144 +#, c-format +msgid "odd address operand: %ld" +msgstr "нечётный адресный операнд: %ld" + +#: config/tc-avr.c:1611 config/tc-avr.c:1630 config/tc-avr.c:1648 +#: config/tc-avr.c:1659 config/tc-avr.c:1675 config/tc-avr.c:1683 +#: config/tc-avr.c:1778 config/tc-avr.c:1785 config/tc-d10v.c:503 +#: config/tc-d30v.c:553 config/tc-msp430.c:4133 config/tc-msp430.c:4151 +#, c-format +msgid "operand out of range: %ld" +msgstr "операнд вне диапазона: %ld" + +#: config/tc-avr.c:1666 +#, c-format +msgid "operand out of range: 0x%lx" +msgstr "операнд вне диапазона: 0x%lx" + +#: config/tc-avr.c:1771 config/tc-d10v.c:1590 config/tc-d30v.c:2034 +#: config/tc-msp430.c:4222 +#, c-format +msgid "line %d: unknown relocation type: 0x%x" +msgstr "строка %d: неизвестный тип перемещения: 0x%x" + +#: config/tc-avr.c:1799 +msgid "only constant expression allowed" +msgstr "допускается только константное выражение" + +#. xgettext:c-format. +#: config/tc-avr.c:1854 config/tc-bfin.c:825 config/tc-d10v.c:1462 +#: config/tc-d30v.c:1771 config/tc-metag.c:7022 config/tc-mn10200.c:779 +#: config/tc-mn10300.c:2177 config/tc-msp430.c:4270 config/tc-ppc.c:7251 +#: config/tc-spu.c:879 config/tc-spu.c:1090 config/tc-v850.c:3367 +#: config/tc-z80.c:2059 +#, c-format +msgid "reloc %d not supported by object file format" +msgstr "перемещение %d не поддерживается форматом объектного файла" + +#: config/tc-avr.c:1876 config/tc-ft32.c:232 config/tc-h8300.c:1960 +#: config/tc-mcore.c:880 config/tc-microblaze.c:933 config/tc-moxie.c:182 +#: config/tc-pj.c:253 config/tc-sh.c:2591 config/tc-wasm32.c:747 +#: config/tc-z8k.c:1223 +msgid "can't find opcode " +msgstr "невозможно найти код операции " + +#: config/tc-avr.c:1895 +#, c-format +msgid "illegal opcode %s for mcu %s" +msgstr "недопустимый код операции %s для МК %s" + +#: config/tc-avr.c:1911 +#, c-format +msgid "pseudo instruction `%s' not supported" +msgstr "псевдоинструкция «%s» не поддерживается" + +#: config/tc-avr.c:1933 +msgid "garbage at end of line" +msgstr "мусор в конце строки" + +#: config/tc-avr.c:2043 config/tc-pru.c:1906 +#, c-format +msgid "illegal %s relocation size: %d" +msgstr "недопустимый размер перемещения %s: %d" + +#: config/tc-avr.c:2156 config/tc-avr.c:2211 +#, c-format +msgid "unknown record type %d (in %s)" +msgstr "неизвестный тип записи %d (в %s)" + +#: config/tc-avr.c:2232 +#, c-format +msgid "Failed to create property section `%s'\n" +msgstr "Не удалось создать раздел свойств «%s»\n" + +#: config/tc-avr.c:2669 +#, c-format +msgid "%s requires value 0-2 as operand 1" +msgstr "в качестве первого операнда для %s требуется значение 0-2" + +#: config/tc-avr.c:2694 +#, c-format +msgid "`%s %d' after `%s %d' from %s:%u" +msgstr "«%s %d» после «%s %d» в %s:%u" + +#: config/tc-avr.c:2697 +#, c-format +msgid "`%s %d' but no chunk open yet" +msgstr "«%s %d», но блок ещё не открыт" + +#: config/tc-avr.c:2785 +#, c-format +msgid "dangling `__gcc_isr %d'" +msgstr "повисшая «__gcc_isr %d»" + +#: config/tc-avr.c:2787 +msgid "dangling `__gcc_isr'" +msgstr "повисшая «__gcc_isr»" + +#: config/tc-bfin.c:94 config/tc-frv.c:1603 config/tc-frv.c:1613 +msgid "missing ')'" +msgstr "отсутствует «)»" + +#: config/tc-bfin.c:440 +#, c-format +msgid " Blackfin specific assembler options:\n" +msgstr " Специализированные параметры ассемблера для Blackfin:\n" + +#: config/tc-bfin.c:441 +#, c-format +msgid " -mcpu= specify the name of the target CPU\n" +msgstr " -mcpu= указать имя целевого ЦП\n" + +#: config/tc-bfin.c:442 +#, c-format +msgid " -mfdpic assemble for the FDPIC ABI\n" +msgstr " -mfdpic ассемблировать для FDPIC ABI\n" + +#: config/tc-bfin.c:443 +#, c-format +msgid " -mno-fdpic/-mnopic disable -mfdpic\n" +msgstr " -mno-fdpic/-mnopic выключить -mfdpic\n" + +#: config/tc-bfin.c:456 +msgid "Could not set architecture and machine." +msgstr "Не задана архитектура и машина." + +#: config/tc-bfin.c:603 +msgid "Parse failed." +msgstr "Ошибка при разборе." + +#: config/tc-bfin.c:678 +msgid "pcrel too far BFD_RELOC_BFIN_10" +msgstr "pcrel слишком далеко для BFD_RELOC_BFIN_10" + +#: config/tc-bfin.c:694 +msgid "pcrel too far BFD_RELOC_BFIN_12" +msgstr "pcrel слишком далеко для BFD_RELOC_BFIN_12" + +#: config/tc-bfin.c:714 +msgid "pcrel too far BFD_RELOC_BFIN_24" +msgstr "pcrel слишком далеко для BFD_RELOC_BFIN_24" + +#: config/tc-bfin.c:729 +msgid "pcrel too far BFD_RELOC_BFIN_5" +msgstr "pcrel слишком далеко для BFD_RELOC_BFIN_5" + +#: config/tc-bfin.c:741 +msgid "pcrel too far BFD_RELOC_BFIN_11_PCREL" +msgstr "pcrel слишком далеко для BFD_RELOC_BFIN_11_PCREL" + +#: config/tc-bfin.c:751 +msgid "rel too far BFD_RELOC_8" +msgstr "rel слишком далеко для BFD_RELOC_8" + +#: config/tc-bfin.c:758 +msgid "rel too far BFD_RELOC_16" +msgstr "rel слишком далеко для BFD_RELOC_16" + +#: config/tc-cr16.c:164 read.c:4667 +msgid "using a bit field width of zero" +msgstr "используется битовое поле нулевой ширины" + +#: config/tc-cr16.c:172 read.c:4675 +#, c-format +msgid "field width \"%s\" too complex for a bitfield" +msgstr "ширина поля «%s» слишком сложна для bitfield" + +#: config/tc-cr16.c:181 read.c:4683 +#, c-format +msgid "field width %lu too big to fit in %d byte: truncated to %d bits" +msgid_plural "field width %lu too big to fit in %d bytes: truncated to %d bits" +msgstr[0] "ширина поля %lu не помещается в %d байт: обрезается до %d бита" +msgstr[1] "ширина поля %lu не помещается в %d байта: обрезается до %d бит" +msgstr[2] "ширина поля %lu не помещается в %d байт: обрезается до %d бит" + +#: config/tc-cr16.c:208 read.c:4709 +#, c-format +msgid "field value \"%s\" too complex for a bitfield" +msgstr "значение поля «%s» слишком сложно для bitfield" + +#: config/tc-cr16.c:389 +#, c-format +msgid "Unknown register pair - index relative mode: `%d'" +msgstr "неизвестный регистровая пара — режим относительной индексации: «%d»" + +#: config/tc-cr16.c:603 config/tc-crx.c:361 +#, c-format +msgid "internal error: reloc %d (`%s') not supported by object file format" +msgstr "внутренняя ошибка: перемещение %d («%s») не поддерживается форматом объектного файла" + +#: config/tc-cr16.c:696 config/tc-i386.c:10718 config/tc-s390.c:2106 +msgid "GOT already in symbol table" +msgstr "GOT уже в таблице символов" + +#: config/tc-cr16.c:813 config/tc-m68k.c:4657 config/tc-tilegx.c:319 +#: config/tc-tilepro.c:256 +#, c-format +msgid "Internal Error: Can't hash %s: %s" +msgstr "Внутренняя ошибка: невозможно получить хеш «%s»: %s" + +#: config/tc-cr16.c:839 config/tc-cris.c:1229 config/tc-crx.c:545 +#, c-format +msgid "Can't hash `%s': %s\n" +msgstr "Невозможно получить хеш «%s»: %s\n" + +#: config/tc-cr16.c:840 config/tc-cris.c:1230 config/tc-crx.c:546 +msgid "(unknown reason)" +msgstr "(неизвестная причина)" + +#. Missing or bad expr becomes absolute 0. +#: config/tc-cr16.c:892 config/tc-crx.c:619 +#, c-format +msgid "missing or invalid displacement expression `%s' taken as 0" +msgstr "отсутствующее или некорректное выражение смещения «%s», взятое как 0" + +#: config/tc-cr16.c:942 +#, c-format +msgid "GOT bad expression with %s." +msgstr "Неверное регулярное выражение GOT %s." + +#: config/tc-cr16.c:1053 +#, c-format +msgid "operand %d: illegal use expression: `%s`" +msgstr "операнд %d: недопустимое использование выражения: «%s»" + +#: config/tc-cr16.c:1118 config/tc-crx.c:1129 +#, c-format +msgid "Unknown register: `%d'" +msgstr "Неизвестный регистр: «%d»" + +#. Issue a error message when register is illegal. +#: config/tc-cr16.c:1126 +#, c-format +msgid "Illegal register (`%s') in Instruction: `%s'" +msgstr "Недопустимый регистр («%s») в инструкции: «%s»" + +#: config/tc-cr16.c:1199 config/tc-cr16.c:1274 +#, c-format +msgid "Illegal register `%s' in Instruction `%s'" +msgstr "Недопустимый регистр «%s» в инструкции «%s»" + +#: config/tc-cr16.c:1227 config/tc-cr16.c:1238 +#, c-format +msgid "Illegal register pair `%s' in Instruction `%s'" +msgstr "Недопустимая регистровая пара «%s» в инструкции «%s»" + +#: config/tc-cr16.c:1263 config/tc-i960.c:833 +msgid "unmatched '['" +msgstr "непарная «[»" + +#: config/tc-cr16.c:1269 config/tc-i960.c:840 +msgid "garbage after index spec ignored" +msgstr "мусор после указания индекса игнорируется" + +#: config/tc-cr16.c:1417 config/tc-crx.c:938 +#, c-format +msgid "Illegal operands (whitespace): `%s'" +msgstr "Неверные операнды (пробел): «%s»" + +#: config/tc-cr16.c:1429 config/tc-cr16.c:1436 config/tc-cr16.c:1453 +#: config/tc-crx.c:950 config/tc-crx.c:957 config/tc-crx.c:974 +#: config/tc-crx.c:1767 +#, c-format +msgid "Missing matching brackets : `%s'" +msgstr "Отсутствуют парные скобки: «%s»" + +#: config/tc-cr16.c:1485 config/tc-crx.c:1000 +#, c-format +msgid "Unknown exception: `%s'" +msgstr "Неизвестно исключение: «%s»" + +#: config/tc-cr16.c:1570 config/tc-crx.c:1096 +#, c-format +msgid "Illegal `cinv' parameter: `%c'" +msgstr "Недопустимый параметр «cinv»: «%c»" + +#: config/tc-cr16.c:1591 config/tc-cr16.c:1630 +#, c-format +msgid "Unknown register pair: `%d'" +msgstr "неизвестный регистровая пара: «%d»" + +#. Issue a error message when register pair is illegal. +#: config/tc-cr16.c:1599 +#, c-format +msgid "Illegal register pair (`%s') in Instruction: `%s'" +msgstr "Недопустимая регистровая пара («%s») в инструкции: «%s»" + +#. Issue a error message when register pair is illegal. +#: config/tc-cr16.c:1638 +#, c-format +msgid "Illegal index register pair (`%s') in Instruction: `%s'" +msgstr "Недопустимая индексная регистровая пара («%s») в инструкции: «%s»" + +#: config/tc-cr16.c:1677 +#, c-format +msgid "Unknown processor register : `%d'" +msgstr "Неизвестный регистр процессора: «%d»" + +#. Issue a error message when register pair is illegal. +#: config/tc-cr16.c:1685 +#, c-format +msgid "Illegal processor register (`%s') in Instruction: `%s'" +msgstr "Недопустимый регистр процессора («%s») в инструкции: «%s»" + +#: config/tc-cr16.c:1733 +#, c-format +msgid "Unknown processor register (32 bit) : `%d'" +msgstr "Неизвестный регистр процессора (32 бита): «%d»" + +#. Issue a error message when register pair is illegal. +#: config/tc-cr16.c:1741 +#, c-format +msgid "Illegal 32 bit - processor register (`%s') in Instruction: `%s'" +msgstr "Недопустимый 32-битный регистр процессора («%s») в инструкции: «%s»" + +#: config/tc-cr16.c:2107 config/tc-crx.c:1665 config/tc-crx.c:1682 +#, c-format +msgid "Same src/dest register is used (`r%d'), result is undefined" +msgstr "Используется одинаковый регистр в источнике/приёмнике(«r%d»), результат не определён" + +#: config/tc-cr16.c:2128 +msgid "RA register is saved twice." +msgstr "Регистр RA сохранён дважды." + +#: config/tc-cr16.c:2132 +#, c-format +msgid "`%s' Illegal use of registers." +msgstr "В «%s» неправильно используются регистры." + +#: config/tc-cr16.c:2146 +#, c-format +msgid "`%s' Illegal count-register combination." +msgstr "В «%s» задана неправильная комбинация счётчик-регистр." + +#: config/tc-cr16.c:2152 +#, c-format +msgid "`%s' Illegal use of register." +msgstr "В «%s» неправильно используется регистр." + +#: config/tc-cr16.c:2161 config/tc-crx.c:1674 +#, c-format +msgid "`%s' has undefined result" +msgstr "«%s» содержит неопределенный результат" + +#: config/tc-cr16.c:2169 +#, c-format +msgid "Same src/dest register is used (`r%d'),result is undefined" +msgstr "Используется одинаковый регистр в источнике/приёмнике(«r%d»), результат не определён" + +#: config/tc-cr16.c:2340 config/tc-crx.c:1579 +msgid "Incorrect number of operands" +msgstr "Неправильное количество операндов" + +#: config/tc-cr16.c:2342 config/tc-crx.c:1581 +#, c-format +msgid "Illegal type of operand (arg %d)" +msgstr "Неверный тип операнда (аргумент %d)" + +#: config/tc-cr16.c:2348 config/tc-crx.c:1587 +#, c-format +msgid "Operand out of range (arg %d)" +msgstr "Операнд вне диапазона (аргумент %d)" + +#: config/tc-cr16.c:2351 config/tc-crx.c:1590 +#, c-format +msgid "Operand has odd displacement (arg %d)" +msgstr "Операнд имеет нечётное смещение (аргумент %d)" + +#: config/tc-cr16.c:2354 config/tc-cr16.c:2385 config/tc-crx.c:1603 +#: config/tc-crx.c:1634 +#, c-format +msgid "Illegal operand (arg %d)" +msgstr "Неверный операнда (аргумент %d)" + +#. Give an error if a frag containing code is not aligned to a 2-byte +#. boundary. +#: config/tc-cr16.c:2487 config/tc-cr16.h:74 config/tc-crx.c:1956 +#: config/tc-crx.h:77 config/tc-ppc.c:3542 config/tc-ppc.c:6500 +msgid "instruction address is not a multiple of 2" +msgstr "Адрес инструкции не кратен 2" + +#: config/tc-cr16.c:2510 config/tc-cris.c:1556 config/tc-cris.c:1564 +#: config/tc-crx.c:1992 config/tc-dlx.c:692 config/tc-hppa.c:3212 +#: config/tc-hppa.c:3219 config/tc-i860.c:490 config/tc-i860.c:507 +#: config/tc-i860.c:987 config/tc-sparc.c:1813 config/tc-sparc.c:1821 +#, c-format +msgid "Unknown opcode: `%s'" +msgstr "Неизвестный код операции: «%s»" + +#: config/tc-cris.c:550 config/tc-m68hc11.c:3893 +#, c-format +msgid "internal inconsistency problem in %s: fr_symbol %lx" +msgstr "внутренняя проблема рассогласованности в %s: fr_symbol %lx" + +#: config/tc-cris.c:554 config/tc-m68hc11.c:3897 config/tc-msp430.c:4620 +#, c-format +msgid "internal inconsistency problem in %s: resolved symbol" +msgstr "внутренняя проблема рассогласованности в %s: определённый символ" + +#: config/tc-cris.c:564 config/tc-m68hc11.c:3903 +#, c-format +msgid "internal inconsistency problem in %s: fr_subtype %d" +msgstr "внутренняя проблема рассогласованности в %s: fr_subtype %d" + +#: config/tc-cris.c:904 +msgid "Relaxation to long branches for .arch common_v10_v32 not implemented" +msgstr "Ослабление длинных ветвей для .arch common_v10_v32 не реализовано" + +#: config/tc-cris.c:934 +msgid "Complicated LAPC target operand is not a multiple of two. Use LAPC.D" +msgstr "Составной операнд цели LAPC не кратен 2. Используйте LAPC.D" + +#: config/tc-cris.c:939 +#, c-format +msgid "Internal error found in md_convert_frag: offset %ld. Please report this." +msgstr "Внутренняя ошибка в md_convert_frag: смещение %ld. Сообщите об этом." + +#: config/tc-cris.c:964 +#, c-format +msgid "internal inconsistency in %s: bdapq no symbol" +msgstr "внутренняя несогласованность в %s: bdapq не символ" + +#: config/tc-cris.c:977 +#, c-format +msgid "internal inconsistency in %s: bdap.w with no symbol" +msgstr "внутренняя несогласованность в %s: bdap.w не содержит символа" + +#: config/tc-cris.c:1001 +msgid "section alignment must be >= 4 bytes to check MULS/MULU safeness" +msgstr "для проверки безопасности MULS/MULU выравнивание раздела должно быть >= 4 байта" + +#: config/tc-cris.c:1010 +msgid "dangerous MULS/MULU location; give it higher alignment" +msgstr "опасное расположение MULS/MULU; установите для него большее выравнивание" + +#. Bail out for compatibility mode. (It seems it can be implemented, +#. perhaps with a 10-byte sequence: "move.d NNNN,$pc/$acr", "jump +#. $acr", "nop"; but doesn't seem worth it at the moment.) +#: config/tc-cris.c:1051 +msgid "Out-of-range .word offset handling is not implemented for .arch common_v10_v32" +msgstr "Обработка смещение .word вне диапазона не реализована для .arch common_v10_v32" + +#: config/tc-cris.c:1096 +msgid ".word case-table handling failed: table too large" +msgstr "ошибка обработки .word case-table: слишком большая таблица" + +#: config/tc-cris.c:1234 +#, c-format +msgid "Buggy opcode: `%s' \"%s\"\n" +msgstr "Дефектный код операции: «%s» «%s»\n" + +#: config/tc-cris.c:1662 +#, c-format +msgid "Immediate value not in 5 bit unsigned range: %ld" +msgstr "Непосредственное значение за пределами 5-битного беззнакового диапазона: %ld" + +#: config/tc-cris.c:1678 +#, c-format +msgid "Immediate value not in 4 bit unsigned range: %ld" +msgstr "Непосредственное значение за пределами 4-битного беззнакового диапазона: %ld" + +#: config/tc-cris.c:1730 +#, c-format +msgid "Immediate value not in 6 bit range: %ld" +msgstr "Непосредственное значение за пределами 6-битного диапазона: %ld" + +#: config/tc-cris.c:1746 +#, c-format +msgid "Immediate value not in 6 bit unsigned range: %ld" +msgstr "Непосредственное значение за пределами 6-битного беззнакового диапазона: %ld" + +#. Others have a generic warning. +#: config/tc-cris.c:1855 +#, c-format +msgid "Unimplemented register `%s' specified" +msgstr "Указан нереализованный регистр «%s»" + +#. We've come to the end of instructions with this +#. opcode, so it must be an error. +#: config/tc-cris.c:2099 +msgid "Illegal operands" +msgstr "Неверные операнды" + +#: config/tc-cris.c:2140 config/tc-cris.c:2180 +#, c-format +msgid "Immediate value not in 8 bit range: %ld" +msgstr "Непосредственное значение за пределами 8-битного диапазона: %ld" + +#: config/tc-cris.c:2150 config/tc-cris.c:2201 +#, c-format +msgid "Immediate value not in 16 bit range: %ld" +msgstr "Непосредственное значение за пределами 16-битного диапазона: %ld" + +#: config/tc-cris.c:2185 +#, c-format +msgid "Immediate value not in 8 bit signed range: %ld" +msgstr "Непосредственное значение за пределами 8-битного диапазона со знаком: %ld" + +#: config/tc-cris.c:2190 +#, c-format +msgid "Immediate value not in 8 bit unsigned range: %ld" +msgstr "Непосредственное значение за пределами 8-битного беззнакового диапазона: %ld" + +#: config/tc-cris.c:2206 +#, c-format +msgid "Immediate value not in 16 bit signed range: %ld" +msgstr "Непосредственное значение за пределами 16-битного диапазона со знаком: %ld" + +#: config/tc-cris.c:2211 +#, c-format +msgid "Immediate value not in 16 bit unsigned range: %ld" +msgstr "Непосредственное значение за пределами 16-битного беззнакового диапазона: %ld" + +#: config/tc-cris.c:2237 +msgid "TLS relocation size does not match operand size" +msgstr "Размер перемещения TLS не совпадает с размером операнда" + +#: config/tc-cris.c:2238 +msgid "PIC relocation size does not match operand size" +msgstr "Размер перемещения PIC не совпадает с размером операнда" + +#: config/tc-cris.c:3385 +msgid "Calling gen_cond_branch_32 for .arch common_v10_v32\n" +msgstr "Вызывается gen_cond_branch_32 для .arch common_v10_v32\n" + +#: config/tc-cris.c:3389 +msgid "32-bit conditional branch generated" +msgstr "Сгенерировано 32-битная ветвь с условием" + +#: config/tc-cris.c:3450 +msgid "Complex expression not supported" +msgstr "Сложное выражение не поддерживается" + +#. FIXME: Is this function mentioned in the internals.texi manual? If +#. not, add it. +#: config/tc-cris.c:3600 +msgid "Bad call to md_atof () - floating point formats are not supported" +msgstr "Неправильный вызов md_atof () — формат значения с плавающей запятой не поддерживается" + +#: config/tc-cris.c:3641 +msgid "PC-relative relocation must be trivially resolved" +msgstr "PC-относительное перемещение должно быть определяться просто" + +#: config/tc-cris.c:3713 +#, c-format +msgid "Value not in 16 bit range: %ld" +msgstr "Значение за пределами 16-битного диапазона: %ld" + +#: config/tc-cris.c:3721 +#, c-format +msgid "Value not in 16 bit signed range: %ld" +msgstr "Значение за пределами 16-битного диапазона со знаком: %ld" + +#: config/tc-cris.c:3729 +#, c-format +msgid "Value not in 8 bit range: %ld" +msgstr "Значение за пределами 8-битного диапазона: %ld" + +#: config/tc-cris.c:3736 +#, c-format +msgid "Value not in 8 bit signed range: %ld" +msgstr "Значение за пределами 8-битного диапазона со знаком: %ld" + +#: config/tc-cris.c:3746 +#, c-format +msgid "Value not in 4 bit unsigned range: %ld" +msgstr "Значение за пределами 4-битного беззнакового диапазона: %ld" + +#: config/tc-cris.c:3753 +#, c-format +msgid "Value not in 5 bit unsigned range: %ld" +msgstr "Значение за пределами 5-битного беззнакового диапазона: %ld" + +#: config/tc-cris.c:3760 +#, c-format +msgid "Value not in 6 bit range: %ld" +msgstr "Значение за пределами 6-битного диапазона: %ld" + +#: config/tc-cris.c:3767 +#, c-format +msgid "Value not in 6 bit unsigned range: %ld" +msgstr "Значение за пределами 6-битного беззнакового диапазона: %ld" + +#: config/tc-cris.c:3811 +#, c-format +msgid "Please use --help to see usage and options for this assembler.\n" +msgstr "Использование и параметры ассемблера можно посмотреть указав параметр --help.\n" + +#: config/tc-cris.c:3823 +msgid "--no-underscore is invalid with a.out format" +msgstr "нельзя указывать --no-underscore при использовании формата a.out" + +#: config/tc-cris.c:3835 +msgid "--pic is invalid for this object format" +msgstr "нельзя указывать --pic для этого объектного формата" + +#: config/tc-cris.c:3849 +#, c-format +msgid "invalid in --march=: %s" +msgstr "некорректная <архитектура> в --march=<архитектура>: %s" + +#: config/tc-cris.c:3958 config/tc-ft32.c:689 config/tc-moxie.c:778 +msgid "Semantics error. This type of operand can not be relocated, it must be an assembly-time constant" +msgstr "Семантическая ошибка. Данный тип операнда невозможно переместить, он должен быть константой на момент ассемблирования" + +#: config/tc-cris.c:4007 config/tc-ft32.c:710 config/tc-moxie.c:826 +#, c-format +msgid "Cannot generate relocation type for symbol %s, code %s" +msgstr "Невозможно сгенерировать тип перемещения для символа %s, код %s" + +#. The messages are formatted to line up with the generic options. +#: config/tc-cris.c:4020 +#, c-format +msgid "CRIS-specific options:\n" +msgstr "Специализированные параметры ассемблера для CRIS:\n" + +#: config/tc-cris.c:4022 +msgid " -h, -H Don't execute, print this help text. Deprecated.\n" +msgstr " -h, -H Не выполнять, показать этот текст. Устарел.\n" + +#: config/tc-cris.c:4024 +msgid " -N Warn when branches are expanded to jumps.\n" +msgstr " -N Предупреждать, когда ветви раскрываются до прыжков.\n" + +#: config/tc-cris.c:4026 +msgid " --underscore User symbols are normally prepended with underscore.\n" +msgstr "" +" --underscore Пользовательские символы обычно начинаются\n" +" с подчёркивания.\n" + +#: config/tc-cris.c:4028 +msgid " Registers will not need any prefix.\n" +msgstr " Регистрам префикс не требуется.\n" + +#: config/tc-cris.c:4030 +msgid " --no-underscore User symbols do not have any prefix.\n" +msgstr "" +" --no-underscore Пользовательские символы не начинаются с\n" +" какого-то определённого префикса.\n" + +#: config/tc-cris.c:4032 +msgid " Registers will require a `$'-prefix.\n" +msgstr " Для регистров требуется префикс «$».\n" + +#: config/tc-cris.c:4035 +msgid " --pic\t\t\tEnable generation of position-independent code.\n" +msgstr " --pic\t\t\tВключить генерацию перемещаемого кода.\n" + +#: config/tc-cris.c:4038 +msgid "" +" --march=\t\tGenerate code for . Valid choices for \n" +"\t\t\t\tare v0_v10, v10, v32 and common_v10_v32.\n" +msgstr "" +" --march=<архитектура>\t\tГенерировать код для <архитектуры>.\n" +"\t\t\t\tВозможные варианты <архитектуры>:\n" +"\t\t\t\tv0_v10, v10, v32 и common_v10_v32.\n" + +#: config/tc-cris.c:4059 +msgid "Invalid relocation" +msgstr "Неверное перемещение" + +#: config/tc-cris.c:4096 +msgid "Invalid pc-relative relocation" +msgstr "Неверное перемещение, относительное PC" + +#: config/tc-cris.c:4141 +#, c-format +msgid "Adjusted signed .word (%ld) overflows: `switch'-statement too large." +msgstr "Переполнение подогнанного .word (%ld) со знаком: слишком большой оператор «переключения»." + +#: config/tc-cris.c:4171 +#, c-format +msgid ".syntax %s requires command-line option `--underscore'" +msgstr "для .syntax %s требуется параметр командной строки «--underscore»" + +#: config/tc-cris.c:4180 +#, c-format +msgid ".syntax %s requires command-line option `--no-underscore'" +msgstr "для .syntax %s требуется параметр командной строки «--no-underscore»" + +#: config/tc-cris.c:4217 +msgid "Unknown .syntax operand" +msgstr "Неизвестный операнд .syntax" + +#: config/tc-cris.c:4227 +msgid "Pseudodirective .file is only valid when generating ELF" +msgstr "Псевдодиректива .file допускается только при генерации ELF" + +#: config/tc-cris.c:4239 +msgid "Pseudodirective .loc is only valid when generating ELF" +msgstr "Псевдодиректива .loc допускается только при генерации ELF" + +#: config/tc-cris.c:4254 +#, c-format +msgid "internal inconsistency problem: %s called for %d bytes" +msgstr "внутренняя проблема рассогласованности: вызвана %s для %d байт" + +#: config/tc-cris.c:4406 +msgid "unknown operand to .arch" +msgstr "неизвестный операнд в .arch" + +#: config/tc-cris.c:4415 +msgid ".arch requires a matching --march=... option" +msgstr ".arch <архитектура> должна совпадать с параметром --march=…" + +#: config/tc-crx.c:572 config/tc-crx.c:591 +#, c-format +msgid "Internal error: Can't hash %s: %s" +msgstr "Внутренняя ошибка: невозможно получить хеш %s: %s" + +#: config/tc-crx.c:759 config/tc-crx.c:779 config/tc-crx.c:794 +#, c-format +msgid "Illegal register `%s' in instruction `%s'" +msgstr "Недопустимый регистр «%s» в инструкции «%s»" + +#: config/tc-crx.c:822 +#, c-format +msgid "Illegal Scale - `%d'" +msgstr "Неверное масштабирование — «%d»" + +#. Issue a error message when register is illegal. +#: config/tc-crx.c:1137 +#, c-format +msgid "Illegal register (`%s') in instruction: `%s'" +msgstr "Недопустимый регистр («%s») в инструкции: «%s»" + +#: config/tc-crx.c:1264 +#, c-format +msgid "Illegal co-processor register in instruction `%s'" +msgstr "Недопустимый регистр сопроцессора в инструкции «%s»" + +#: config/tc-crx.c:1271 +#, c-format +msgid "Illegal co-processor special register in instruction `%s'" +msgstr "Недопустимый специальный регистр сопроцессора в инструкции «%s»" + +#: config/tc-crx.c:1593 +#, c-format +msgid "Invalid DISPU4 operand value (arg %d)" +msgstr "Некорректное значение операнда DISPU4 (аргумент %d)" + +#: config/tc-crx.c:1596 +#, c-format +msgid "Invalid CST4 operand value (arg %d)" +msgstr "Некорректное значение операнда CST4 (аргумент %d)" + +#: config/tc-crx.c:1599 +#, c-format +msgid "Operand value is not within upper 64 KB (arg %d)" +msgstr "Значение операнда находится за пределами 64 КБ (аргумент %d)" + +#: config/tc-crx.c:1736 +msgid "Invalid register in register list" +msgstr "Некорректный регистр в списке регистров" + +#: config/tc-crx.c:1790 +#, c-format +msgid "Illegal register `%s' in cop-register list" +msgstr "Некорректный регистр «%s» в списке регистров сопроцессора" + +#: config/tc-crx.c:1798 +#, c-format +msgid "Illegal register `%s' in cop-special-register list" +msgstr "Некорректный регистр «%s» в списке специальных регистров сопроцессора" + +#: config/tc-crx.c:1817 +#, c-format +msgid "Illegal register `%s' in user register list" +msgstr "Некорректный регистр «%s» в списке пользовательских регистров" + +#: config/tc-crx.c:1836 +#, c-format +msgid "Illegal register `%s' in register list" +msgstr "Некорректный регистр «%s» в списке регистров" + +#: config/tc-crx.c:1842 +#, c-format +msgid "Maximum %d bits may be set in `mask16' operand" +msgstr "В операнде «mask16» может быть установлено не более %d бит" + +#: config/tc-crx.c:1851 +#, c-format +msgid "rest of line ignored; first ignored character is `%c'" +msgstr "остальная часть проигнорирована; первый игнорированный символ — «%c»" + +#: config/tc-crx.c:1859 +#, c-format +msgid "Illegal `mask16' operand, operation is undefined - `%s'" +msgstr "неверный операнд «mask16», операция не определена — «%s»" + +#. HI can't be specified without LO (and vise-versa). +#: config/tc-crx.c:1865 +msgid "HI/LO registers should be specified together" +msgstr "Регистры HI/LO должны указываться вместе" + +#: config/tc-crx.c:1871 +msgid "HI/LO registers should be specified without additional registers" +msgstr "Регистры HI/LO должны указываться без дополнительных регистров" + +#: config/tc-d10v.c:216 +#, c-format +msgid "" +"D10V options:\n" +"-O Optimize. Will do some operations in parallel.\n" +"--gstabs-packing Pack adjacent short instructions together even\n" +" when --gstabs is specified. On by default.\n" +"--no-gstabs-packing If --gstabs is specified, do not pack adjacent\n" +" instructions together.\n" +msgstr "" +"Параметры D10V:\n" +"-O Оптимизация. Выполнять некоторые операции параллельно.\n" +"--gstabs-packing Упаковывать смежные короткие инструкции вместе даже\n" +" когда указан --gstabs. Включено по умолчанию.\n" +"--no-gstabs-packing Если указан --gstabs, не упаковывать смежные короткие\n" +" инструкции вместе.\n" + +#: config/tc-d10v.c:573 +msgid "operand is not an immediate" +msgstr "указан не непосредственный операнд" + +#: config/tc-d10v.c:591 +#, c-format +msgid "operand out of range: %lu" +msgstr "операнд вне диапазона: %lu" + +#: config/tc-d10v.c:651 +msgid "Instruction must be executed in parallel with another instruction." +msgstr "Инструкция должна выполняться параллельно с другой инструкцией." + +#: config/tc-d10v.c:705 config/tc-d10v.c:713 +#, c-format +msgid "packing conflict: %s must dispatch sequentially" +msgstr "конфликт упаковки: %s должна обрабатываться последовательно" + +#: config/tc-d10v.c:812 +#, c-format +msgid "resource conflict (R%d)" +msgstr "конфликт ресурса (R%d)" + +#: config/tc-d10v.c:815 +#, c-format +msgid "resource conflict (A%d)" +msgstr "конфликт ресурса (A%d)" + +#: config/tc-d10v.c:817 +msgid "resource conflict (PSW)" +msgstr "конфликт ресурса (PSW)" + +#: config/tc-d10v.c:819 +msgid "resource conflict (C flag)" +msgstr "конфликт ресурса (флаг C)" + +#: config/tc-d10v.c:821 +msgid "resource conflict (F flag)" +msgstr "конфликт ресурса (флаг F)" + +#: config/tc-d10v.c:971 +msgid "Instruction must be executed in parallel" +msgstr "Инструкция должна выполняться параллельно" + +#: config/tc-d10v.c:974 +msgid "Long instructions may not be combined." +msgstr "Длинные инструкции не могут быть объединены." + +#: config/tc-d10v.c:1007 +msgid "One of these instructions may not be executed in parallel." +msgstr "Одна из этих инструкций не может выполняться параллельно." + +#: config/tc-d10v.c:1011 config/tc-d30v.c:1037 +msgid "Two IU instructions may not be executed in parallel" +msgstr "Две инструкции UI не могут выполняться параллельно" + +#: config/tc-d10v.c:1013 config/tc-d10v.c:1021 config/tc-d10v.c:1035 +#: config/tc-d10v.c:1050 config/tc-d30v.c:1038 config/tc-d30v.c:1047 +msgid "Swapping instruction order" +msgstr "Порядок перестановки инструкций" + +#: config/tc-d10v.c:1019 config/tc-d30v.c:1044 +msgid "Two MU instructions may not be executed in parallel" +msgstr "Две инструкции MU не могут выполняться параллельно" + +#: config/tc-d10v.c:1039 config/tc-d30v.c:1064 +msgid "IU instruction may not be in the left container" +msgstr "Инструкция IU не может быть в левом контейнере" + +#: config/tc-d10v.c:1041 config/tc-d10v.c:1056 +msgid "Instruction in R container is squashed by flow control instruction in L container." +msgstr "Инструкция в контейнере R подавлена инструкцией управления потоком из контейнера L." + +#: config/tc-d10v.c:1054 config/tc-d30v.c:1075 +msgid "MU instruction may not be in the right container" +msgstr "Инструкция MU не может быть в правом контейнере" + +#: config/tc-d10v.c:1060 config/tc-d30v.c:1087 +msgid "unknown execution type passed to write_2_short()" +msgstr "в write_2_short() передан неизвестный тип выполнения" + +#: config/tc-d10v.c:1189 config/tc-d10v.c:1362 +msgid "bad opcode or operands" +msgstr "плохой код операции или операнды" + +#: config/tc-d10v.c:1264 +msgid "value out of range" +msgstr "значение за пределами диапазона" + +#: config/tc-d10v.c:1338 +msgid "illegal operand - register name found where none expected" +msgstr "недопустимый операнд — обнаружено имя регистра где его быть не должно" + +#: config/tc-d10v.c:1373 +msgid "Register number must be EVEN" +msgstr "Номер регистра должны быть ЧЁТНЫМ" + +#: config/tc-d10v.c:1376 +msgid "Unsupported use of sp" +msgstr "Неподдерживаемое использование sp" + +#: config/tc-d10v.c:1395 +#, c-format +msgid "cr%ld is a reserved control register" +msgstr "cr%ld — зарезервированный регистр управления" + +#: config/tc-d10v.c:1570 +#, c-format +msgid "line %d: rep or repi must include at least 4 instructions" +msgstr "строка %d: rep или repi должна содержать не менее 4 инструкций" + +#: config/tc-d10v.c:1759 +msgid "can't find previous opcode " +msgstr "невозможно найти предыдущий код операции " + +#: config/tc-d10v.c:1771 +#, c-format +msgid "could not assemble: %s" +msgstr "невозможно провести ассемблирование: %s" + +#: config/tc-d10v.c:1786 config/tc-d10v.c:1808 config/tc-d30v.c:1744 +msgid "Unable to mix instructions as specified" +msgstr "Невозможно смешивать инструкции как указано" + +#: config/tc-d30v.c:149 +#, c-format +msgid "Register name %s conflicts with symbol of the same name" +msgstr "Имя регистра %s конфликтует с символом с тем же именем" + +#: config/tc-d30v.c:239 +#, c-format +msgid "" +"\n" +"D30V options:\n" +"-O Make adjacent short instructions parallel if possible.\n" +"-n Warn about all NOPs inserted by the assembler.\n" +"-N Warn about NOPs inserted after word multiplies.\n" +"-c Warn about symbols whose names match register names.\n" +"-C Opposite of -C. -c is the default.\n" +msgstr "" +"\n" +"Параметры D30V:\n" +"-O Выполнять сходимые короткие инструкции параллельно,\n" +" если возможно.\n" +"-n Предупреждать о всех NOP, вставляемых ассемблером.\n" +"-N Предупреждать о NOP, вставляемых после умножения слов.\n" +"-c Предупреждать о символах, чьи имена совпадают\n" +" с именами регистров (по умолчанию).\n" +"-C Противоположность -c.\n" + +#: config/tc-d30v.c:367 +msgid "unexpected 12-bit reloc type" +msgstr "неожиданный 12-битный тип перемещения" + +#: config/tc-d30v.c:374 +msgid "unexpected 18-bit reloc type" +msgstr "неожиданный 18-битный тип перемещения" + +#: config/tc-d30v.c:625 +#, c-format +msgid "%s NOP inserted" +msgstr "%s NOP вставлено" + +#: config/tc-d30v.c:626 +msgid "sequential" +msgstr "последовательно" + +#: config/tc-d30v.c:626 +msgid "parallel" +msgstr "параллельно" + +#: config/tc-d30v.c:1033 +msgid "Instructions may not be executed in parallel" +msgstr "Инструкции не могут выполняться параллельно" + +#: config/tc-d30v.c:1046 +#, c-format +msgid "Executing %s in IU may not work" +msgstr "Выполнение %s в IU может не работать" + +#: config/tc-d30v.c:1053 +#, c-format +msgid "Executing %s in IU may not work in parallel execution" +msgstr "Выполнение %s в IU может не работать при параллельном выполнении" + +#: config/tc-d30v.c:1066 +#, c-format +msgid "special left instruction `%s' kills instruction `%s' in right container" +msgstr "специальная левая инструкция «%s» убивает инструкцию «%s» в правом контейнере" + +#: config/tc-d30v.c:1077 +#, c-format +msgid "Executing %s in reverse serial with %s may not work" +msgstr "Выполнение %s в обратной последовательности к %s может не работать" + +#: config/tc-d30v.c:1080 +#, c-format +msgid "Executing %s in IU in reverse serial may not work" +msgstr "Выполнение %s в UI в обратной последовательности может не работать" + +#: config/tc-d30v.c:1268 +msgid "Odd numbered register used as target of multi-register instruction" +msgstr "В качестве цели многорегистровой инструкции используется регистр с нечётным номером" + +#: config/tc-d30v.c:1332 config/tc-d30v.c:1368 +#, c-format +msgid "unknown condition code: %s" +msgstr "неизвестный код условия: %s" + +#: config/tc-d30v.c:1361 +#, c-format +msgid "cmpu doesn't support condition code %s" +msgstr "cmpu не поддерживает код условия %s" + +#: config/tc-d30v.c:1396 +#, c-format +msgid "unknown opcode: %s" +msgstr "неизвестный код операции: %s" + +#: config/tc-d30v.c:1407 +#, c-format +msgid "operands for opcode `%s' do not match any valid format" +msgstr "операнды кода операции «%s» не соответствуют любому допускаемому формату" + +#: config/tc-d30v.c:1622 config/tc-d30v.c:1639 +msgid "Cannot assemble instruction" +msgstr "Невозможно выполнить ассемблирование инструкции" + +#: config/tc-d30v.c:1624 +msgid "First opcode is long. Unable to mix instructions as specified." +msgstr "Первый код операции длинный. Невозможно смешивать указанные инструкции." + +#: config/tc-d30v.c:1694 +msgid "word of NOPs added between word multiply and load" +msgstr "слово NOP добавлено между словом умножения и загрузки" + +#: config/tc-d30v.c:1696 +msgid "word of NOPs added between word multiply and 16-bit multiply" +msgstr "слово NOP добавлено между словом умножения и 16-битным умножением" + +#: config/tc-d30v.c:1728 +msgid "Instruction uses long version, so it cannot be mixed as specified" +msgstr "Используется длинная версия инструкции, поэтому указанное смешение невозможно" + +#: config/tc-d30v.c:1855 +#, c-format +msgid "value too large to fit in %d bits" +msgstr "значение слишком велико для расположения в %d битах" + +#: config/tc-d30v.c:1923 +#, c-format +msgid "line %d: unable to place address of symbol '%s' into a byte" +msgstr "строка %d: невозможно поместить адрес символа «%s» в байт" + +#: config/tc-d30v.c:1926 +#, c-format +msgid "line %d: unable to place value %lx into a byte" +msgstr "строка %d: невозможно поместить значение %lx в байт" + +#: config/tc-d30v.c:1934 +#, c-format +msgid "line %d: unable to place address of symbol '%s' into a short" +msgstr "строка %d: невозможно поместить адрес символа «%s» в половину слова" + +#: config/tc-d30v.c:1937 +#, c-format +msgid "line %d: unable to place value %lx into a short" +msgstr "строка %d: невозможно поместить значение %lx в половину слова" + +#: config/tc-d30v.c:1945 +#, c-format +msgid "line %d: unable to place address of symbol '%s' into a quad" +msgstr "строка %d: невозможно поместить адрес символа «%s» в два слова" + +#: config/tc-d30v.c:2053 config/tc-pru.c:216 config/tc-pru.c:332 +#, c-format +msgid "Alignment too large: %d assumed" +msgstr "Слишком большое выравнивание: предполагается %d" + +#: config/tc-dlx.c:213 +msgid "missing .proc" +msgstr "отсутствует .proc" + +#: config/tc-dlx.c:230 +msgid ".endfunc missing for previous .proc" +msgstr "отсутствует .endfunc при указанной .proc" + +#: config/tc-dlx.c:295 config/tc-i860.c:226 config/tc-mips.c:3600 +#: config/tc-nios2.c:3639 config/tc-nios2.c:3653 config/tc-nios2.c:3668 +#: config/tc-pru.c:1565 config/tc-pru.c:1579 config/tc-riscv.c:621 +#, c-format +msgid "internal error: can't hash `%s': %s\n" +msgstr "внутренняя ошибка: невозможно получить хеш «%s»: %s\n" + +#. Probably a memory allocation problem? Give up now. +#: config/tc-dlx.c:302 config/tc-hppa.c:8270 config/tc-nios2.c:1440 +#: config/tc-nios2.c:3642 config/tc-nios2.c:3656 config/tc-nios2.c:3671 +#: config/tc-pru.c:1568 config/tc-pru.c:1582 config/tc-riscv.c:624 +#: config/tc-riscv.c:632 config/tc-sparc.c:1064 +msgid "Broken assembler. No assembly attempted." +msgstr "Ассемблер сломался. Ничего ассемблироваться не будет." + +#: config/tc-dlx.c:332 +#, c-format +msgid "Bad operand for a load instruction: <%s>" +msgstr "Плохой операнд для инструкции загрузки: <%s>" + +#: config/tc-dlx.c:446 +#, c-format +msgid "Bad operand for a store instruction: <%s>" +msgstr "Плохой операнд для инструкции сохранения: <%s>" + +#: config/tc-dlx.c:626 +#, c-format +msgid "Expression Error for operand modifier %%hi/%%lo\n" +msgstr "Ошибка в регулярном выражении модификатора операнда %%hi/%%lo\n" + +#: config/tc-dlx.c:639 +#, c-format +msgid "Invalid expression after %%%%\n" +msgstr "Неверное выражение после %%%%\n" + +#: config/tc-dlx.c:703 config/tc-tic4x.c:2473 +#, c-format +msgid "Unknown opcode `%s'." +msgstr "Неизвестный код операции: «%s»." + +#: config/tc-dlx.c:712 +msgid "Can not set dlx_skip_hi16_flag" +msgstr "Невозможно задать dlx_skip_hi16_flag" + +#: config/tc-dlx.c:726 +#, c-format +msgid "Missing arguments for opcode <%s>." +msgstr "Отсутствуют аргументы для кода операции <%s>." + +#: config/tc-dlx.c:760 +#, c-format +msgid "Too many operands: %s" +msgstr "Слишком много операндов: %s" + +#: config/tc-dlx.c:798 +#, c-format +msgid "Both the_insn.HI and the_insn.LO are set : %s" +msgstr "Одновременно заданы the_insn.HI и the_insn.LO: %s" + +#: config/tc-dlx.c:868 +msgid "failed regnum sanity check." +msgstr "regnum не прошёл проверку работоспособности." + +#: config/tc-dlx.c:881 +msgid "failed general register sanity check." +msgstr "регистр общего назначения не прошёл проверку работоспособности." + +#. Types or values of args don't match. +#: config/tc-dlx.c:889 +msgid "Invalid operands" +msgstr "Неверные операнды" + +#: config/tc-dlx.c:1118 +#, c-format +msgid "label \"$%d\" redefined" +msgstr "переопределение метки «$%d»" + +#: config/tc-dlx.c:1156 +msgid "Invalid expression after # number\n" +msgstr "Неверное выражение после # номер\n" + +#: config/tc-dlx.c:1199 config/tc-i960.c:2637 config/tc-m32r.c:2276 +#: config/tc-nds32.c:6639 config/tc-sparc.c:4124 +#, c-format +msgid "internal error: can't export reloc type %d (`%s')" +msgstr "внутренняя ошибка: невозможно экспортировать тип перемещения %d («%s»)" + +#: config/tc-epiphany.c:126 +#, c-format +msgid "EPIPHANY specific command line options:\n" +msgstr "Специализированные параметры командной строки для EPIPHANY:\n" + +#: config/tc-epiphany.c:365 +msgid "register number too large for push/pop" +msgstr "слишком большой номер регистра для push/pop" + +#: config/tc-epiphany.c:369 +msgid "register is out of order" +msgstr "указан регистр не по порядку" + +#: config/tc-epiphany.c:380 config/tc-m68k.c:6033 config/tc-m68k.c:6062 +msgid "bad register list" +msgstr "некорректный список регистров" + +#: config/tc-epiphany.c:383 +msgid "malformed reglist in push/pop" +msgstr "неверно сформированный eglist в push/pop" + +#. Checks for behavioral restrictions on LD/ST instructions. +#: config/tc-epiphany.c:429 +msgid "destination register modified by displacement-post-modified address" +msgstr "регистр назначения изменён адресом смещения-после-изменения" + +#: config/tc-epiphany.c:430 +msgid "ldrd/strd requires even:odd register pair" +msgstr "для ldrd/strd требуется регистрова пара чётный:нечётный" + +#: config/tc-epiphany.c:813 config/tc-m32r.c:1784 +msgid "Addend to unresolved symbol not on word boundary." +msgstr "Добавка к неопределённому символу не выровнена по границе слова." + +#: config/tc-fr30.c:81 +#, c-format +msgid " FR30 specific command line options:\n" +msgstr " Специализированные параметры командной строки для FR30:\n" + +#: config/tc-fr30.c:134 +#, c-format +msgid "Instruction %s not allowed in a delay slot." +msgstr "Инструкция %s не допускается в слоте задержки." + +#: config/tc-frv.c:403 +#, c-format +msgid "Unknown cpu -mcpu=%s" +msgstr "Неизвестный ЦП -mcpu=%s" + +#: config/tc-frv.c:456 +#, c-format +msgid "FRV specific command line options:\n" +msgstr "Специализированные параметры командной строки для FRV:\n" + +#: config/tc-frv.c:457 +#, c-format +msgid "-G n Put data <= n bytes in the small data area\n" +msgstr "-G n Помещать данные <= n байт в области малых данных\n" + +#: config/tc-frv.c:458 +#, c-format +msgid "-mgpr-32 Mark generated file as only using 32 GPRs\n" +msgstr "-mgpr-32 Пометить сгенерированный файл как использующий только 32 РОН\n" + +#: config/tc-frv.c:459 +#, c-format +msgid "-mgpr-64 Mark generated file as using all 64 GPRs\n" +msgstr "-mgpr-64 Пометить сгенерированный файл как использующий все 64 РОН\n" + +#: config/tc-frv.c:460 +#, c-format +msgid "-mfpr-32 Mark generated file as only using 32 FPRs\n" +msgstr "-mfpr-32 Пометить сгенерированный файл как использующий только 32 32 FPR\n" + +#: config/tc-frv.c:461 +#, c-format +msgid "-mfpr-64 Mark generated file as using all 64 FPRs\n" +msgstr "-mfpr-64 Пометить сгенерированный файл как использующий все 64 FPR\n" + +#: config/tc-frv.c:462 +#, c-format +msgid "-msoft-float Mark generated file as using software FP\n" +msgstr "-msoft-float Пометить сгенерированный файл как использующий программную FP\n" + +#: config/tc-frv.c:463 +#, c-format +msgid "-mdword Mark generated file as using a 8-byte stack alignment\n" +msgstr "" +"-mdword Пометить сгенерированный файл как использующий\n" +" 8-байтовое выравнивание стека\n" + +#: config/tc-frv.c:464 +#, c-format +msgid "-mno-dword Mark generated file as using a 4-byte stack alignment\n" +msgstr "" +"-mno-dword Пометить сгенерированный файл как использующий\n" +" 4-байтовое выравнивание стека\n" + +#: config/tc-frv.c:465 +#, c-format +msgid "-mdouble Mark generated file as using double precision FP insns\n" +msgstr "" +"-mdouble Пометить сгенерированный файл как использующий\n" +" инструкции FP двойной точности\n" + +#: config/tc-frv.c:466 +#, c-format +msgid "-mmedia Mark generated file as using media insns\n" +msgstr "-mmedia Пометить сгенерированный файл как использующий медиа-инструкции\n" + +#: config/tc-frv.c:467 +#, c-format +msgid "-mmuladd Mark generated file as using multiply add/subtract insns\n" +msgstr "" +"-mmuladd Пометить сгенерированный файл как использующий\n" +" инструкции умножения, сложения/вычитания\n" + +#: config/tc-frv.c:468 +#, c-format +msgid "-mpack Allow instructions to be packed\n" +msgstr "-mpack Разрешить упаковку инструкций\n" + +#: config/tc-frv.c:469 +#, c-format +msgid "-mno-pack Do not allow instructions to be packed\n" +msgstr "-mno-pack Запретить упаковку инструкций\n" + +#: config/tc-frv.c:470 +#, c-format +msgid "-mpic Mark generated file as using small position independent code\n" +msgstr "" +"-mpic Пометить сгенерированный файл как использующий\n" +" маленький независимый от расположения код\n" + +#: config/tc-frv.c:471 +#, c-format +msgid "-mPIC Mark generated file as using large position independent code\n" +msgstr "" +"-mpic Пометить сгенерированный файл как использующий\n" +" большой независимый от расположения код\n" + +#: config/tc-frv.c:472 +#, c-format +msgid "-mlibrary-pic Mark generated file as using position independent code for libraries\n" +msgstr "" +"-mlibrary-pic Пометить сгенерированный файл как использующий\n" +" независимый от расположения код для библиотек\n" + +#: config/tc-frv.c:473 +#, c-format +msgid "-mfdpic Assemble for the FDPIC ABI\n" +msgstr "-mfdpic Ассемблировать для FDPIC ABI\n" + +#: config/tc-frv.c:474 +#, c-format +msgid "-mnopic Disable -mpic, -mPIC, -mlibrary-pic and -mfdpic\n" +msgstr "-mnopic Выключить -mpic, -mPIC, -mlibrary-pic и -mfdpic\n" + +#: config/tc-frv.c:475 +#, c-format +msgid "-mcpu={fr500|fr550|fr400|fr405|fr450|fr300|frv|simple|tomcat}\n" +msgstr "-mcpu={fr500|fr550|fr400|fr405|fr450|fr300|frv|simple|tomcat}\n" + +#: config/tc-frv.c:476 +#, c-format +msgid " Record the cpu type\n" +msgstr " Указать тип ЦП\n" + +#: config/tc-frv.c:477 +#, c-format +msgid "-mtomcat-stats Print out stats for tomcat workarounds\n" +msgstr "-mtomcat-stats Печатать статистику обходных решений tomcat\n" + +#: config/tc-frv.c:478 +#, c-format +msgid "-mtomcat-debug Debug tomcat workarounds\n" +msgstr "-mtomcat-debug Отлаживать обходные решения tomcat\n" + +#: config/tc-frv.c:1160 +msgid "VLIW packing used for -mno-pack" +msgstr "При -mno-pack используется упаковка VLIW" + +#: config/tc-frv.c:1170 +msgid "Instruction not supported by this architecture" +msgstr "Инструкция не поддерживается на этой архитектуре" + +#: config/tc-frv.c:1180 +msgid "VLIW packing constraint violation" +msgstr "Нарушение ограничение упаковки VLIW" + +#: config/tc-frv.c:1771 +#, c-format +msgid "Relocation %s is not safe for %s" +msgstr "Перемещение %s не безопасно для %s" + +#: config/tc-ft32.c:146 config/tc-moxie.c:104 +msgid "expecting register" +msgstr "ожидается регистр" + +#: config/tc-ft32.c:167 config/tc-ft32.c:183 config/tc-moxie.c:123 +#: config/tc-moxie.c:139 +msgid "illegal register number" +msgstr "недопустимый номер регистра" + +#: config/tc-ft32.c:239 config/tc-moxie.c:188 config/tc-pj.c:260 +#, c-format +msgid "unknown opcode %s" +msgstr "неизвестный код операции %s" + +#: config/tc-ft32.c:264 +#, c-format +msgid "unknown width specifier '.%c'" +msgstr "неизвестный определитель ширины «.%c»" + +#: config/tc-ft32.c:387 +msgid "internal error in argument parsing" +msgstr "внутренняя ошибка при обработке аргументов" + +#: config/tc-ft32.c:400 +msgid "expected comma separator" +msgstr "ожидается разделитель запятая" + +#: config/tc-ft32.c:412 config/tc-moxie.c:232 config/tc-moxie.c:292 +#: config/tc-moxie.c:304 config/tc-moxie.c:337 config/tc-moxie.c:369 +#: config/tc-moxie.c:402 config/tc-moxie.c:456 config/tc-moxie.c:510 +#: config/tc-moxie.c:520 config/tc-moxie.c:543 config/tc-moxie.c:556 +#: config/tc-pj.c:308 +msgid "extra stuff on line ignored" +msgstr "лишнее содержимое в строке игнорируется" + +#: config/tc-ft32.c:472 config/tc-lm32.c:236 config/tc-moxie.c:587 +#: config/tc-nios2.c:284 +msgid "bad call to md_atof" +msgstr "неправильный вызов md_atof" + +#: config/tc-ft32.c:522 +#, c-format +msgid "FT32 options:\n" +msgstr "Параметры FT32:\n" + +#: config/tc-ft32.c:523 +#, c-format +msgid "" +"\n" +"-no-relax\t\tdon't relax relocations\n" +"\t\t\t\n" +msgstr "" +"\n" +"-no-relax\t\tне ослаблять перемещения\n" +"\t\t\t\n" + +#. These macros must be defined, but is will be a fatal assembler +#. error if we ever hit them. +#: config/tc-ft32.h:35 config/tc-pj.h:40 +msgid "estimate size\n" +msgstr "оценочный размер\n" + +#: config/tc-ft32.h:36 config/tc-pj.h:39 +msgid "convert_frag\n" +msgstr "convert_frag\n" + +#: config/tc-h8300.c:178 +#, c-format +msgid "new section '%s' defined without attributes - this might cause problems" +msgstr "новый раздел «%s» определён без атрибутов — это может вызвать проблемы" + +#: config/tc-h8300.c:448 config/tc-h8300.c:456 +msgid "Reg not valid for H8/300" +msgstr "Регистр для H8/300 не корректен" + +#: config/tc-h8300.c:537 +msgid "invalid operand size requested" +msgstr "запрошен некорректный размер операнда" + +#: config/tc-h8300.c:642 +msgid "Invalid register list for ldm/stm\n" +msgstr "Некорректный список регистров для ldm/stm\n" + +#: config/tc-h8300.c:668 config/tc-h8300.c:673 config/tc-h8300.c:680 +msgid "mismatch between register and suffix" +msgstr "несоответствие регистра и суффикса" + +#: config/tc-h8300.c:685 +msgid "invalid suffix after register." +msgstr "некорректный суффикс после регистра" + +#: config/tc-h8300.c:707 +msgid "address too high for vector table jmp/jsr" +msgstr "слишком дальний адрес для таблицы векторов jmp/jsr" + +#: config/tc-h8300.c:734 config/tc-h8300.c:846 config/tc-h8300.c:856 +msgid "Wrong size pointer register for architecture." +msgstr "Неверный регистр размера указателя для архитектуры." + +#: config/tc-h8300.c:793 config/tc-h8300.c:801 config/tc-h8300.c:830 +msgid "expected @(exp, reg16)" +msgstr "ожидается @(exp, reg16)" + +#: config/tc-h8300.c:819 +msgid "expected .L, .W or .B for register in indexed addressing mode" +msgstr "регистром ожидается .L, .W или .B для индексного режима адресации" + +#: config/tc-h8300.c:1013 +msgid "expected valid addressing mode for mova: \"@(disp, ea.sz),ERn\"" +msgstr "ожидается корректный режим адресации для mova: «@(disp, ea.sz),ERn»" + +#: config/tc-h8300.c:1031 config/tc-h8300.c:1040 +msgid "expected register" +msgstr "ожидается регистр" + +#: config/tc-h8300.c:1056 +msgid "expected closing paren" +msgstr "ожидается закрывающая скобка" + +#: config/tc-h8300.c:1115 +#, c-format +msgid "can't use high part of register in operand %d" +msgstr "нельзя использовать верхнюю часть регистра в операнде %d" + +#: config/tc-h8300.c:1272 +#, c-format +msgid "Opcode `%s' with these operand types not available in %s mode" +msgstr "Код операции «%s» с этими типами операндов недоступны в режиме %s" + +#: config/tc-h8300.c:1281 +msgid "mismatch between opcode size and operand size" +msgstr "несоответствие размера кода операции и размера операнда" + +#: config/tc-h8300.c:1317 +#, c-format +msgid "operand %s0x%lx out of range." +msgstr "операнд %s0x%lx вне диапазона" + +#: config/tc-h8300.c:1434 +msgid "Can't work out size of operand.\n" +msgstr "Невозможно получить размер операнда.\n" + +#: config/tc-h8300.c:1484 +#, c-format +msgid "Opcode `%s' with these operand types not available in H8/300 mode" +msgstr "Код операции «%s» с этими типами операндов недоступны в режиме H8/300" + +#: config/tc-h8300.c:1489 +#, c-format +msgid "Opcode `%s' with these operand types not available in H8/300H mode" +msgstr "Код операции «%s» с этими типами операндов недоступны в режиме H8/300H" + +#: config/tc-h8300.c:1495 +#, c-format +msgid "Opcode `%s' with these operand types not available in H8/300S mode" +msgstr "Код операции «%s» с этими типами операндов недоступны в режиме H8/300S" + +#: config/tc-h8300.c:1556 config/tc-h8300.c:1576 +msgid "Need #1 or #2 here" +msgstr "Здесь нужен #1 или #2" + +#: config/tc-h8300.c:1571 +msgid "#4 not valid on H8/300." +msgstr "#4 некорректен на H8/300." + +#: config/tc-h8300.c:1686 config/tc-h8300.c:1768 +#, c-format +msgid "branch operand has odd offset (%lx)\n" +msgstr "операнд ветвления имеет нечётное число (%lx)\n" + +#: config/tc-h8300.c:1806 +msgid "destination operand must be 16 bit register" +msgstr "операнд назначения должен быть 16-битным регистром" + +#: config/tc-h8300.c:1815 +msgid "source operand must be 8 bit register" +msgstr "операнд-источник должен быть 8-битным регистром" + +#: config/tc-h8300.c:1823 +msgid "destination operand must be 16bit absolute address" +msgstr "операнд назначения должен быть 16-битным абсолютным адресом" + +#: config/tc-h8300.c:1830 +msgid "destination operand must be 8 bit register" +msgstr "операнд назначения должен быть 8-битным регистром" + +#: config/tc-h8300.c:1838 +msgid "source operand must be 16bit absolute address" +msgstr "операнд-источник должен быть 16-битным абсолютным адресом" + +#. This seems more sane than saying "too many operands". We'll +#. get here only if the trailing trash starts with a comma. +#: config/tc-h8300.c:1846 config/tc-mips.c:14027 config/tc-mips.c:14095 +#: config/tc-mmix.c:479 config/tc-mmix.c:491 config/tc-mmix.c:2533 +#: config/tc-mmix.c:2557 config/tc-mmix.c:2830 +msgid "invalid operands" +msgstr "неверные операнды" + +#: config/tc-h8300.c:1877 +msgid "operand/size mis-match" +msgstr "несоответствие операнд/размер" + +#: config/tc-h8300.c:1977 config/tc-sh.c:2972 config/tc-sh64.c:2796 +#: config/tc-z8k.c:1233 +msgid "unknown opcode" +msgstr "неизвестный код операции" + +#: config/tc-h8300.c:2010 +msgid "invalid operand in ldm" +msgstr "некорректный операнд в ldm" + +#: config/tc-h8300.c:2019 +msgid "invalid operand in stm" +msgstr "некорректный операнд в stm" + +#: config/tc-h8300.c:2218 +#, c-format +msgid "Invalid argument to --mach option: %s" +msgstr "Неверный аргумент параметра --mach: %s" + +#: config/tc-h8300.c:2229 +#, c-format +msgid " H8300-specific assembler options:\n" +msgstr " Специализированные параметры ассемблера для H8300:\n" + +#: config/tc-h8300.c:2230 +#, c-format +msgid "" +" -mach= Set the H8300 machine type to one of:\n" +" h8300h, h8300hn, h8300s, h8300sn, h8300sx, h8300sxn\n" +msgstr "" +" -mach=<имя> Задать тип машины H8300:\n" +" h8300h, h8300hn, h8300s, h8300sn, h8300sx, h8300sxn\n" + +#: config/tc-h8300.c:2233 +#, c-format +msgid " -h-tick-hex Support H'00 style hex constants\n" +msgstr " -h-tick-hex Разрешить шестнадцатеричные константы в формате H'00\n" + +#: config/tc-h8300.c:2242 +#, c-format +msgid "call to tc_aout_fix_to_chars \n" +msgstr "вызов tc_aout_fix_to_chars \n" + +#: config/tc-h8300.c:2251 config/tc-xc16x.c:347 +#, c-format +msgid "call to md_convert_frag \n" +msgstr "вызов md_convert_frag \n" + +#: config/tc-h8300.c:2302 config/tc-xc16x.c:251 +#, c-format +msgid "call to md_estimate_size_before_relax \n" +msgstr "вызов md_estimate_size_before_relax \n" + +#: config/tc-h8300.c:2317 +msgid "Unexpected reference to a symbol in a non-code section" +msgstr "Неожиданная ссылка на символ в не кодовом разделе" + +#: config/tc-h8300.c:2333 config/tc-xc16x.c:292 +msgid "Difference of symbols in different sections is not supported" +msgstr "Различие символов в разных разделах не поддерживается" + +#: config/tc-h8300.c:2355 config/tc-mcore.c:2204 config/tc-microblaze.c:2458 +#: config/tc-pj.c:491 config/tc-sh.c:4480 config/tc-tic6x.c:4520 +#: config/tc-xc16x.c:315 +#, c-format +msgid "Cannot represent relocation type %s" +msgstr "Не удалось представить тип перемещения %s" + +#. Simple range checking for FIELD against HIGH and LOW bounds. +#. IGNORE is used to suppress the error message. +#. Variant of CHECK_FIELD for use in md_apply_fix and other places where +#. the current file and line number are not valid. +#: config/tc-hppa.c:1027 config/tc-hppa.c:1041 +#, c-format +msgid "Field out of range [%d..%d] (%d)." +msgstr "Поле вне допустимого диапазона [%d..%d] (%d)." + +#. Simple alignment checking for FIELD against ALIGN (a power of two). +#. IGNORE is used to suppress the error message. +#: config/tc-hppa.c:1055 +#, c-format +msgid "Field not properly aligned [%d] (%d)." +msgstr "Поле неправильно выравнено [%d] (%d)." + +#: config/tc-hppa.c:1108 +msgid "Missing .exit\n" +msgstr "Отсутствует .exit\n" + +#: config/tc-hppa.c:1111 +msgid "Missing .procend\n" +msgstr "Отсутствует .procend\n" + +#: config/tc-hppa.c:1264 +#, c-format +msgid "Invalid field selector. Assuming F%%." +msgstr "Недопустимый селектор поля. Предполагается F%%." + +#: config/tc-hppa.c:1288 +msgid "Bad segment in expression." +msgstr "Неправильный сегмент в выражении." + +#: config/tc-hppa.c:1313 +#, c-format +msgid "Invalid Nullification: (%c)" +msgstr "Неверное обнуление: (%c)" + +#: config/tc-hppa.c:1384 +msgid "Cannot handle fixup" +msgstr "Не удалось обработать местоположение" + +#: config/tc-hppa.c:1682 +#, c-format +msgid " -Q ignored\n" +msgstr " -Q игнорировать\n" + +#: config/tc-hppa.c:1686 +#, c-format +msgid " -c print a warning if a comment is found\n" +msgstr " -c печатать предупреждение, если найден комментарий\n" + +#: config/tc-hppa.c:1752 +#, c-format +msgid "no hppa_fixup entry for fixup type 0x%x" +msgstr "нет элемента hppa_fixup для типа местоположения 0x%x" + +#: config/tc-hppa.c:1931 +msgid "Unknown relocation encountered in md_apply_fix." +msgstr "В md_apply_fix обнаружено неизвестное перемещение." + +#: config/tc-hppa.c:2119 config/tc-hppa.c:2144 +#, c-format +msgid "Undefined register: '%s'." +msgstr "Неопределенный регистр: «%s»." + +#: config/tc-hppa.c:2178 +#, c-format +msgid "Non-absolute symbol: '%s'." +msgstr "Не абсолютный символ: %s»." + +#: config/tc-hppa.c:2193 +#, c-format +msgid "Undefined absolute constant: '%s'." +msgstr "Неопределённая абсолютная константа: «%s»." + +#: config/tc-hppa.c:2224 config/tc-hppa.c:5692 +msgid "could not update architecture and machine" +msgstr "невозможно обновить архитектуру и машину" + +#: config/tc-hppa.c:2262 +#, c-format +msgid "Invalid FP Compare Condition: %s" +msgstr "Неправильное условие сравнения FP: %s" + +#: config/tc-hppa.c:2317 +#, c-format +msgid "Invalid FTEST completer: %s" +msgstr "Неверный завершитель FTEST: %s" + +#: config/tc-hppa.c:2383 config/tc-hppa.c:2420 +#, c-format +msgid "Invalid FP Operand Format: %3s" +msgstr "Некорректный формат операнда FP: %3s" + +#: config/tc-hppa.c:2525 +msgid "Bad segment (should be absolute)." +msgstr "Неверный сегмент (должен быть абсолютным)." + +#: config/tc-hppa.c:2585 +#, c-format +msgid "Invalid argument location: %s\n" +msgstr "Неверное расположение сегмента: %s\n" + +#: config/tc-hppa.c:2614 +#, c-format +msgid "Invalid argument description: %d" +msgstr "Неверное описание аргумента: %d" + +#: config/tc-hppa.c:3443 +msgid "Invalid Indexed Load Completer." +msgstr "Неверный индексный завершитель загрузки." + +#: config/tc-hppa.c:3448 +msgid "Invalid Indexed Load Completer Syntax." +msgstr "Неверный синтаксис индексного завершителя загрузки." + +#: config/tc-hppa.c:3482 +msgid "Invalid Short Load/Store Completer." +msgstr "Неверный завершитель короткой загрузки/сохранения." + +#: config/tc-hppa.c:3543 config/tc-hppa.c:3548 +msgid "Invalid Store Bytes Short Completer" +msgstr "Неверный завершитель короткой сохранения байтов" + +#: config/tc-hppa.c:3863 config/tc-hppa.c:3869 +msgid "Invalid left/right combination completer" +msgstr "Неправильная комбинация левого/правого завершителя" + +#: config/tc-hppa.c:3918 config/tc-hppa.c:3925 +msgid "Invalid permutation completer" +msgstr "Неверный завершитель перестановки" + +#: config/tc-hppa.c:4025 +#, c-format +msgid "Invalid Add Condition: %s" +msgstr "Неправильное условие добавления %s" + +#: config/tc-hppa.c:4041 config/tc-hppa.c:4051 +msgid "Invalid Add and Branch Condition" +msgstr "Неправильное условие добавления и ветвления" + +#: config/tc-hppa.c:4072 config/tc-hppa.c:4217 +msgid "Invalid Compare/Subtract Condition" +msgstr "Неправильное условие сравнения/вычитания" + +#: config/tc-hppa.c:4112 +#, c-format +msgid "Invalid Branch On Bit Condition: %c" +msgstr "Неправильное условие ветвления при бите: %c" + +#: config/tc-hppa.c:4115 +msgid "Missing Branch On Bit Condition" +msgstr "Отсутствует условие ветвления при бите" + +#: config/tc-hppa.c:4200 +#, c-format +msgid "Invalid Compare/Subtract Condition: %s" +msgstr "Неправильное условие сравнения/вычитания: %s" + +#: config/tc-hppa.c:4232 +msgid "Invalid Compare and Branch Condition" +msgstr "Неправильное условие сравнения и ветвления" + +#: config/tc-hppa.c:4328 +msgid "Invalid Logical Instruction Condition." +msgstr "Неправильное условие логической инструкции." + +#: config/tc-hppa.c:4390 +msgid "Invalid Shift/Extract/Deposit Condition." +msgstr "Неправильные условия сдвига/извлечения/размещения." + +#: config/tc-hppa.c:4507 +msgid "Invalid Unit Instruction Condition." +msgstr "Неправильное условие инструкции блока." + +#: config/tc-hppa.c:4986 config/tc-hppa.c:5018 config/tc-hppa.c:5049 +#: config/tc-hppa.c:5079 +msgid "Branch to unaligned address" +msgstr "Ветвление по не выровненному адресу" + +#: config/tc-hppa.c:5261 +msgid "Invalid SFU identifier" +msgstr "Неверный идентификатор SFU" + +#: config/tc-hppa.c:5311 +msgid "Invalid COPR identifier" +msgstr "Неверный идентификатор COPR" + +#: config/tc-hppa.c:5441 +msgid "Invalid Floating Point Operand Format." +msgstr "Некорректный формат операнда c плавающей точкой." + +#: config/tc-hppa.c:5561 config/tc-hppa.c:5581 config/tc-hppa.c:5601 +#: config/tc-hppa.c:5621 config/tc-hppa.c:5641 +msgid "Invalid register for single precision fmpyadd or fmpysub" +msgstr "Некорректный регистр с одинарной точностью для fmpyadd или fmpysub" -#: config/tc-arm.c:22198 +#: config/tc-hppa.c:5709 #, c-format -msgid "unknown implicit IT mode `%s', should be arm, thumb, always, or never." -msgstr "" +msgid "Invalid operands %s" +msgstr "Неверные операнды %s" -#: config/tc-arm.c:22208 -msgid "\t assemble for CPU " -msgstr "" +#: config/tc-hppa.c:5719 +#, c-format +msgid "Immediates %d and %d will give undefined behavior." +msgstr "Непосредственные значения %d и %d вызовут непредсказуемое поведение." -#: config/tc-arm.c:22210 -msgid "\t assemble for architecture " -msgstr "" +#: config/tc-hppa.c:5771 config/tc-hppa.c:6954 config/tc-hppa.c:7009 +msgid "Missing function name for .PROC (corrupted label chain)" +msgstr "Отсутствует имя функции у .PROC (повреждена цепочка меток)" -#: config/tc-arm.c:22212 -msgid "\t assemble for FPU architecture " -msgstr "" +#: config/tc-hppa.c:5774 config/tc-hppa.c:7012 +msgid "Missing function name for .PROC" +msgstr "Отсутствует имя функции у .PROC" -#: config/tc-arm.c:22214 -msgid "\t assemble for floating point ABI " -msgstr "" +#: config/tc-hppa.c:5833 +msgid "Argument to .BLOCK/.BLOCKZ must be between 0 and 0x3fffffff" +msgstr "Аргумент .BLOCK/.BLOCKZ должен быть от 0 до 0x3fffffff" -#: config/tc-arm.c:22217 -msgid "\t\t assemble for eabi version " -msgstr "" +#: config/tc-hppa.c:5924 +#, c-format +msgid "Invalid .CALL argument: %s" +msgstr "Неверный аргумент .CALL: %s" -#: config/tc-arm.c:22220 -msgid "\t controls implicit insertion of IT instructions" -msgstr "" +#: config/tc-hppa.c:6069 +msgid ".callinfo is not within a procedure definition" +msgstr ".callinfo за пределами определения процедуры" -#: config/tc-arm.c:22264 config/tc-arm.c:22282 config/tc-arm.c:22302 +#: config/tc-hppa.c:6087 #, c-format -msgid "option `-%c%s' is deprecated: %s" -msgstr "" +msgid "FRAME parameter must be a multiple of 8: %d\n" +msgstr "Параметр FRAME должен быт кратен 8: %d\n" + +#: config/tc-hppa.c:6104 +msgid "Value for ENTRY_GR must be in the range 3..18\n" +msgstr "Значение ENTRY_GR должно быть в диапазоне 3..18\n" + +#: config/tc-hppa.c:6115 +msgid "Value for ENTRY_FR must be in the range 12..21\n" +msgstr "Значение ENTRY_FR должно быть в диапазоне 12..21\n" + +#: config/tc-hppa.c:6124 +msgid "Value for ENTRY_SR must be 3\n" +msgstr "Значение ENTRY_SR должно быть равно 3\n" -#: config/tc-arm.c:22322 +#: config/tc-hppa.c:6173 #, c-format -msgid " ARM-specific assembler options:\n" -msgstr "" +msgid "Invalid .CALLINFO argument: %s" +msgstr "Неверный аргумент .CALLINFO: %s" + +#: config/tc-hppa.c:6284 +msgid "The .ENTER pseudo-op is not supported" +msgstr "Псевдооперация .ENTER не поддерживается" + +#: config/tc-hppa.c:6300 +msgid "Misplaced .entry. Ignored." +msgstr "Неверное размещение .entry. Игнорируется." + +#: config/tc-hppa.c:6304 +msgid "Missing .callinfo." +msgstr "Отсутствует .callinfo." + +#: config/tc-hppa.c:6368 +msgid ".REG expression must be a register" +msgstr "Выражение .REG должно быть регистром" + +#: config/tc-hppa.c:6384 +msgid "bad or irreducible absolute expression; zero assumed" +msgstr "плохое или неприводимое абсолютное выражение; предполагается ноль" -#: config/tc-arm.c:22333 +#: config/tc-hppa.c:6395 +msgid ".REG must use a label" +msgstr "Значение .REG должно быть меткой" + +#: config/tc-hppa.c:6397 +msgid ".EQU must use a label" +msgstr "Значение .EQU должно быть меткой" + +#: config/tc-hppa.c:6453 #, c-format -msgid " -EB assemble code for a big-endian cpu\n" -msgstr "" +msgid "Symbol '%s' could not be created." +msgstr "Символ «%s» не может быть создан." + +#: config/tc-hppa.c:6503 +msgid ".EXIT must appear within a procedure" +msgstr ".EXIT должен быть внутри процедуры" + +#: config/tc-hppa.c:6507 +msgid "Missing .callinfo" +msgstr "Отсутствует .callinfo" + +#: config/tc-hppa.c:6511 +msgid "No .ENTRY for this .EXIT" +msgstr "Отсутствует .ENTRY для этого .EXIT" -#: config/tc-arm.c:22338 +#: config/tc-hppa.c:6551 #, c-format -msgid " -EL assemble code for a little-endian cpu\n" -msgstr "" +msgid "Using ENTRY rather than CODE in export directive for %s" +msgstr "Используется ENTRY вместо CODE в директиве экспорта для %s" -#: config/tc-arm.c:22342 +#: config/tc-hppa.c:6670 #, c-format -msgid " --fix-v4bx Allow BX in ARMv4 code\n" -msgstr "" +msgid "Undefined .EXPORT/.IMPORT argument (ignored): %s" +msgstr "Не определён аргумент для .EXPORT/.IMPORT (игнорируется): %s" -#: config/tc-avr.c:314 +#: config/tc-hppa.c:6693 #, c-format -msgid "Known MCU names:" -msgstr "" +msgid "Cannot define export symbol: %s\n" +msgstr "Невозможно определить экспортируемый символ: %s\n" + +#: config/tc-hppa.c:6784 +msgid "Missing label name on .LABEL" +msgstr "Отсутствует имя метки в .LABEL" -#: config/tc-avr.c:380 +#: config/tc-hppa.c:6789 +msgid "extra .LABEL arguments ignored." +msgstr "избыточные аргументы в .LABEL игнорируются" + +#: config/tc-hppa.c:6805 +msgid "The .LEAVE pseudo-op is not supported" +msgstr "Псевдооперация .LEAVE не поддерживается" + +#: config/tc-hppa.c:6843 +msgid "Unrecognized .LEVEL argument\n" +msgstr "Нераспознанный аргумент .LEVEL\n" + +#: config/tc-hppa.c:6876 #, c-format -msgid "" -"AVR options:\n" -" -mmcu=[avr-name] select microcontroller variant\n" -" [avr-name] can be:\n" -" avr1 - classic AVR core without data RAM\n" -" avr2 - classic AVR core with up to 8K program memory\n" -" avr25 - classic AVR core with up to 8K program memory\n" -" plus the MOVW instruction\n" -" avr3 - classic AVR core with up to 64K program memory\n" -" avr31 - classic AVR core with up to 128K program memory\n" -" avr35 - classic AVR core with up to 64K program memory\n" -" plus the MOVW instruction\n" -" avr4 - enhanced AVR core with up to 8K program memory\n" -" avr5 - enhanced AVR core with up to 64K program memory\n" -" avr51 - enhanced AVR core with up to 128K program memory\n" -" avr6 - enhanced AVR core with up to 256K program memory\n" -" or immediate microcontroller name.\n" -msgstr "" +msgid "Cannot define static symbol: %s\n" +msgstr "Невозможно определить статический символ: %s\n" + +#: config/tc-hppa.c:6908 +msgid "Nested procedures" +msgstr "Вложенные процедуры" + +#: config/tc-hppa.c:6918 +msgid "Cannot allocate unwind descriptor\n" +msgstr "Невозможно выделить раскрываемый дескриптор\n" + +#: config/tc-hppa.c:7016 +msgid "misplaced .procend" +msgstr "здесь не должно быть .procend" + +#: config/tc-hppa.c:7019 +msgid "Missing .callinfo for this procedure" +msgstr "Для этой процедуры отсутствует .callinfo" + +#: config/tc-hppa.c:7022 +msgid "Missing .EXIT for a .ENTRY" +msgstr "Отсутствует .EXIT для .ENTRY" + +#: config/tc-hppa.c:7059 +msgid "Not in a space.\n" +msgstr "Вне пространства.\n" + +#: config/tc-hppa.c:7062 +msgid "Not in a subspace.\n" +msgstr "Вне подпространства.\n" + +#: config/tc-hppa.c:7150 +msgid "Invalid .SPACE argument" +msgstr "Неверный аргумент .SPACE" + +#: config/tc-hppa.c:7196 +msgid "Can't change spaces within a procedure definition. Ignored" +msgstr "Невозможно изменить пространства внутри определения процедуры. Игнорируется." + +#: config/tc-hppa.c:7321 +#, c-format +msgid "Undefined space: '%s' Assuming space number = 0." +msgstr "Неопределённое пространство: «%s». Предполагаем номер пространства = 0." + +#: config/tc-hppa.c:7344 +msgid "Must be in a space before changing or declaring subspaces.\n" +msgstr "Перед изменением или объявлением подпространств нужно войти в пространство.\n" + +#: config/tc-hppa.c:7348 +msgid "Can't change subspaces within a procedure definition. Ignored" +msgstr "Невозможно изменить подпространства внутри определения процедуры. Игнорируется." + +#: config/tc-hppa.c:7382 +msgid "Parameters of an existing subspace can't be modified" +msgstr "Параметры существующего подпространства изменить нельзя" + +#: config/tc-hppa.c:7433 +msgid "Alignment must be a power of 2" +msgstr "Выравнивание должно быть степенью двойки" + +#: config/tc-hppa.c:7480 +msgid "FIRST not supported as a .SUBSPACE argument" +msgstr "FIRST не поддерживается как аргумент .SUBSPACE" + +#: config/tc-hppa.c:7482 +msgid "Invalid .SUBSPACE argument" +msgstr "Неверный аргумент .SUBSPACE" + +#: config/tc-hppa.c:7672 +#, c-format +msgid "Internal error: Unable to find containing space for %s." +msgstr "Внутренняя ошибка: невозможно найти содержащее пространство для %s." + +#: config/tc-hppa.c:8234 +msgid "-R option not supported on this target." +msgstr "Параметр -R не поддерживается для этой цели." + +#: config/tc-hppa.c:8251 config/tc-sparc.c:1019 config/tc-sparc.c:1056 +#, c-format +msgid "Internal error: can't hash `%s': %s\n" +msgstr "Внутренняя ошибка: невозможно получить хеш «%s»: %s\n" + +#: config/tc-hppa.c:8260 config/tc-i860.c:235 +#, c-format +msgid "internal error: losing opcode: `%s' \"%s\"\n" +msgstr "внутренняя ошибка: потерян код операции: «%s» \"%s\"\n" + +#: config/tc-i370.c:418 config/tc-ppc.c:1278 config/tc-s390.c:432 +#: config/tc-s390.c:439 +#, c-format +msgid "invalid switch -m%s" +msgstr "некорректный переключатель -m%s" + +#: config/tc-i370.c:515 config/tc-s390.c:538 +#, c-format +msgid "Internal assembler error for instruction %s" +msgstr "внутренняя ошибка ассемблера для инструкции %s" + +#: config/tc-i370.c:534 +#, c-format +msgid "Internal assembler error for macro %s" +msgstr "внутренняя ошибка ассемблера для макроса %s" + +#: config/tc-i370.c:629 config/tc-ppc.c:2129 +msgid "identifier+constant@got means identifier@got+constant" +msgstr "identifier+constant@got означает identifier@got+constant" + +#: config/tc-i370.c:683 config/tc-m68k.c:8071 read.c:4572 +#, c-format +msgid "%s relocations do not fit in %u byte" +msgid_plural "%s relocations do not fit in %u bytes" +msgstr[0] "перемещения %s не помещаются в %u байт" +msgstr[1] "перемещения %s не помещаются в %u байта" +msgstr[2] "перемещения %s не помещаются в %u байт" + +#: config/tc-i370.c:927 config/tc-i370.c:968 +msgid "unsupported DC type" +msgstr "неподдерживаемый тип DC" + +#: config/tc-i370.c:939 config/tc-i370.c:949 config/tc-i370.c:1531 +#: config/tc-i370.c:1542 +msgid "missing end-quote" +msgstr "отсутствует закрывающая кавычка" + +#: config/tc-i370.c:998 +msgid "unsupported alignment" +msgstr "неподдерживаемое выравнивание" + +#: config/tc-i370.c:1005 +msgid "this DS form not yet supported" +msgstr "данная форма DS пока не поддерживается" + +#: config/tc-i370.c:1047 config/tc-m32r.c:1488 config/tc-microblaze.c:192 +msgid "Expected comma after symbol-name: rest of line ignored." +msgstr "Ожидается запятая после имени символа: остаток строки игнорируется." + +#: config/tc-i370.c:1070 config/tc-m32r.c:1512 config/tc-microblaze.c:214 +#: config/tc-ppc.c:2289 config/tc-ppc.c:3808 config/tc-ppc.c:3850 +#: config/tc-ppc.c:5410 +msgid "ignoring bad alignment" +msgstr "игнорируется плохой аргумент" + +#: config/tc-i370.c:1081 config/tc-m32r.c:1539 config/tc-microblaze.c:225 +#, c-format +msgid "Ignoring attempt to re-define symbol `%s'." +msgstr "Игнорируется попытка переопределения символа «%s»." + +#: config/tc-i370.c:1089 config/tc-microblaze.c:233 +#, c-format +msgid "Length of .lcomm \"%s\" is already %ld. Not changed to %ld." +msgstr "Длина .lcomm \"%s\" уже равна %ld. Не изменяется на %ld." + +#: config/tc-i370.c:1108 config/tc-m32r.c:1524 config/tc-microblaze.c:249 +#: config/tc-v850.c:383 +msgid "Common alignment not a power of 2" +msgstr "Общее выравнивание не кратно степени 2" + +#: config/tc-i370.c:1246 +msgid "Missing or bad .using directive" +msgstr "Отсутствует или неверная директива .using" + +#: config/tc-i370.c:1291 +msgid "Literal Pool Overflow" +msgstr "переполнение пула литералов" + +#: config/tc-i370.c:1589 +msgid "expression not a constant" +msgstr "выражение должно быть константой" + +#: config/tc-i370.c:1596 +msgid "Unknown/unsupported address literal type" +msgstr "Неизвестный/неподдерживаемый литеральный тип адреса" + +#: config/tc-i370.c:1619 +#, c-format +msgid ".ltorg without prior .using in section %s" +msgstr ".ltorg без предшествующей .using в разделе %s" + +#: config/tc-i370.c:1623 +#, c-format +msgid ".ltorg in section %s paired to .using in section %s" +msgstr ".ltorg в разделе %s соединён с .using в разделе %s" + +#: config/tc-i370.c:1646 +#, c-format +msgid "bad alignment of %d bytes in literal pool" +msgstr "неверное выравнивание в %d байт в пуле литералов" + +#: config/tc-i370.c:1670 +msgid "bad literal size\n" +msgstr "некорректный размер литерала\n" + +#: config/tc-i370.c:1744 +msgid ".using: base address expression illegal or too complex" +msgstr ".using: выражение базового адреса неверно или слишком сложное" + +#: config/tc-i370.c:1779 config/tc-i370.c:1788 +#, c-format +msgid "dropping register %d in section %s does not match using register %d" +msgstr "сброшенный регистр %d в разделе %s не совпадает с использующимся регистром %d" + +#: config/tc-i370.c:1792 +#, c-format +msgid "dropping register %d in section %s previously used in section %s" +msgstr "сброшенный регистр %d в разделе %s раньше использовался в разделе %s" + +#: config/tc-i370.c:1848 config/tc-ppc.c:3630 +msgid "wrong number of operands" +msgstr "неправильное количество операндов" + +#: config/tc-i370.c:1930 config/tc-mn10200.c:896 config/tc-mn10300.c:1253 +#: config/tc-s390.c:1684 config/tc-v850.c:2328 +#, c-format +msgid "Unrecognized opcode: `%s'" +msgstr "Нераспознанный код операции: «%s»" + +#: config/tc-i370.c:2073 +msgid "not using any base register" +msgstr "не используется какой-либо базовый регистр" + +#: config/tc-i370.c:2103 +#, c-format +msgid "expecting a register for operand %d" +msgstr "ожидается регистр для операнда %d" + +#. xgettext:c-format. +#: config/tc-i370.c:2209 config/tc-mn10200.c:1139 config/tc-mn10300.c:1821 +#: config/tc-ppc.c:3486 config/tc-s390.c:1597 config/tc-v850.c:3043 +#, c-format +msgid "junk at end of line: `%s'" +msgstr "мусор в конце строки: «%s»" + +#. Not used --- don't have any 8 byte instructions. +#: config/tc-i370.c:2224 +msgid "Internal Error: bad instruction length" +msgstr "Внутренняя ошибка: некорректная длина инструкции" + +#: config/tc-i386.c:2201 +#, c-format +msgid "%s shortened to %s" +msgstr "%s укорочен до %s" + +#: config/tc-i386.c:2291 +msgid "same type of prefix used twice" +msgstr "один и тот же тип префикса используется дважды" + +#: config/tc-i386.c:2318 +#, c-format +msgid "64bit mode not supported on `%s'." +msgstr "64-битный режим не поддерживается для «%s»." + +#: config/tc-i386.c:2327 +#, c-format +msgid "32bit mode not supported on `%s'." +msgstr "32-битный режим не поддерживается для «%s»." + +#: config/tc-i386.c:2367 +msgid "bad argument to syntax directive." +msgstr "Некорректный аргумент для директивы синтаксиса." + +#: config/tc-i386.c:2430 +#, c-format +msgid "bad argument to %s_check directive." +msgstr "Некорректный аргумент для директивы %s_check." + +#: config/tc-i386.c:2434 +#, c-format +msgid "missing argument for %s_check directive" +msgstr "Отсутствует аргумент для директивы %s_check" + +#: config/tc-i386.c:2474 +#, c-format +msgid "`%s' is not supported on `%s'" +msgstr "«%s» не поддерживается для «%s»" + +#: config/tc-i386.c:2576 +#, c-format +msgid "no such architecture: `%s'" +msgstr "архитектура не существует: «%s»" + +#: config/tc-i386.c:2581 +msgid "missing cpu architecture" +msgstr "отсутствует ЦП архитектуры" + +#: config/tc-i386.c:2598 +#, c-format +msgid "no such architecture modifier: `%s'" +msgstr "модификатор архитектуры не существует: «%s»" + +#: config/tc-i386.c:2613 config/tc-i386.c:2643 +msgid "Intel L1OM is 64bit ELF only" +msgstr "Intel L1OM поддерживает только 64-битный ELF" + +#: config/tc-i386.c:2620 config/tc-i386.c:2650 +msgid "Intel K1OM is 64bit ELF only" +msgstr "Intel K1OM поддерживает только 64-битный ELF" + +#: config/tc-i386.c:2627 config/tc-i386.c:2664 +msgid "Intel MCU is 32bit ELF only" +msgstr "Intel MCU поддерживает только 32-битный ELF" + +#: config/tc-i386.c:2671 config/tc-i386.c:10616 +msgid "unknown architecture" +msgstr "неизвестная архитектура" -#: config/tc-avr.c:397 +#: config/tc-i386.c:2708 config/tc-i386.c:2730 #, c-format -msgid "" -" -mall-opcodes accept all AVR opcodes, even if not supported by MCU\n" -" -mno-skip-bug disable warnings for skipping two-word instructions\n" -" (default for avr4, avr5)\n" -" -mno-wrap reject rjmp/rcall instructions with 8K wrap-around\n" -" (default for avr3, avr5)\n" -msgstr "" +msgid "can't hash %s: %s" +msgstr "невозможно получить хеш «%s»: %s" + +#: config/tc-i386.c:3023 +msgid "there are no pc-relative size relocations" +msgstr "нет размера перемещений, относительных pc" -#: config/tc-avr.c:441 config/tc-msp430.c:744 +#: config/tc-i386.c:3035 #, c-format -msgid "unknown MCU: %s\n" -msgstr "" +msgid "unknown relocation (%u)" +msgstr "неизвестное перемещение (%u)" -#: config/tc-avr.c:450 +#: config/tc-i386.c:3037 #, c-format -msgid "redefinition of mcu type `%s' to `%s'" -msgstr "" +msgid "%u-byte relocation cannot be applied to %u-byte field" +msgstr "%u-байтовое перемещение нельзя применить к %u-байтовому полю" -#: config/tc-avr.c:528 -msgid "constant value required" -msgstr "" +#: config/tc-i386.c:3041 +msgid "non-pc-relative relocation for pc-relative field" +msgstr "перемещение, не относительное pc для pc-относительного поля" + +#: config/tc-i386.c:3046 +msgid "relocated field and relocation type differ in signedness" +msgstr "перемещаемое поле и тип перемещения отличаются знаком" + +#: config/tc-i386.c:3055 +msgid "there are no unsigned pc-relative relocations" +msgstr "нет безнаковых перемещений, относительных pc" -#: config/tc-avr.c:531 +#: config/tc-i386.c:3063 #, c-format -msgid "number must be positive and less than %d" -msgstr "" +msgid "cannot do %u byte pc-relative relocation" +msgstr "невозможно выполнить %u-байтовое перемещение, относительное pc" -#: config/tc-avr.c:557 config/tc-avr.c:694 +#: config/tc-i386.c:3080 #, c-format -msgid "constant out of 8-bit range: %d" -msgstr "" +msgid "cannot do %s %u byte relocation" +msgstr "невозможно выполнить %s %u-байтовое перемещение" -#: config/tc-avr.c:625 config/tc-score.c:1200 read.c:3615 -msgid "illegal expression" -msgstr "" +#: config/tc-i386.c:3549 config/tc-i386.c:3576 +#, c-format +msgid "can't use register '%s%s' as operand %d in '%s'." +msgstr "Нельзя использовать регистр «%s%s» как операнд %d в «%s»." -#: config/tc-avr.c:654 config/tc-avr.c:1421 -msgid "`)' required" -msgstr "" +#: config/tc-i386.c:3616 config/tc-i386.c:3756 +#, c-format +msgid "invalid instruction `%s' after `%s'" +msgstr "неверная инструкция «%s» после «%s»" -#: config/tc-avr.c:749 -msgid "register r16-r23 required" -msgstr "" +#: config/tc-i386.c:3622 +#, c-format +msgid "missing `lock' with `%s'" +msgstr "отсутствует «lock» с «%s»" -#: config/tc-avr.c:755 -msgid "register number above 15 required" -msgstr "" +#: config/tc-i386.c:3629 +#, c-format +msgid "instruction `%s' after `xacquire' not allowed" +msgstr "инструкция «%s» после «xacquire» не допускается" -#: config/tc-avr.c:761 -msgid "even register number required" -msgstr "" +#: config/tc-i386.c:3636 +#, c-format +msgid "memory destination needed for instruction `%s' after `xrelease'" +msgstr "для инструкции «%s» после «xrelease» требуется адресат в памяти" -#: config/tc-avr.c:767 -msgid "register r24, r26, r28 or r30 required" -msgstr "" +#: config/tc-i386.c:3730 +#, c-format +msgid "SSE instruction `%s' is used" +msgstr "используется инструкция SSE «%s»" -#: config/tc-avr.c:773 -msgid "register name or number from 0 to 31 required" -msgstr "" +#: config/tc-i386.c:3744 config/tc-i386.c:5581 +#, c-format +msgid "ambiguous operand size for `%s'" +msgstr "двусмысленный размер операнда для «%s»" -#: config/tc-avr.c:791 -msgid "pointer register (X, Y or Z) required" -msgstr "" +#: config/tc-i386.c:3769 +msgid "expecting lockable instruction after `lock'" +msgstr "ожидается блокируемая инструкция после «lock»" -#: config/tc-avr.c:798 -msgid "cannot both predecrement and postincrement" -msgstr "" +#: config/tc-i386.c:3779 +msgid "expecting valid branch instruction after `bnd'" +msgstr "ожидается корректный инструкция ветвления после «bnd»" -#: config/tc-avr.c:806 -msgid "addressing mode not supported" -msgstr "" +#: config/tc-i386.c:3783 +msgid "expecting indirect branch instruction after `notrack'" +msgstr "ожидается инструкция неявного ветвления после «notrack»" -#: config/tc-avr.c:812 -msgid "can't predecrement" -msgstr "" +#: config/tc-i386.c:3788 +msgid "32-bit address isn't allowed in 64-bit MPX instructions." +msgstr "32-битный адрес не допускается в 64-битных инструкциях MPX." -#: config/tc-avr.c:815 -msgid "pointer register Z required" -msgstr "" +#: config/tc-i386.c:3792 +msgid "16-bit address isn't allowed in MPX instructions" +msgstr "16-битный адрес не допускается в инструкциях MPX" -#: config/tc-avr.c:829 -msgid "postincrement not supported" -msgstr "" +#. UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc. +#: config/tc-i386.c:3847 +#, c-format +msgid "translating to `%sp'" +msgstr "преобразуется в «%sp»" -#: config/tc-avr.c:839 -msgid "pointer register (Y or Z) required" -msgstr "" +#: config/tc-i386.c:3854 +#, c-format +msgid "instruction `%s' isn't supported in 16-bit mode." +msgstr "Инструкция «%s» не поддерживается в 16-битном режиме." -#: config/tc-avr.c:943 +#: config/tc-i386.c:3914 #, c-format -msgid "unknown constraint `%c'" -msgstr "" +msgid "can't encode register '%s%s' in an instruction requiring REX prefix." +msgstr "Невозможно закодировать регистр «%s%s» в инструкцию, требующую префикс REX." -#: config/tc-avr.c:995 -msgid "`,' required" -msgstr "" +#: config/tc-i386.c:3954 config/tc-i386.c:4140 +#, c-format +msgid "no such instruction: `%s'" +msgstr "такая инструкция не существует: «%s»" -#: config/tc-avr.c:1013 -msgid "undefined combination of operands" -msgstr "" +#: config/tc-i386.c:3965 config/tc-i386.c:4173 +#, c-format +msgid "invalid character %s in mnemonic" +msgstr "недопустимый символ %s в мнемонике" -#: config/tc-avr.c:1022 -msgid "skipping two-word instruction" -msgstr "" +#: config/tc-i386.c:3972 +msgid "expecting prefix; got nothing" +msgstr "ожидается префикс; ничего не получено" -#: config/tc-avr.c:1114 config/tc-avr.c:1130 config/tc-avr.c:1244 -#: config/tc-msp430.c:1970 config/tc-msp430.c:1988 -#, c-format -msgid "odd address operand: %ld" -msgstr "" +#: config/tc-i386.c:3974 +msgid "expecting mnemonic; got nothing" +msgstr "ожидается мнемоника; ничего не получено" -#: config/tc-avr.c:1122 config/tc-avr.c:1141 config/tc-avr.c:1163 -#: config/tc-avr.c:1170 config/tc-avr.c:1177 config/tc-d10v.c:503 -#: config/tc-d30v.c:554 config/tc-msp430.c:1978 config/tc-msp430.c:1993 -#: config/tc-msp430.c:2003 +#: config/tc-i386.c:3989 config/tc-i386.c:4191 #, c-format -msgid "operand out of range: %ld" -msgstr "" +msgid "`%s' is only supported in 64-bit mode" +msgstr "«%s» поддерживается только в 64-битном режиме" -#: config/tc-avr.c:1253 config/tc-d10v.c:1585 config/tc-d30v.c:2025 -#: config/tc-msp430.c:2021 +#: config/tc-i386.c:3990 config/tc-i386.c:4190 #, c-format -msgid "line %d: unknown relocation type: 0x%x" -msgstr "" +msgid "`%s' is not supported in 64-bit mode" +msgstr "«%s» не поддерживается в 64-битном режиме" -#: config/tc-avr.c:1267 -msgid "only constant expression allowed" -msgstr "" +#: config/tc-i386.c:4002 +#, c-format +msgid "redundant %s prefix" +msgstr "лишний префикс %s" -#. xgettext:c-format. -#: config/tc-avr.c:1327 config/tc-bfin.c:811 config/tc-d10v.c:1457 -#: config/tc-d30v.c:1769 config/tc-mn10200.c:781 config/tc-mn10300.c:2171 -#: config/tc-msp430.c:2056 config/tc-or32.c:959 config/tc-ppc.c:6273 -#: config/tc-spu.c:881 config/tc-spu.c:1092 config/tc-v850.c:2187 -#: config/tc-z80.c:2017 +#: config/tc-i386.c:4197 #, c-format -msgid "reloc %d not supported by object file format" -msgstr "" +msgid "`%s' is not supported on `%s%s'" +msgstr "«%s» не поддерживается для «%s%s»" -#: config/tc-avr.c:1350 config/tc-h8300.c:1885 config/tc-mcore.c:881 -#: config/tc-microblaze.c:825 config/tc-moxie.c:178 config/tc-msp430.c:1821 -#: config/tc-pj.c:253 config/tc-sh.c:2544 config/tc-z8k.c:1216 -msgid "can't find opcode " -msgstr "" +#: config/tc-i386.c:4208 +msgid "use .code16 to ensure correct addressing mode" +msgstr "используйте .code16, чтобы задать правильный режим адресации" -#: config/tc-avr.c:1367 +#: config/tc-i386.c:4232 #, c-format -msgid "illegal opcode %s for mcu %s" -msgstr "" +msgid "invalid character %s before operand %d" +msgstr "недопустимый символ %s перед операндом %d" -#: config/tc-avr.c:1376 -msgid "garbage at end of line" -msgstr "" +#: config/tc-i386.c:4246 +#, c-format +msgid "unbalanced parenthesis in operand %d." +msgstr "несогласованные круглые скобки в операнде %d" -#: config/tc-avr.c:1448 config/tc-avr.c:1455 +#: config/tc-i386.c:4249 #, c-format -msgid "illegal %srelocation size: %d" -msgstr "" +msgid "unbalanced brackets in operand %d." +msgstr "несогласованные квадратные скобки в операнде %d" -#: config/tc-bfin.c:96 config/tc-frv.c:1606 config/tc-frv.c:1616 -msgid "missing ')'" -msgstr "" +#: config/tc-i386.c:4258 +#, c-format +msgid "invalid character %s in operand %d" +msgstr "недопустимый символ %s в операнде %d" -#: config/tc-bfin.c:423 +#: config/tc-i386.c:4285 #, c-format -msgid " BFIN specific command line options:\n" -msgstr "" +msgid "spurious operands; (%d operands/instruction max)" +msgstr "побочные операнды; (максимально %d операндов/инструкций)" -#: config/tc-bfin.c:436 -msgid "Could not set architecture and machine." -msgstr "" +#: config/tc-i386.c:4309 +msgid "expecting operand after ','; got nothing" +msgstr "ожидается операнд после «,»; ничего не получено" -#: config/tc-bfin.c:585 -msgid "Parse failed." -msgstr "" +#: config/tc-i386.c:4314 +msgid "expecting operand before ','; got nothing" +msgstr "ожидается операнд перед «,»; ничего не получено" -#: config/tc-bfin.c:660 -msgid "pcrel too far BFD_RELOC_BFIN_10" -msgstr "" +#: config/tc-i386.c:4693 +msgid "mask, index, and destination registers should be distinct" +msgstr "регистры маски, индекса и назначения должны различаться" -#: config/tc-bfin.c:676 -msgid "pcrel too far BFD_RELOC_BFIN_12" -msgstr "" +#: config/tc-i386.c:4710 +msgid "index and destination registers should be distinct" +msgstr "регистры индекса и назначения должны различаться" -#: config/tc-bfin.c:696 -msgid "pcrel too far BFD_RELOC_BFIN_24" -msgstr "" +#: config/tc-i386.c:5239 +msgid "operand size mismatch" +msgstr "несоответствие размера операнда" -#: config/tc-bfin.c:711 -msgid "pcrel too far BFD_RELOC_BFIN_5" -msgstr "" +#: config/tc-i386.c:5242 +msgid "operand type mismatch" +msgstr "несоответствие типа операнда" -#: config/tc-bfin.c:723 -msgid "pcrel too far BFD_RELOC_BFIN_11_PCREL" -msgstr "" +#: config/tc-i386.c:5245 +msgid "register type mismatch" +msgstr "несоответствие типа регистра" -#: config/tc-bfin.c:733 -msgid "rel too far BFD_RELOC_8" -msgstr "" +#: config/tc-i386.c:5248 +msgid "number of operands mismatch" +msgstr "несоответствие количества операндов" -#: config/tc-bfin.c:740 -msgid "rel too far BFD_RELOC_16" -msgstr "" +#: config/tc-i386.c:5251 +msgid "invalid instruction suffix" +msgstr "неверный суффикс инструкции" -#: config/tc-cr16.c:164 read.c:4346 -msgid "using a bit field width of zero" -msgstr "" +#: config/tc-i386.c:5254 +msgid "constant doesn't fit in 4 bits" +msgstr "константа не помещается в 4 бита" -#: config/tc-cr16.c:172 read.c:4354 -#, c-format -msgid "field width \"%s\" too complex for a bitfield" -msgstr "" +#: config/tc-i386.c:5257 +msgid "only supported with old gcc" +msgstr "поддерживается только в старом gcc" -#: config/tc-cr16.c:181 read.c:4362 -#, c-format -msgid "field width %lu too big to fit in %d bytes: truncated to %d bits" -msgstr "" +#: config/tc-i386.c:5260 +msgid "unsupported with Intel mnemonic" +msgstr "не поддерживается в мнемонике Intel" -#: config/tc-cr16.c:203 read.c:4384 -#, c-format -msgid "field value \"%s\" too complex for a bitfield" -msgstr "" +#: config/tc-i386.c:5263 +msgid "unsupported syntax" +msgstr "неподдерживаемый синтаксис" -#: config/tc-cr16.c:384 +#: config/tc-i386.c:5266 #, c-format -msgid "Unknown register pair - index relative mode: `%d'" -msgstr "" +msgid "unsupported instruction `%s'" +msgstr "неподдерживаемая инструкция «%s»" -#: config/tc-cr16.c:570 config/tc-crx.c:344 config/tc-mn10200.c:768 -#: write.c:976 -#, c-format -msgid "can't resolve `%s' {%s section} - `%s' {%s section}" -msgstr "" +#: config/tc-i386.c:5270 +msgid "invalid VSIB address" +msgstr "неправильный адрес VSIB" -#: config/tc-cr16.c:602 config/tc-crx.c:360 -#, c-format -msgid "internal error: reloc %d (`%s') not supported by object file format" -msgstr "" +#: config/tc-i386.c:5273 +msgid "mask, index, and destination registers must be distinct" +msgstr "регистры маски, индекса и назначения должны различаться" -#: config/tc-cr16.c:695 config/tc-i386.c:8187 config/tc-s390.c:1799 -msgid "GOT already in symbol table" -msgstr "" +#: config/tc-i386.c:5276 +msgid "unsupported vector index register" +msgstr "неподдерживаемый векторный индексный регистр" -#: config/tc-cr16.c:804 config/tc-cr16.c:827 config/tc-cris.c:1190 -#: config/tc-crx.c:534 config/tc-crx.c:561 config/tc-crx.c:579 -#: config/tc-pdp11.c:194 -msgid "Virtual memory exhausted" -msgstr "" +#: config/tc-i386.c:5279 +msgid "unsupported broadcast" +msgstr "неподдерживаемый broadcast" -#: config/tc-cr16.c:812 config/tc-crx.c:571 config/tc-crx.c:590 -#: config/tc-i386.c:2152 config/tc-i386.c:2174 config/tc-m68k.c:4607 -#: config/tc-maxq.c:2865 -#, c-format -msgid "Internal Error: Can't hash %s: %s" -msgstr "" +#: config/tc-i386.c:5282 +msgid "broadcast not on source memory operand" +msgstr "broadcast находится не в операнде-источнике памяти" -#: config/tc-cr16.c:838 config/tc-cris.c:1224 config/tc-crx.c:544 -#, c-format -msgid "Can't hash `%s': %s\n" -msgstr "" +#: config/tc-i386.c:5285 +msgid "broadcast is needed for operand of such type" +msgstr "для операнда такого типа требуется broadcast" -#: config/tc-cr16.c:839 config/tc-cris.c:1225 config/tc-crx.c:545 -msgid "(unknown reason)" -msgstr "" +#: config/tc-i386.c:5288 +msgid "unsupported masking" +msgstr "неподдерживаемая маска" -#. Missing or bad expr becomes absolute 0. -#: config/tc-cr16.c:891 config/tc-crx.c:618 config/tc-maxq.c:1475 -#, c-format -msgid "missing or invalid displacement expression `%s' taken as 0" -msgstr "" +#: config/tc-i386.c:5291 +msgid "mask not on destination operand" +msgstr "маске находится не в операнде назначения" -#: config/tc-cr16.c:941 -#, c-format -msgid "GOT bad expression with %s." -msgstr "" +#: config/tc-i386.c:5294 +msgid "default mask isn't allowed" +msgstr "маска по умолчанию запрещена" -#: config/tc-cr16.c:1052 -#, c-format -msgid "operand %d: illegal use expression: `%s`" -msgstr "" +#: config/tc-i386.c:5297 +msgid "unsupported static rounding/sae" +msgstr "неподдерживаемое статическое округление/sae" -#: config/tc-cr16.c:1117 config/tc-crx.c:1126 -#, c-format -msgid "Unknown register: `%d'" -msgstr "" +#: config/tc-i386.c:5301 +msgid "RC/SAE operand must precede immediate operands" +msgstr "операнд RC/SAE должен быть раньше непосредственных операндов" -#. Issue a error message when register is illegal. -#: config/tc-cr16.c:1125 config/tc-crx.c:1134 -#, c-format -msgid "Illegal register (`%s') in Instruction: `%s'" -msgstr "" +#: config/tc-i386.c:5303 +msgid "RC/SAE operand must follow immediate operands" +msgstr "операнд RC/SAE должен быть после непосредственных операндов" -#: config/tc-cr16.c:1196 config/tc-cr16.c:1271 config/tc-crx.c:756 -#: config/tc-crx.c:776 config/tc-crx.c:791 -#, c-format -msgid "Illegal register `%s' in Instruction `%s'" -msgstr "" +#: config/tc-i386.c:5306 config/tc-metag.c:4789 config/tc-metag.c:5530 +#: config/tc-metag.c:5552 +msgid "invalid register operand" +msgstr "неверный регистровый операнд" -#: config/tc-cr16.c:1224 config/tc-cr16.c:1235 +#: config/tc-i386.c:5309 #, c-format -msgid "Illegal register pair `%s' in Instruction `%s'" -msgstr "" - -#: config/tc-cr16.c:1260 config/tc-i960.c:835 -msgid "unmatched '['" -msgstr "" - -#: config/tc-cr16.c:1266 config/tc-i960.c:842 -msgid "garbage after index spec ignored" -msgstr "" +msgid "%s for `%s'" +msgstr "%s для «%s»" -#: config/tc-cr16.c:1414 config/tc-crx.c:935 +#: config/tc-i386.c:5320 #, c-format -msgid "Illegal operands (whitespace): `%s'" -msgstr "" +msgid "indirect %s without `*'" +msgstr "неявный %s без «*»" -#: config/tc-cr16.c:1426 config/tc-cr16.c:1433 config/tc-cr16.c:1450 -#: config/tc-crx.c:947 config/tc-crx.c:954 config/tc-crx.c:971 -#: config/tc-crx.c:1763 +#. Warn them that a data or address size prefix doesn't +#. affect assembly of the next line of code. +#: config/tc-i386.c:5328 #, c-format -msgid "Missing matching brackets : `%s'" -msgstr "" +msgid "stand-alone `%s' prefix" +msgstr "автономный префикс «%s»" -#: config/tc-cr16.c:1482 config/tc-crx.c:997 +#: config/tc-i386.c:5362 config/tc-i386.c:5378 #, c-format -msgid "Unknown exception: `%s'" -msgstr "" +msgid "`%s' operand %d must use `%ses' segment" +msgstr "для «%s» операнда %d нужно использовать сегмент «%ses»" -#: config/tc-cr16.c:1569 config/tc-crx.c:1093 +#. We have to know the operand size for crc32. +#: config/tc-i386.c:5432 #, c-format -msgid "Illegal `cinv' parameter: `%c'" -msgstr "" +msgid "ambiguous memory operand size for `%s`" +msgstr "двусмысленный размер операнда памяти для «%s»" -#: config/tc-cr16.c:1591 config/tc-cr16.c:1630 +#: config/tc-i386.c:5554 +msgid "no instruction mnemonic suffix given and no register operands; can't size instruction" +msgstr "не указан мнемонический суффикс инструкции и нет регистровых операндов; невозможно узнать размер инструкции" + +#: config/tc-i386.c:5700 config/tc-i386.c:5773 config/tc-i386.c:5895 #, c-format -msgid "Unknown register pair: `%d'" -msgstr "" +msgid "using `%s%s' instead of `%s%s' due to `%c' suffix" +msgstr "используется «%s%s» вместо «%s%s» из-за суффикса «%c»" -#. Issue a error message when register pair is illegal. -#: config/tc-cr16.c:1599 +#: config/tc-i386.c:5721 config/tc-i386.c:5749 config/tc-i386.c:5820 +#: config/tc-i386.c:5870 #, c-format -msgid "Illegal register pair (`%s') in Instruction: `%s'" -msgstr "" +msgid "`%s%s' not allowed with `%s%c'" +msgstr "«%s%s» не допускается вместе с «%s%c»" -#. Issue a error message when register pair is illegal. -#: config/tc-cr16.c:1638 +#: config/tc-i386.c:5767 config/tc-i386.c:5794 config/tc-i386.c:5845 +#: config/tc-i386.c:5889 #, c-format -msgid "Illegal index register pair (`%s') in Instruction: `%s'" -msgstr "" +msgid "incorrect register `%s%s' used with `%c' suffix" +msgstr "используется неверный регистр «%s%s» с суффиксом «%c»" -#: config/tc-cr16.c:1677 +#: config/tc-i386.c:5958 +msgid "no instruction mnemonic suffix given; can't determine immediate size" +msgstr "не указан мнемонический суффикс инструкции; невозможно определить непосредственный размер" + +#: config/tc-i386.c:6102 #, c-format -msgid "Unknown processor register : `%d'" -msgstr "" +msgid "the second source register `%s%s' implicitly denotes `%s%.3s%d' to `%s%.3s%d' source group in `%s'" +msgstr "второй регистр-источник «%s%s» неявно обозначает «%s%.3s%d» как источник-группу «%s%.3s%d» в «%s»" -#. Issue a error message when register pair is illegal. -#: config/tc-cr16.c:1685 +#: config/tc-i386.c:6139 #, c-format -msgid "Illegal processor register (`%s') in Instruction: `%s'" -msgstr "" +msgid "you can't `pop %scs'" +msgstr "нельзя использовать «pop %scs»" -#: config/tc-cr16.c:1733 +#. Reversed arguments on faddp, fsubp, etc. +#: config/tc-i386.c:6168 #, c-format -msgid "Unknown processor register (32 bit) : `%d'" -msgstr "" +msgid "translating to `%s %s%s,%s%s'" +msgstr "преобразуется в «%s %s%s,%s%s»" -#. Issue a error message when register pair is illegal. -#: config/tc-cr16.c:1741 +#. Extraneous `l' suffix on fp insn. +#: config/tc-i386.c:6175 #, c-format -msgid "Illegal 32 bit - processor register (`%s') in Instruction: `%s'" -msgstr "" +msgid "translating to `%s %s%s'" +msgstr "преобразуется в «%s %s%s»" -#: config/tc-cr16.c:2105 config/tc-crx.c:1661 config/tc-crx.c:1678 +#: config/tc-i386.c:6203 #, c-format -msgid "Same src/dest register is used (`r%d'), result is undefined" -msgstr "" +msgid "segment override on `%s' is ineffectual" +msgstr "замена сегмента на «%s» не сработает" -#: config/tc-cr16.c:2126 -msgid "RA register is saved twice." -msgstr "" +#: config/tc-i386.c:6975 config/tc-i386.c:7076 config/tc-i386.c:7131 +msgid "skipping prefixes on this instruction" +msgstr "пропускаются префиксы для этой инструкции" + +#: config/tc-i386.c:7151 +msgid "16-bit jump out of range" +msgstr "16-битный прыжок за пределами диапазона" -#: config/tc-cr16.c:2130 +#: config/tc-i386.c:7160 #, c-format -msgid "`%s' Illegal use of registers." -msgstr "" +msgid "can't handle non absolute segment in `%s'" +msgstr "невозможно обработать не абсолютный сегмент в «%s»" -#: config/tc-cr16.c:2144 +#: config/tc-i386.c:7255 +msgid "pseudo prefix without instruction" +msgstr "псевдопрефикс без инструкции" + +#: config/tc-i386.c:7847 config/tc-i386.c:7949 #, c-format -msgid "`%s' Illegal count-register combination." -msgstr "" +msgid "@%s reloc is not supported with %d-bit output format" +msgstr "перемещение @%s не поддерживается выходным %d-битным форматом" -#: config/tc-cr16.c:2150 +#: config/tc-i386.c:8000 #, c-format -msgid "`%s' Illegal use of register." -msgstr "" +msgid "missing or invalid expression `%s'" +msgstr "отсутствующее или некорректное выражение «%s»" -#: config/tc-cr16.c:2159 config/tc-crx.c:1670 +#: config/tc-i386.c:8086 #, c-format -msgid "`%s' has undefined result" -msgstr "" +msgid "Unsupported broadcast: `%s'" +msgstr "Неподдерживаемый broadcast: «%s»" -#: config/tc-cr16.c:2167 +#: config/tc-i386.c:8101 #, c-format -msgid "Same src/dest register is used (`r%d'),result is undefined" -msgstr "" +msgid "`%s%s' can't be used for write mask" +msgstr "нельзя использовать «%s%s» для маски записи" -#: config/tc-cr16.c:2338 config/tc-crx.c:1575 -msgid "Incorrect number of operands" -msgstr "" +#: config/tc-i386.c:8124 +#, c-format +msgid "invalid write mask `%s'" +msgstr "некорректная маска записи «%s»" -#: config/tc-cr16.c:2340 config/tc-crx.c:1577 +#: config/tc-i386.c:8146 config/tc-i386.c:8809 #, c-format -msgid "Illegal type of operand (arg %d)" -msgstr "" +msgid "duplicated `%s'" +msgstr "повторный «%s»" -#: config/tc-cr16.c:2346 config/tc-crx.c:1583 +#: config/tc-i386.c:8156 #, c-format -msgid "Operand out of range (arg %d)" -msgstr "" +msgid "invalid zeroing-masking `%s'" +msgstr "неверная обнуляющая маска «%s»" -#: config/tc-cr16.c:2349 config/tc-crx.c:1586 +#: config/tc-i386.c:8169 #, c-format -msgid "Operand has odd displacement (arg %d)" -msgstr "" +msgid "missing `}' in `%s'" +msgstr "отсутствует «}» в «%s»" -#: config/tc-cr16.c:2352 config/tc-cr16.c:2383 config/tc-crx.c:1599 -#: config/tc-crx.c:1630 +#. We don't know this one. +#: config/tc-i386.c:8177 #, c-format -msgid "Illegal operand (arg %d)" -msgstr "" +msgid "unknown vector operation: `%s'" +msgstr "неизвестная векторная операция: «%s»" -#. Give an error if a frag containing code is not aligned to a 2-byte -#. boundary. -#: config/tc-cr16.c:2485 config/tc-cr16.h:73 config/tc-crx.c:1952 -#: config/tc-crx.h:76 -msgid "instruction address is not a multiple of 2" -msgstr "" +#: config/tc-i386.c:8183 +msgid "zeroing-masking only allowed with write mask" +msgstr "обнуляющая маска разрешена только с маской записи" -#: config/tc-cr16.c:2562 config/tc-cris.c:1538 config/tc-cris.c:1546 -#: config/tc-crx.c:1988 config/tc-dlx.c:686 config/tc-hppa.c:3243 -#: config/tc-hppa.c:3250 config/tc-i860.c:490 config/tc-i860.c:507 -#: config/tc-i860.c:987 config/tc-sparc.c:1410 config/tc-sparc.c:1418 +#: config/tc-i386.c:8203 #, c-format -msgid "Unknown opcode: `%s'" -msgstr "" +msgid "at most %d immediate operands are allowed" +msgstr "разрешено не более %d непосредственных операндов" -#: config/tc-cris.c:551 config/tc-m68hc11.c:2744 +#: config/tc-i386.c:8235 config/tc-i386.c:8482 #, c-format -msgid "internal inconsistency problem in %s: fr_symbol %lx" -msgstr "" +msgid "junk `%s' after expression" +msgstr "мусор «%s» после выражения" -#: config/tc-cris.c:555 config/tc-m68hc11.c:2748 config/tc-msp430.c:2247 +#: config/tc-i386.c:8256 #, c-format -msgid "internal inconsistency problem in %s: resolved symbol" -msgstr "" +msgid "missing or invalid immediate expression `%s'" +msgstr "отсутствующее или некорректное непосредственное выражение «%s»" -#: config/tc-cris.c:565 config/tc-m68hc11.c:2754 +#: config/tc-i386.c:8279 config/tc-i386.c:8572 #, c-format -msgid "internal inconsistency problem in %s: fr_subtype %d" -msgstr "" - -#: config/tc-cris.c:905 -msgid "Relaxation to long branches for .arch common_v10_v32 not implemented" -msgstr "" +msgid "unimplemented segment %s in operand" +msgstr "нереализованный сегмент %s в операнде" -#: config/tc-cris.c:935 -msgid "Complicated LAPC target operand is not a multiple of two. Use LAPC.D" -msgstr "" +#: config/tc-i386.c:8286 +#, c-format +msgid "illegal immediate register operand %s" +msgstr "неверный непосредственный регистровый операнд %s" -#: config/tc-cris.c:940 +#: config/tc-i386.c:8334 #, c-format -msgid "Internal error found in md_convert_frag: offset %ld. Please report this." -msgstr "" +msgid "expecting scale factor of 1, 2, 4, or 8: got `%s'" +msgstr "ожидается коэффициент масштабирования 1, 2, 4 или 8: получен «%s»" -#: config/tc-cris.c:965 +#: config/tc-i386.c:8343 #, c-format -msgid "internal inconsistency in %s: bdapq no symbol" -msgstr "" +msgid "scale factor of %d without an index register" +msgstr "коэффициент масштабирования %d без индексного регистра" -#: config/tc-cris.c:978 +#: config/tc-i386.c:8365 #, c-format -msgid "internal inconsistency in %s: bdap.w with no symbol" -msgstr "" +msgid "at most %d displacement operands are allowed" +msgstr "разрешено не более %d операндов смещения" -#: config/tc-cris.c:1002 -msgid "section alignment must be >= 4 bytes to check MULS/MULU safeness" -msgstr "" +#: config/tc-i386.c:8538 +#, c-format +msgid "missing or invalid displacement expression `%s'" +msgstr "отсутствующее или некорректное выражение смещения «%s»" -#: config/tc-cris.c:1011 -msgid "dangerous MULS/MULU location; give it higher alignment" -msgstr "" +#: config/tc-i386.c:8555 +#, c-format +msgid "0x%lx out range of signed 32bit displacement" +msgstr "0x%lx вне диапазона знакового 32-битного смещения" -#. Bail out for compatibility mode. (It seems it can be implemented, -#. perhaps with a 10-byte sequence: "move.d NNNN,$pc/$acr", "jump -#. $acr", "nop"; but doesn't seem worth it at the moment.) -#: config/tc-cris.c:1052 -msgid "Out-of-range .word offset handling is not implemented for .arch common_v10_v32" -msgstr "" +#: config/tc-i386.c:8707 +#, c-format +msgid "`%s' is not valid here (expected `%c%s%s%c')" +msgstr "«%s» здесь не допускается (ожидается «%c%s%s%c»)" -#: config/tc-cris.c:1097 -msgid ".word case-table handling failed: table too large" -msgstr "" +#: config/tc-i386.c:8719 +#, c-format +msgid "`%s' is not a valid %s expression" +msgstr "«%s» не является верным выражением %s" -#: config/tc-cris.c:1229 +#: config/tc-i386.c:8754 #, c-format -msgid "Buggy opcode: `%s' \"%s\"\n" -msgstr "" +msgid "`%s' cannot be used here" +msgstr "«%s» не может использоваться здесь" -#: config/tc-cris.c:1644 +#: config/tc-i386.c:8761 +msgid "register scaling is being ignored here" +msgstr "регистровое масштабирование здесь игнорируется" + +#: config/tc-i386.c:8822 #, c-format -msgid "Immediate value not in 5 bit unsigned range: %ld" -msgstr "" +msgid "Missing '}': '%s'" +msgstr "Отсутствует «}»: «%s»" -#: config/tc-cris.c:1660 +#: config/tc-i386.c:8828 #, c-format -msgid "Immediate value not in 4 bit unsigned range: %ld" -msgstr "" +msgid "Junk after '}': '%s'" +msgstr "Мусор после «}»: «%s»" -#: config/tc-cris.c:1712 +#: config/tc-i386.c:8956 #, c-format -msgid "Immediate value not in 6 bit range: %ld" -msgstr "" +msgid "bad memory operand `%s'" +msgstr "плохой операнд памяти «%s»" -#: config/tc-cris.c:1727 +#: config/tc-i386.c:8980 #, c-format -msgid "Immediate value not in 6 bit unsigned range: %ld" -msgstr "" +msgid "junk `%s' after register" +msgstr "мусор «%s» после регистра" -#. Others have a generic warning. -#: config/tc-cris.c:1835 +#: config/tc-i386.c:8993 config/tc-i386.c:9130 config/tc-i386.c:9174 #, c-format -msgid "Unimplemented register `%s' specified" -msgstr "" +msgid "bad register name `%s'" +msgstr "плохое имя регистра: «%s»" -#. We've come to the end of instructions with this -#. opcode, so it must be an error. -#: config/tc-cris.c:2079 -msgid "Illegal operands" -msgstr "" +#: config/tc-i386.c:9001 +msgid "immediate operand illegal with absolute jump" +msgstr "непосредственный операнд недопустим с абсолютным прыжком" -#: config/tc-cris.c:2120 config/tc-cris.c:2160 +#: config/tc-i386.c:9032 #, c-format -msgid "Immediate value not in 8 bit range: %ld" -msgstr "" +msgid "too many memory references for `%s'" +msgstr "слишком много ссылок на память для «%s»" -#: config/tc-cris.c:2130 config/tc-cris.c:2181 +#: config/tc-i386.c:9119 #, c-format -msgid "Immediate value not in 16 bit range: %ld" -msgstr "" +msgid "expecting `,' or `)' after index register in `%s'" +msgstr "ожидается «,» или «)» после индексного регистра в «%s»" -#: config/tc-cris.c:2165 +#: config/tc-i386.c:9147 #, c-format -msgid "Immediate value not in 8 bit signed range: %ld" -msgstr "" +msgid "expecting `)' after scale factor in `%s'" +msgstr "ожидается «,» после коэффициента масштабирования в «%s»" -#: config/tc-cris.c:2170 +#: config/tc-i386.c:9155 #, c-format -msgid "Immediate value not in 8 bit unsigned range: %ld" -msgstr "" +msgid "expecting index register or scale factor after `,'; got '%c'" +msgstr "ожидается индексный регистр или коэффициент масштабирования после «,»: получен «%c»" -#: config/tc-cris.c:2186 +#: config/tc-i386.c:9163 #, c-format -msgid "Immediate value not in 16 bit signed range: %ld" -msgstr "" +msgid "expecting `,' or `)' after base register in `%s'" +msgstr "ожидается «,» или «)» после базового регистра в «%s»" -#: config/tc-cris.c:2191 +#. It's not a memory operand; argh! +#: config/tc-i386.c:9212 #, c-format -msgid "Immediate value not in 16 bit unsigned range: %ld" -msgstr "" +msgid "invalid char %s beginning operand %d `%s'" +msgstr "некорректный символ %s в начале операнда %d «%s»" -#: config/tc-cris.c:2217 -msgid "TLS relocation size does not match operand size" -msgstr "" +#: config/tc-i386.c:9434 +msgid "long jump required" +msgstr "требуется длинный прыжок" -#: config/tc-cris.c:2218 -msgid "PIC relocation size does not match operand size" -msgstr "" +#: config/tc-i386.c:9489 +msgid "jump target out of range" +msgstr "цель прыжка за пределами диапазона" -#: config/tc-cris.c:3366 -msgid "Calling gen_cond_branch_32 for .arch common_v10_v32\n" -msgstr "" +#: config/tc-i386.c:10064 +msgid "no compiled in support for x86_64" +msgstr "откомпилирован без поддержки x86_64" -#: config/tc-cris.c:3370 -msgid "32-bit conditional branch generated" -msgstr "" +#: config/tc-i386.c:10084 +msgid "no compiled in support for 32bit x86_64" +msgstr "откомпилирован без поддержки 32-битной x86_64" -#: config/tc-cris.c:3431 -msgid "Complex expression not supported" -msgstr "" +#: config/tc-i386.c:10088 +msgid "32bit x86_64 is only supported for ELF" +msgstr "32-битная x86_64 поддерживается только в ELF" -#. FIXME: Is this function mentioned in the internals.texi manual? If -#. not, add it. -#: config/tc-cris.c:3581 -msgid "Bad call to md_atof () - floating point formats are not supported" -msgstr "" +#: config/tc-i386.c:10122 config/tc-i386.c:10206 +#, c-format +msgid "invalid -march= option: `%s'" +msgstr "неверный параметр -march=: «%s»" -#: config/tc-cris.c:3622 -msgid "PC-relative relocation must be trivially resolved" -msgstr "" +#: config/tc-i386.c:10216 config/tc-i386.c:10228 +#, c-format +msgid "invalid -mtune= option: `%s'" +msgstr "неверный параметр -mtune=: «%s»" -#: config/tc-cris.c:3694 +#: config/tc-i386.c:10237 #, c-format -msgid "Value not in 16 bit range: %ld" -msgstr "" +msgid "invalid -mmnemonic= option: `%s'" +msgstr "неверный параметр -mmnemonic=: «%s»" -#: config/tc-cris.c:3702 +#: config/tc-i386.c:10246 #, c-format -msgid "Value not in 16 bit signed range: %ld" -msgstr "" +msgid "invalid -msyntax= option: `%s'" +msgstr "неверный параметр -msyntax=: «%s»" -#: config/tc-cris.c:3710 +#: config/tc-i386.c:10273 #, c-format -msgid "Value not in 8 bit range: %ld" -msgstr "" +msgid "invalid -msse-check= option: `%s'" +msgstr "неверный параметр -msse-check=: «%s»" -#: config/tc-cris.c:3717 +#: config/tc-i386.c:10284 #, c-format -msgid "Value not in 8 bit signed range: %ld" -msgstr "" +msgid "invalid -moperand-check= option: `%s'" +msgstr "неверный параметр -moperand-check=: «%s»" -#: config/tc-cris.c:3727 +#: config/tc-i386.c:10293 #, c-format -msgid "Value not in 4 bit unsigned range: %ld" -msgstr "" +msgid "invalid -mavxscalar= option: `%s'" +msgstr "неверный параметр -mavxscalar=: «%s»" -#: config/tc-cris.c:3734 +#: config/tc-i386.c:10308 #, c-format -msgid "Value not in 5 bit unsigned range: %ld" -msgstr "" +msgid "invalid -mevexlig= option: `%s'" +msgstr "неверный параметр -mevexlig=: «%s»" -#: config/tc-cris.c:3741 +#: config/tc-i386.c:10321 #, c-format -msgid "Value not in 6 bit range: %ld" -msgstr "" +msgid "invalid -mevexrcig= option: `%s'" +msgstr "неверный параметр -mevexrcig=: «%s»" -#: config/tc-cris.c:3748 +#: config/tc-i386.c:10330 #, c-format -msgid "Value not in 6 bit unsigned range: %ld" -msgstr "" +msgid "invalid -mevexwig= option: `%s'" +msgstr "неверный параметр -mevexwig=: «%s»" -#: config/tc-cris.c:3792 +#: config/tc-i386.c:10345 #, c-format -msgid "Please use --help to see usage and options for this assembler.\n" -msgstr "" +msgid "invalid -momit-lock-prefix= option: `%s'" +msgstr "неверный параметр -momit-lock-prefix=: «%s»" -#: config/tc-cris.c:3804 -msgid "--no-underscore is invalid with a.out format" -msgstr "" +#: config/tc-i386.c:10354 +#, c-format +msgid "invalid -mfence-as-lock-add= option: `%s'" +msgstr "неверный параметр -mfence-as-lock-add=: «%s»" -#: config/tc-cris.c:3828 +#: config/tc-i386.c:10363 #, c-format -msgid "invalid in --march=: %s" -msgstr "" +msgid "invalid -mrelax-relocations= option: `%s'" +msgstr "неверный параметр -mrelax-relocations=: «%s»" -#: config/tc-cris.c:3937 config/tc-moxie.c:711 -msgid "Semantics error. This type of operand can not be relocated, it must be an assembly-time constant" +#: config/tc-i386.c:10486 +#, c-format +msgid "" +" -Q ignored\n" +" -V print assembler version number\n" +" -k ignored\n" msgstr "" +" -Q игнорируется\n" +" -V напечатать номер версии ассемблера\n" +" -k игнорируется\n" -#: config/tc-cris.c:3986 config/tc-moxie.c:760 +#: config/tc-i386.c:10491 #, c-format -msgid "Cannot generate relocation type for symbol %s, code %s" +msgid "" +" -n Do not optimize code alignment\n" +" -q quieten some warnings\n" msgstr "" +" -n не оптимизировать выравнивание кода\n" +" -q выводить только некоторые предупреждения\n" -#. The messages are formatted to line up with the generic options. -#: config/tc-cris.c:3999 +#: config/tc-i386.c:10495 #, c-format -msgid "CRIS-specific options:\n" -msgstr "" +msgid " -s ignored\n" +msgstr " -s игнорируется\n" -#: config/tc-cris.c:4001 -msgid " -h, -H Don't execute, print this help text. Deprecated.\n" -msgstr "" +#: config/tc-i386.c:10500 +#, c-format +msgid " --32/--64/--x32 generate 32bit/64bit/x32 code\n" +msgstr " --32/--64/--x32 генерировать 32-битный/64-битный/x32 код\n" -#: config/tc-cris.c:4003 -msgid " -N Warn when branches are expanded to jumps.\n" -msgstr "" +#: config/tc-i386.c:10504 +#, c-format +msgid " --divide do not treat `/' as a comment character\n" +msgstr " --divide не считать «/» символом комментариев\n" -#: config/tc-cris.c:4005 -msgid " --underscore User symbols are normally prepended with underscore.\n" -msgstr "" +#: config/tc-i386.c:10507 +#, c-format +msgid " --divide ignored\n" +msgstr " --divide игнорируется\n" -#: config/tc-cris.c:4007 -msgid " Registers will not need any prefix.\n" +#: config/tc-i386.c:10510 +#, c-format +msgid "" +" -march=CPU[,+EXTENSION...]\n" +" generate code for CPU and EXTENSION, CPU is one of:\n" msgstr "" +" -march=ЦП[,+РАСШИРЕНИЕ…]\n" +" генерировать код для ЦП и РАСШИРЕНИЯ; возможные ЦП:\n" -#: config/tc-cris.c:4009 -msgid " --no-underscore User symbols do not have any prefix.\n" -msgstr "" +#: config/tc-i386.c:10514 +#, c-format +msgid " EXTENSION is combination of:\n" +msgstr " РАСШИРЕНИЕ — комбинации следующих:\n" -#: config/tc-cris.c:4011 -msgid " Registers will require a `$'-prefix.\n" -msgstr "" +#: config/tc-i386.c:10517 +#, c-format +msgid " -mtune=CPU optimize for CPU, CPU is one of:\n" +msgstr " -mtune=ЦП оптимизировать для ЦП; ЦП один из следующих:\n" -#: config/tc-cris.c:4013 -msgid " --pic\t\t\tEnable generation of position-independent code.\n" -msgstr "" +#: config/tc-i386.c:10520 +#, c-format +msgid " -msse2avx encode SSE instructions with VEX prefix\n" +msgstr " -msse2avx кодировать инструкции SSE с префиксом VEX\n" -#: config/tc-cris.c:4015 +#: config/tc-i386.c:10522 +#, c-format msgid "" -" --march=\t\tGenerate code for . Valid choices for \n" -"\t\t\t\tare v0_v10, v10, v32 and common_v10_v32.\n" +" -msse-check=[none|error|warning]\n" +" check SSE instructions\n" msgstr "" +" -msse-check=[none|error|warning]\n" +" проверять инструкции SSE\n" -#: config/tc-cris.c:4036 -msgid "Invalid relocation" +#: config/tc-i386.c:10525 +#, c-format +msgid "" +" -moperand-check=[none|error|warning]\n" +" check operand combinations for validity\n" msgstr "" +" -moperand-check=[none|error|warning]\n" +" проверять комбинации операндов на корректность\n" -#: config/tc-cris.c:4073 -msgid "Invalid pc-relative relocation" +#: config/tc-i386.c:10528 +#, c-format +msgid "" +" -mavxscalar=[128|256] encode scalar AVX instructions with specific vector\n" +" length\n" msgstr "" +" -mavxscalar=[128|256] кодировать скалярные инструкции AVX с заданной\n" +" длиной вектора\n" -#: config/tc-cris.c:4118 +#: config/tc-i386.c:10531 #, c-format -msgid "Adjusted signed .word (%ld) overflows: `switch'-statement too large." +msgid "" +" -mevexlig=[128|256|512] encode scalar EVEX instructions with specific vector\n" +" length\n" msgstr "" +" -mevexlig=[128|256|512] кодировать скалярные инструкции EVEX с заданной\n" +" длиной вектора\n" -#: config/tc-cris.c:4148 +#: config/tc-i386.c:10534 #, c-format -msgid ".syntax %s requires command-line option `--underscore'" +msgid "" +" -mevexwig=[0|1] encode EVEX instructions with specific EVEX.W value\n" +" for EVEX.W bit ignored instructions\n" msgstr "" +" -mevexwig=[0|1] кодировать инструкции EVEX с заданным значением\n" +" EVEX.W для бита игнорированных инструкций EVEX.W\n" -#: config/tc-cris.c:4157 +#: config/tc-i386.c:10537 #, c-format -msgid ".syntax %s requires command-line option `--no-underscore'" +msgid "" +" -mevexrcig=[rne|rd|ru|rz]\n" +" encode EVEX instructions with specific EVEX.RC value\n" +" for SAE-only ignored instructions\n" msgstr "" +" -mevexrcig=[rne|rd|ru|rz]\n" +" кодировать инструкции EVEX с заданным значением\n" +" EVEX.RC для игнорированных инструкций только SAE\n" -#: config/tc-cris.c:4194 -msgid "Unknown .syntax operand" -msgstr "" +#: config/tc-i386.c:10541 +#, c-format +msgid " -mmnemonic=[att|intel] use AT&T/Intel mnemonic\n" +msgstr " -mmnemonic=[att|intel] использовать мнемонику AT&T/Intel\n" -#: config/tc-cris.c:4204 -msgid "Pseudodirective .file is only valid when generating ELF" -msgstr "" +#: config/tc-i386.c:10543 +#, c-format +msgid " -msyntax=[att|intel] use AT&T/Intel syntax\n" +msgstr " -msyntax=[att|intel] использовать синтаксис AT&T/Intel\n" -#: config/tc-cris.c:4216 -msgid "Pseudodirective .loc is only valid when generating ELF" -msgstr "" +#: config/tc-i386.c:10545 +#, c-format +msgid " -mindex-reg support pseudo index registers\n" +msgstr " -mindex-reg поддерживать псевдоиндексные регистры\n" -#: config/tc-cris.c:4231 +#: config/tc-i386.c:10547 #, c-format -msgid "internal inconsistency problem: %s called for %d bytes" -msgstr "" +msgid " -mnaked-reg don't require `%%' prefix for registers\n" +msgstr " -mnaked-reg не требовать префикса «%%» для регистров\n" -#: config/tc-cris.c:4383 -msgid "unknown operand to .arch" -msgstr "" +#: config/tc-i386.c:10549 +#, c-format +msgid " -mold-gcc support old (<= 2.8.1) versions of gcc\n" +msgstr " -mold-gcc поддерживать старые (<= 2.8.1) версии gcc\n" -#: config/tc-cris.c:4392 -msgid ".arch requires a matching --march=... option" -msgstr "" +#: config/tc-i386.c:10551 +#, c-format +msgid " -madd-bnd-prefix add BND prefix for all valid branches\n" +msgstr " -madd-bnd-prefix добавлять префикс BND для всех корректных ветвлений\n" -#: config/tc-crx.c:819 +#: config/tc-i386.c:10553 #, c-format -msgid "Illegal Scale - `%d'" -msgstr "" +msgid " -mshared disable branch optimization for shared code\n" +msgstr " -mshared выключить оптимизацию ветвления в общем коде\n" -#: config/tc-crx.c:1263 +#: config/tc-i386.c:10556 #, c-format -msgid "Illegal Co-processor register in Instruction `%s' " -msgstr "" +msgid " -mbig-obj generate big object files\n" +msgstr " -mbig-obj генерировать большие объектные файлы\n" -#: config/tc-crx.c:1270 +#: config/tc-i386.c:10559 #, c-format -msgid "Illegal Co-processor special register in Instruction `%s' " +msgid "" +" -momit-lock-prefix=[no|yes]\n" +" strip all lock prefixes\n" msgstr "" +" -momit-lock-prefix=[no|yes]\n" +" удалять все префиксы блокировки\n" -#: config/tc-crx.c:1589 +#: config/tc-i386.c:10562 #, c-format -msgid "Invalid DISPU4 operand value (arg %d)" +msgid "" +" -mfence-as-lock-add=[no|yes]\n" +" encode lfence, mfence and sfence as\n" +" lock addl $0x0, (%%{re}sp)\n" msgstr "" +" -mfence-as-lock-add=[no|yes]\n" +" кодировать lfence, mfence и sfence как\n" +" lock addl $0x0, (%%{re}sp)\n" -#: config/tc-crx.c:1592 +#: config/tc-i386.c:10566 #, c-format -msgid "Invalid CST4 operand value (arg %d)" +msgid "" +" -mrelax-relocations=[no|yes]\n" +" generate relax relocations\n" msgstr "" +" -mrelax-relocations=[no|yes]\n" +" генерировать ослабленные перемещения\n" -#: config/tc-crx.c:1595 +#: config/tc-i386.c:10569 #, c-format -msgid "Operand value is not within upper 64 KB (arg %d)" -msgstr "" +msgid " -mamd64 accept only AMD64 ISA\n" +msgstr " -mamd64 принимать только AMD64 ISA\n" + +#: config/tc-i386.c:10571 +#, c-format +msgid " -mintel64 accept only Intel64 ISA\n" +msgstr " -mintel64 принимать только Intel64 ISA\n" + +#: config/tc-i386.c:10612 +#, c-format +msgid "Intel MCU doesn't support `%s' architecture" +msgstr "МК Intel не поддерживает архитектуру «%s»" + +#: config/tc-i386.c:10669 +msgid "Intel L1OM is 64bit only" +msgstr "Intel L1OM только 64-битный" -#: config/tc-crx.c:1732 -msgid "Invalid Register in Register List" -msgstr "" +#: config/tc-i386.c:10675 +msgid "Intel K1OM is 64bit only" +msgstr "Intel K1OM только 64-битный" + +#: config/tc-i386.c:10681 +msgid "Intel MCU is 32bit only" +msgstr "МК Intel только 32-битный" -#: config/tc-crx.c:1786 +#: config/tc-i386.c:10838 +msgid "symbol size computation overflow" +msgstr "переполнение при вычислении размера символа" + +#: config/tc-i386.c:10906 config/tc-sparc.c:3959 #, c-format -msgid "Illegal register `%s' in cop-register list" -msgstr "" +msgid "can not do %d byte pc-relative relocation" +msgstr "невозможно выполнить %d-байтовое перемещение, относительное pc" -#: config/tc-crx.c:1794 +#: config/tc-i386.c:10924 #, c-format -msgid "Illegal register `%s' in cop-special-register list" -msgstr "" +msgid "can not do %d byte relocation" +msgstr "невозможно выполнить %d-байтовое перемещение" -#: config/tc-crx.c:1813 +#: config/tc-i386.c:10992 #, c-format -msgid "Illegal register `%s' in user register list" -msgstr "" +msgid "cannot represent relocation type %s in x32 mode" +msgstr "не удалось представить тип перемещения %s в режиме x32" -#: config/tc-crx.c:1832 +#: config/tc-i386.c:11029 config/tc-s390.c:2598 #, c-format -msgid "Illegal register `%s' in register list" -msgstr "" +msgid "cannot represent relocation type %s" +msgstr "не удалось представить тип перемещения %s" + +#: config/tc-i386.c:11146 +msgid "bad .section directive: want a,l,w,x,M,S,G,T in string" +msgstr "неправильная директива .section: в строке требуется a,l,w,x,M,S,G,T" + +#: config/tc-i386.c:11149 +msgid "bad .section directive: want a,w,x,M,S,G,T in string" +msgstr "неправильная директива .section: в строке требуется a,w,x,M,S,G,T" -#: config/tc-crx.c:1838 +#: config/tc-i386.c:11168 +msgid ".largecomm supported only in 64bit mode, producing .comm" +msgstr ".largecomm поддерживается только в 64-битном режиме, создаётся .comm" + +#: config/tc-i860.c:121 +msgid "Directive .dual available only with -mintel-syntax option" +msgstr "Директива .dual доступна только с параметром -mintel-syntax" + +#: config/tc-i860.c:131 +msgid "Directive .enddual available only with -mintel-syntax option" +msgstr "Директива .enddual доступна только с параметром -mintel-syntax" + +#: config/tc-i860.c:144 +msgid "Directive .atmp available only with -mintel-syntax option" +msgstr "Директива .atmp доступна только с параметром -mintel-syntax" + +#: config/tc-i860.c:166 config/tc-i860.c:170 +msgid "Unknown temporary pseudo register" +msgstr "Неизвестный временный псевдорегистр" + +#: config/tc-i860.c:246 +msgid "Defective assembler. No assembly attempted." +msgstr "Ассемблер сломался. Ничего ассемблироваться не будет." + +#: config/tc-i860.c:392 config/tc-i860.c:938 config/tc-m68k.c:3917 +#: config/tc-m68k.c:3949 config/tc-sparc.c:3199 +msgid "failed sanity check." +msgstr "проверка на исправность не пройдена." + +#: config/tc-i860.c:399 #, c-format -msgid "Maximum %d bits may be set in `mask16' operand" -msgstr "" +msgid "Expanded opcode after delayed branch: `%s'" +msgstr "Расширенный код операции после отложенной ветви: «%s»" -#: config/tc-crx.c:1847 +#: config/tc-i860.c:403 #, c-format -msgid "rest of line ignored; first ignored character is `%c'" -msgstr "" +msgid "Expanded opcode in dual mode: `%s'" +msgstr "Расширенный код операции в двойном режиме: «%s»" -#: config/tc-crx.c:1855 +#: config/tc-i860.c:407 #, c-format -msgid "Illegal `mask16' operand, operation is undefined - `%s'" -msgstr "" +msgid "An instruction was expanded (%s)" +msgstr "Инструкция расширена (%s)" -#. HI can't be specified without LO (and vise-versa). -#: config/tc-crx.c:1861 -msgid "HI/LO registers should be specified together" -msgstr "" +#: config/tc-i860.c:674 +msgid "Pipelined instruction: fsrc1 = fdest" +msgstr "Конвейерная инструкция: fsrc1 = fdest" -#: config/tc-crx.c:1867 -msgid "HI/LO registers should be specified without additional registers" -msgstr "" +#: config/tc-i860.c:877 config/tc-i860.c:884 config/tc-i860.c:891 +msgid "Assembler does not yet support PIC" +msgstr "Ассемблер пока не поддерживает PIC" -#: config/tc-d10v.c:216 +#: config/tc-i860.c:955 #, c-format -msgid "" -"D10V options:\n" -"-O Optimize. Will do some operations in parallel.\n" -"--gstabs-packing Pack adjacent short instructions together even\n" -" when --gstabs is specified. On by default.\n" -"--no-gstabs-packing If --gstabs is specified, do not pack adjacent\n" -" instructions together.\n" -msgstr "" +msgid "Illegal operands for %s" +msgstr "Неверные операнды для %s" -#: config/tc-d10v.c:573 -msgid "operand is not an immediate" -msgstr "" +#: config/tc-i860.c:972 +#, c-format +msgid "'d.%s' must be 8-byte aligned" +msgstr "«d.%s» должен быть выровнен по 8-байтовой границе" -#: config/tc-d10v.c:591 +#: config/tc-i860.c:980 #, c-format -msgid "operand out of range: %lu" -msgstr "" +msgid "Prefix 'd.' invalid for instruction `%s'" +msgstr "Префикс «d.» не допускается для инструкции «%s»" -#: config/tc-d10v.c:649 -msgid "Instruction must be executed in parallel with another instruction." -msgstr "" +#: config/tc-i860.c:1034 config/tc-ip2k.c:230 +msgid "relaxation not supported\n" +msgstr "ослабление не поддерживается\n" -#: config/tc-d10v.c:703 config/tc-d10v.c:711 +#: config/tc-i860.c:1133 #, c-format -msgid "packing conflict: %s must dispatch sequentially" +msgid "" +" -EL\t\t\t generate code for little endian mode (default)\n" +" -EB\t\t\t generate code for big endian mode\n" +" -mwarn-expand\t\t warn if pseudo operations are expanded\n" +" -mxp\t\t\t enable i860XP support (disabled by default)\n" +" -mintel-syntax\t enable Intel syntax (default to AT&T/SVR4)\n" msgstr "" +" -EL\t\t\t генерировать код для режима с обратным порядком байт\n" +" \t\t\t (по умолчанию)\n" +" -EB\t\t\t генерировать код для режима с прямым порядком байт\n" +" -mwarn-expand\t\t предупреждать при расширении псевдоопераций\n" +" -mxp\t\t\t включить поддержку i860XP (по умолчанию выключена)\n" +" -mintel-syntax\t включить синтаксис Intel (по умолчанию AT&T/SVR4)\n" -#: config/tc-d10v.c:810 +#. SVR4 compatibility flags. +#: config/tc-i860.c:1141 #, c-format -msgid "resource conflict (R%d)" +msgid "" +" -V\t\t\t print assembler version number\n" +" -Qy, -Qn\t\t ignored\n" msgstr "" +" -V\t\t\t напечатать номер версии ассемблера\n" +" -Qy, -Qn\t\t игнорируется\n" -#: config/tc-d10v.c:813 -#, c-format -msgid "resource conflict (A%d)" -msgstr "" +#: config/tc-i860.c:1204 +msgid "This immediate requires 0 MOD 2 alignment" +msgstr "Для непосредственного значения требуется выравнивание 0 MOD 2" -#: config/tc-d10v.c:815 -msgid "resource conflict (PSW)" -msgstr "" +#: config/tc-i860.c:1207 +msgid "This immediate requires 0 MOD 4 alignment" +msgstr "Для непосредственного значения требуется выравнивание 0 MOD 4" -#: config/tc-d10v.c:817 -msgid "resource conflict (C flag)" -msgstr "" +#: config/tc-i860.c:1210 +msgid "This immediate requires 0 MOD 8 alignment" +msgstr "Для непосредственного значения требуется выравнивание 0 MOD 8" -#: config/tc-d10v.c:819 -msgid "resource conflict (F flag)" -msgstr "" +#: config/tc-i860.c:1213 +msgid "This immediate requires 0 MOD 16 alignment" +msgstr "Для непосредственного значения требуется выравнивание 0 MOD 16" -#: config/tc-d10v.c:969 -msgid "Instruction must be executed in parallel" -msgstr "" +#: config/tc-i860.c:1308 +msgid "5-bit immediate too large" +msgstr "5-битное значение слишком велико" -#: config/tc-d10v.c:972 -msgid "Long instructions may not be combined." -msgstr "" +#: config/tc-i860.c:1311 +msgid "5-bit field must be absolute" +msgstr "5-битное поле должно быть абсолютным" -#: config/tc-d10v.c:1005 -msgid "One of these instructions may not be executed in parallel." -msgstr "" +#: config/tc-i860.c:1356 config/tc-i860.c:1379 +msgid "A branch offset requires 0 MOD 4 alignment" +msgstr "Смещение ветви требует выравнивания 0 MOD 4" -#: config/tc-d10v.c:1009 config/tc-d30v.c:1036 -msgid "Two IU instructions may not be executed in parallel" -msgstr "" +#: config/tc-i860.c:1400 +#, c-format +msgid "Unrecognized fix-up (0x%08lx)" +msgstr "Нераспознанное местоположение (0x%08lx)" -#: config/tc-d10v.c:1011 config/tc-d10v.c:1019 config/tc-d10v.c:1033 -#: config/tc-d10v.c:1048 config/tc-d30v.c:1037 config/tc-d30v.c:1046 -msgid "Swapping instruction order" -msgstr "" +#: config/tc-i960.c:483 +#, c-format +msgid "Hashing returned \"%s\"." +msgstr "Хэширование вернуло «%s»." -#: config/tc-d10v.c:1017 config/tc-d30v.c:1043 -msgid "Two MU instructions may not be executed in parallel" -msgstr "" +#: config/tc-i960.c:579 config/tc-i960.c:1110 +msgid "expression syntax error" +msgstr "синтаксическая ошибка в выражении" -#: config/tc-d10v.c:1037 config/tc-d30v.c:1063 -msgid "IU instruction may not be in the left container" -msgstr "" +#: config/tc-i960.c:616 +msgid "attempt to branch into different segment" +msgstr "попытка ветвления в другой сегмент" -#: config/tc-d10v.c:1039 config/tc-d10v.c:1054 -msgid "Instruction in R container is squashed by flow control instruction in L container." -msgstr "" +#: config/tc-i960.c:620 +#, c-format +msgid "target of %s instruction must be a label" +msgstr "цель инструкции %s должна быть меткой" -#: config/tc-d10v.c:1052 config/tc-d30v.c:1074 -msgid "MU instruction may not be in the right container" -msgstr "" +#: config/tc-i960.c:730 +msgid "unaligned register" +msgstr "невыровненный регистр" -#: config/tc-d10v.c:1058 config/tc-d30v.c:1086 -msgid "unknown execution type passed to write_2_short()" -msgstr "" +#: config/tc-i960.c:752 +msgid "no such sfr in this architecture" +msgstr "в этой архитектуре нет такого sfr" -#: config/tc-d10v.c:1186 config/tc-d10v.c:1359 -msgid "bad opcode or operands" -msgstr "" +#: config/tc-i960.c:790 +msgid "illegal literal" +msgstr "неверный литерал" -#: config/tc-d10v.c:1261 -msgid "value out of range" -msgstr "" +#: config/tc-i960.c:940 +msgid "invalid index register" +msgstr "некорректный индексный регистр" -#: config/tc-d10v.c:1335 -msgid "illegal operand - register name found where none expected" -msgstr "" +#: config/tc-i960.c:963 +msgid "invalid scale factor" +msgstr "некорректный коэффициент масштабирования" -#: config/tc-d10v.c:1370 -msgid "Register number must be EVEN" -msgstr "" +#: config/tc-i960.c:1187 +msgid "architecture of opcode conflicts with that of earlier instruction(s)" +msgstr "архитектура кода операции конфликтует с предыдущими инструкциями" -#: config/tc-d10v.c:1373 -msgid "Unsupported use of sp" -msgstr "" +#: config/tc-i960.c:1421 config/tc-xtensa.c:12784 +msgid "too many operands" +msgstr "слишком много операндов" -#: config/tc-d10v.c:1392 -#, c-format -msgid "cr%ld is a reserved control register" -msgstr "" +#. We never moved: there was no opcode either! +#: config/tc-i960.c:1469 +msgid "missing opcode" +msgstr "отсутствует код операции" + +#: config/tc-i960.c:1609 +msgid "branch prediction invalid on this opcode" +msgstr "предсказание ветвления некорректно для этого кода операции" -#: config/tc-d10v.c:1565 +#: config/tc-i960.c:1647 #, c-format -msgid "line %d: rep or repi must include at least 4 instructions" -msgstr "" +msgid "invalid opcode, \"%s\"." +msgstr "неверный код операции, «%s»" -#: config/tc-d10v.c:1745 -msgid "can't find previous opcode " -msgstr "" +#: config/tc-i960.c:1649 +#, c-format +msgid "improper number of operands. Expecting %d, got %d" +msgstr "Неправильное количество операндов. Ожидалось %d, получено %d" -#: config/tc-d10v.c:1757 +#: config/tc-i960.c:1750 #, c-format -msgid "could not assemble: %s" -msgstr "" +msgid "Fixup of %ld too large for field width of %d" +msgstr "Местоположение %ld слишком большое для поля шириной %d" -#: config/tc-d10v.c:1772 config/tc-d10v.c:1794 config/tc-d30v.c:1742 -msgid "Unable to mix instructions as specified" -msgstr "" +#: config/tc-i960.c:1860 +#, c-format +msgid "invalid architecture %s" +msgstr "неверная архитектура %s" -#: config/tc-d30v.c:149 +#: config/tc-i960.c:1880 #, c-format -msgid "Register name %s conflicts with symbol of the same name" -msgstr "" +msgid "I960 options:\n" +msgstr "Параметры I960:\n" -#: config/tc-d30v.c:239 +#: config/tc-i960.c:1883 #, c-format msgid "" "\n" -"D30V options:\n" -"-O Make adjacent short instructions parallel if possible.\n" -"-n Warn about all NOPs inserted by the assembler.\n" -"-N\t\t\tWarn about NOPs inserted after word multiplies.\n" -"-c Warn about symbols whoes names match register names.\n" -"-C Opposite of -C. -c is the default.\n" +"\t\t\tspecify variant of 960 architecture\n" +"-b\t\t\tadd code to collect statistics about branches taken\n" +"-link-relax\t\tpreserve individual alignment directives so linker\n" +"\t\t\tcan do relaxing (b.out format only)\n" +"-no-relax\t\tdon't alter compare-and-branch instructions for\n" +"\t\t\tlong displacements\n" msgstr "" +"\n" +"\t\t\tукажите вариант архитектуры 960\n" +"-b\t\t\tдобавить код сбора статистики о ветвлении\n" +"-link-relax\t\tсохранять индивидуальные директивы выравнивания для того, чтобы\n" +"\t\t\tкомпоновщик мог выполнять ослабление (только с форматом b.out)\n" +"-no-relax\t\tне изменять инструкции сравнение-и-ветвление для\n" +"\t\t\tдлинных смещений\n" + +#: config/tc-i960.c:2145 +msgid "should have 1 or 2 operands" +msgstr "должен быть 1 или 2 операнда" -#: config/tc-d30v.c:367 -msgid "unexpected 12-bit reloc type" -msgstr "" +#: config/tc-i960.c:2153 config/tc-i960.c:2168 +#, c-format +msgid "Redefining leafproc %s" +msgstr "Переопределение leafproc %s" -#: config/tc-d30v.c:374 -msgid "unexpected 18-bit reloc type" -msgstr "" +#: config/tc-i960.c:2198 +msgid "should have two operands" +msgstr "должен быть два операнда" + +#: config/tc-i960.c:2208 +msgid "'entry_num' must be absolute number in [0,31]" +msgstr "«entry_num» должен указываться как абсолютное чисто в диапазоне [0,31]" -#: config/tc-d30v.c:624 +#: config/tc-i960.c:2216 #, c-format -msgid "%s NOP inserted" -msgstr "" +msgid "Redefining entrynum for sysproc %s" +msgstr "Переопределение entrynum для sysproc %s" -#: config/tc-d30v.c:625 -msgid "sequential" -msgstr "" +#. Should not happen: see block comment above. +#: config/tc-i960.c:2316 +#, c-format +msgid "Trying to 'bal' to %s" +msgstr "Попытка применить «bal» к %s" -#: config/tc-d30v.c:625 -msgid "parallel" -msgstr "" +#: config/tc-i960.c:2326 +msgid "Looks like a proc, but can't tell what kind.\n" +msgstr "Выглядит как proc, но невозможно сказать какая.\n" -#: config/tc-d30v.c:1032 -msgid "Instructions may not be executed in parallel" -msgstr "" +#: config/tc-i960.c:2344 +msgid "big endian mode is not supported" +msgstr "прямой порядок байт не поддерживается" -#: config/tc-d30v.c:1045 +#: config/tc-i960.c:2346 #, c-format -msgid "Executing %s in IU may not work" -msgstr "" +msgid "ignoring unrecognized .endian type `%s'" +msgstr "игнорируется нераспознанный тип .endian «%s»" -#: config/tc-d30v.c:1052 -#, c-format -msgid "Executing %s in IU may not work in parallel execution" -msgstr "" +#: config/tc-i960.c:2391 +msgid "can't use COBR format with external label" +msgstr "невозможно использовать формат COBR с внешней меткой" -#: config/tc-d30v.c:1065 -#, c-format -msgid "special left instruction `%s' kills instruction `%s' in right container" -msgstr "" +#: config/tc-i960.c:2566 +msgid "option --link-relax is only supported in b.out format" +msgstr "параметр --link-relax поддерживается только в формате b.out" -#: config/tc-d30v.c:1076 +#: config/tc-i960.c:2593 #, c-format -msgid "Executing %s in reverse serial with %s may not work" -msgstr "" +msgid "No 'bal' entry point for leafproc %s" +msgstr "Нет точки входа «bal» для leafproc %s" -#: config/tc-d30v.c:1079 -#, c-format -msgid "Executing %s in IU in reverse serial may not work" -msgstr "" +#: config/tc-ia64.c:872 +msgid "bad .section directive: want a,o,s,w,x,M,S,G,T in string" +msgstr "неправильная директива .section: в строке требуется a,o,s,w,x,M,S,G,T" -#: config/tc-d30v.c:1268 -msgid "Odd numbered register used as target of multi-register instruction" -msgstr "" +#: config/tc-ia64.c:924 +msgid "Size of frame exceeds maximum of 96 registers" +msgstr "Размер кадра превышает максимум из 96 регистров" -#: config/tc-d30v.c:1332 config/tc-d30v.c:1367 -#, c-format -msgid "unknown condition code: %s" -msgstr "" +#: config/tc-ia64.c:929 +msgid "Size of rotating registers exceeds frame size" +msgstr "Размер оборачивающихся регистров превышает размер кадра" + +#: config/tc-ia64.c:1016 +msgid "Unwind directive not followed by an instruction." +msgstr "Раскрывающая директива не допускается инструкцией." + +#: config/tc-ia64.c:1025 config/tc-ia64.c:7610 +msgid "qualifying predicate not followed by instruction" +msgstr "уточнение предиката не допускается инструкцией" + +#: config/tc-ia64.c:1073 +msgid "expected ',' after section name" +msgstr "ожидается «,» после имени раздела" + +#: config/tc-ia64.c:1108 +msgid "expected ',' after symbol name" +msgstr "ожидается «,» после имени символа" -#: config/tc-d30v.c:1360 -#, c-format -msgid "cmpu doesn't support condition code %s" -msgstr "" +#: config/tc-ia64.c:1132 +msgid "expected ',' after symbol size" +msgstr "ожидается «,» после размера символа" -#: config/tc-d30v.c:1395 -#, c-format -msgid "unknown opcode: %s" -msgstr "" +#: config/tc-ia64.c:1215 config/tc-ia64.c:1249 +msgid "record type is not valid" +msgstr "недопустимый тип записи" -#: config/tc-d30v.c:1406 -#, c-format -msgid "operands for opcode `%s' do not match any valid format" -msgstr "" +#: config/tc-ia64.c:1318 +msgid "Invalid record type for P3 format." +msgstr "Неверный тип записи для формата P3." -#: config/tc-d30v.c:1621 config/tc-d30v.c:1638 -msgid "Cannot assemble instruction" -msgstr "" +#: config/tc-ia64.c:1354 +msgid "Invalid record type for format P6" +msgstr "Неверный тип записи для формата P6." -#: config/tc-d30v.c:1623 -msgid "First opcode is long. Unable to mix instructions as specified." -msgstr "" +#: config/tc-ia64.c:1534 config/tc-ia64.c:1586 +msgid "Invalid record type for format B1" +msgstr "Неверный тип записи для формата B1." -#: config/tc-d30v.c:1692 -msgid "word of NOPs added between word multiply and load" -msgstr "" +#: config/tc-ia64.c:1619 +msgid "Invalid record type for format X1" +msgstr "Неверный тип записи для формата X1." -#: config/tc-d30v.c:1694 -msgid "word of NOPs added between word multiply and 16-bit multiply" -msgstr "" +#: config/tc-ia64.c:1661 +msgid "Invalid record type for format X3" +msgstr "Неверный тип записи для формата X3." -#: config/tc-d30v.c:1726 -msgid "Instruction uses long version, so it cannot be mixed as specified" -msgstr "" +#: config/tc-ia64.c:1699 +msgid "Previous .save incomplete" +msgstr "Незавершённая предыдущая .save" -#: config/tc-d30v.c:1853 -#, c-format -msgid "value too large to fit in %d bits" -msgstr "" +#: config/tc-ia64.c:2524 +msgid "spill_mask record unimplemented." +msgstr "Запись spill_mask не реализована." -#: config/tc-d30v.c:1914 -#, c-format -msgid "line %d: unable to place address of symbol '%s' into a byte" -msgstr "" +#: config/tc-ia64.c:2581 +msgid "record_type_not_valid" +msgstr "record_type_not_valid" -#: config/tc-d30v.c:1917 -#, c-format -msgid "line %d: unable to place value %lx into a byte" -msgstr "" +#: config/tc-ia64.c:2665 +msgid "Ignoring attempt to spill beyond end of region" +msgstr "Игнорируется попытка вытеснения за конец области" -#: config/tc-d30v.c:1925 -#, c-format -msgid "line %d: unable to place address of symbol '%s' into a short" -msgstr "" +#: config/tc-ia64.c:2724 +msgid "Only constant space allocation is supported" +msgstr "Поддерживается только выделение пространства, заданного константой" -#: config/tc-d30v.c:1928 -#, c-format -msgid "line %d: unable to place value %lx into a short" -msgstr "" +#: config/tc-ia64.c:2738 +msgid "Only constant offsets are supported" +msgstr "Поддерживаются только смещения, заданные константой" -#: config/tc-d30v.c:1936 -#, c-format -msgid "line %d: unable to place address of symbol '%s' into a quad" -msgstr "" +#: config/tc-ia64.c:2762 +msgid "Section switching in code is not supported." +msgstr "Переключение раздела в коде не поддерживается." -#: config/tc-d30v.c:2044 -#, c-format -msgid "Alignment too large: %d assumed" -msgstr "" +#: config/tc-ia64.c:2804 +msgid "Insn slot not set in unwind record." +msgstr "Слот Insn не задан в записи раскрытия." -#: config/tc-dlx.c:212 -msgid "missing .proc" -msgstr "" +#: config/tc-ia64.c:2878 +msgid "frgr_mem record before region record!" +msgstr "Запись frgr_mem до записи области!" -#: config/tc-dlx.c:229 -msgid ".endfunc missing for previous .proc" -msgstr "" +#: config/tc-ia64.c:2889 +msgid "fr_mem record before region record!" +msgstr "Запись fr_mem до записи области!" -#: config/tc-dlx.c:291 config/tc-i860.c:227 config/tc-mips.c:1903 -#, c-format -msgid "internal error: can't hash `%s': %s\n" -msgstr "" +#: config/tc-ia64.c:2898 +msgid "gr_mem record before region record!" +msgstr "Запись gr_mem до записи области!" -#. Probably a memory allocation problem? Give up now. -#: config/tc-dlx.c:298 config/tc-hppa.c:8287 config/tc-mips.c:1906 -#: config/tc-mips.c:1958 config/tc-or32.c:211 config/tc-sparc.c:860 -msgid "Broken assembler. No assembly attempted." -msgstr "" +#: config/tc-ia64.c:2907 +msgid "br_mem record before region record!" +msgstr "Запись br_mem до записи области!" -#: config/tc-dlx.c:328 -#, c-format -msgid "Bad operand for a load instruction: <%s>" -msgstr "" +#: config/tc-ia64.c:2917 +msgid "gr_gr record before region record!" +msgstr "Запись gr_gr до записи области!" -#: config/tc-dlx.c:442 -#, c-format -msgid "Bad operand for a store instruction: <%s>" -msgstr "" +#: config/tc-ia64.c:2925 +msgid "br_gr record before region record!" +msgstr "Запись br_gr до записи области!" -#: config/tc-dlx.c:622 +#: config/tc-ia64.c:3043 #, c-format -msgid "Expression Error for operand modifier %%hi/%%lo\n" -msgstr "" +msgid "First operand to .%s must be a predicate" +msgstr "Первый операнд в .%s должен быть предикатом" -#: config/tc-dlx.c:635 config/tc-or32.c:813 +#: config/tc-ia64.c:3047 #, c-format -msgid "Invalid expression after %%%%\n" -msgstr "" +msgid "Pointless use of p0 as first operand to .%s" +msgstr "Бесцельное использование p0 в первом операнде .%s" -#: config/tc-dlx.c:704 config/tc-tic4x.c:2488 +#: config/tc-ia64.c:3103 #, c-format -msgid "Unknown opcode `%s'." -msgstr "" - -#: config/tc-dlx.c:717 -msgid "Can not set dlx_skip_hi16_flag" -msgstr "" +msgid "Operand %d to .%s must be a preserved register" +msgstr "Операнд %d в .%s должен быть сохранённым регистром" -#: config/tc-dlx.c:731 +#: config/tc-ia64.c:3139 #, c-format -msgid "Missing arguments for opcode <%s>." -msgstr "" +msgid "Operand %d to .%s must be a writable register" +msgstr "Операнд %d в .%s должен быть записываемым регистром" -#: config/tc-dlx.c:765 +#: config/tc-ia64.c:3163 #, c-format -msgid "Too many operands: %s" -msgstr "" +msgid "Radix `%s' unsupported or invalid" +msgstr "Основание «%s» не поддерживается или некорректно" -#: config/tc-dlx.c:802 +#: config/tc-ia64.c:3193 config/tc-ia64.c:3198 #, c-format -msgid "Both the_insn.HI and the_insn.LO are set : %s" -msgstr "" +msgid ".%s outside of %s" +msgstr ".%s вне %s" -#: config/tc-dlx.c:872 -msgid "failed regnum sanity check." -msgstr "" +#: config/tc-ia64.c:3284 +msgid "Tags on unwind pseudo-ops aren't supported, yet" +msgstr "Метки в раскрываемых псевдооперациях пока не поддерживаются" -#: config/tc-dlx.c:885 -msgid "failed general register sanity check." -msgstr "" +#: config/tc-ia64.c:3306 +msgid "First operand to .fframe must be a constant" +msgstr "Первый операнд в .fframe должен быть константой" -#. Types or values of args don't match. -#: config/tc-dlx.c:893 -msgid "Invalid operands" -msgstr "" +#: config/tc-ia64.c:3326 +msgid "First operand to .vframe must be a general register" +msgstr "Первый операнд .vframe должен быть обычным регистром" -#: config/tc-dlx.c:1120 config/tc-or32.c:775 -#, c-format -msgid "label \"$%d\" redefined" -msgstr "" +#: config/tc-ia64.c:3334 +msgid "Operand of .vframe contradicts .prologue" +msgstr "Операнд .vframe противоречит .prologue" -#: config/tc-dlx.c:1158 -msgid "Invalid expression after # number\n" -msgstr "" +#: config/tc-ia64.c:3344 +msgid ".vframepsp is meaningless, assuming .vframesp was meant" +msgstr ".vframepsp не имеет смысла, считаем, что предполагалась .vframesp" -#: config/tc-fr30.c:82 -#, c-format -msgid " FR30 specific command line options:\n" -msgstr "" +#: config/tc-ia64.c:3352 +msgid "Operand to .vframesp must be a constant (sp-relative offset)" +msgstr "Операнд .vframesp должен быть константой (смещение, относительно sp)" -#: config/tc-fr30.c:135 -#, c-format -msgid "Instruction %s not allowed in a delay slot." -msgstr "" +#: config/tc-ia64.c:3379 +msgid "First operand to .save not a register" +msgstr "Первый операнд .save должен быть регистром" -#: config/tc-frv.c:404 -#, c-format -msgid "Unknown cpu -mcpu=%s" -msgstr "" +#: config/tc-ia64.c:3385 +msgid "Second operand to .save not a valid register" +msgstr "Второй операнд .save является неправильным регистром" -#: config/tc-frv.c:457 -#, c-format -msgid "FRV specific command line options:\n" -msgstr "" +#: config/tc-ia64.c:3416 config/tc-ia64.c:3427 config/tc-ia64.c:3435 +msgid "Second operand of .save contradicts .prologue" +msgstr "Второй операнд .save противоречит .prologue" -#: config/tc-frv.c:458 -#, c-format -msgid "-G n Put data <= n bytes in the small data area\n" -msgstr "" +#: config/tc-ia64.c:3442 +msgid "First operand to .save not a valid register" +msgstr "Первый операнд .save является неправильным регистром" -#: config/tc-frv.c:459 -#, c-format -msgid "-mgpr-32 Mark generated file as only using 32 GPRs\n" -msgstr "" +#: config/tc-ia64.c:3460 +msgid "First operand to .restore must be stack pointer (sp)" +msgstr "Первый операнд в .restore должен быть указателем стека (sp)" -#: config/tc-frv.c:460 -#, c-format -msgid "-mgpr-64 Mark generated file as using all 64 GPRs\n" -msgstr "" +#: config/tc-ia64.c:3469 +msgid "Second operand to .restore must be a constant >= 0" +msgstr "Второй операнд .restore должен быть константой >= 0" -#: config/tc-frv.c:461 +#: config/tc-ia64.c:3479 #, c-format -msgid "-mfpr-32 Mark generated file as only using 32 FPRs\n" -msgstr "" +msgid "Epilogue count of %lu exceeds number of nested prologues (%u)" +msgstr "Количество эпилогов %lu превышает количество вложенных прологов (%u)" -#: config/tc-frv.c:462 +#: config/tc-ia64.c:3565 #, c-format -msgid "-mfpr-64 Mark generated file as using all 64 FPRs\n" -msgstr "" +msgid "Illegal section name `%s' (causes unwind section name clash)" +msgstr "Недопустимое имя раздела «%s» (приводит к конфликту раскрываемого имени раздела)" -#: config/tc-frv.c:463 -#, c-format -msgid "-msoft-float Mark generated file as using software FP\n" -msgstr "" +#: config/tc-ia64.c:3742 +msgid "First operand to .altrp not a valid branch register" +msgstr "Первый операнд .altrp является неправильным регистром ветвления" -#: config/tc-frv.c:464 +#: config/tc-ia64.c:3771 #, c-format -msgid "-mdword Mark generated file as using a 8-byte stack alignment\n" -msgstr "" +msgid "First operand to .%s not a register" +msgstr "Первый операнд .%s должен быть регистром" -#: config/tc-frv.c:465 +#: config/tc-ia64.c:3776 #, c-format -msgid "-mno-dword Mark generated file as using a 4-byte stack alignment\n" -msgstr "" +msgid "Second operand to .%s not a constant" +msgstr "Второй операнд .%s должен быть константой" -#: config/tc-frv.c:466 +#: config/tc-ia64.c:3843 #, c-format -msgid "-mdouble Mark generated file as using double precision FP insns\n" -msgstr "" +msgid "First operand to .%s not a valid register" +msgstr "Первый операнд .%s является неправильным регистром" -#: config/tc-frv.c:467 -#, c-format -msgid "-mmedia Mark generated file as using media insns\n" -msgstr "" +#: config/tc-ia64.c:3866 +msgid "First operand to .save.g must be a positive 4-bit constant" +msgstr "Первый операнд .save.g должен быть положительной 4-битной константой" -#: config/tc-frv.c:468 -#, c-format -msgid "-mmuladd Mark generated file as using multiply add/subtract insns\n" -msgstr "" +#: config/tc-ia64.c:3879 +msgid "Second operand to .save.g must be a general register" +msgstr "Второй операнд .save.g должен быть обычным регистром" -#: config/tc-frv.c:469 +#: config/tc-ia64.c:3884 #, c-format -msgid "-mpack Allow instructions to be packed\n" -msgstr "" +msgid "Second operand to .save.g must be the first of %d general registers" +msgstr "Второй операнд .save.g должен быть первым из %d обычных регистров" -#: config/tc-frv.c:470 -#, c-format -msgid "-mno-pack Do not allow instructions to be packed\n" -msgstr "" +#: config/tc-ia64.c:3907 +msgid "Operand to .save.f must be a positive 20-bit constant" +msgstr "Операнд .save.f должен быть положительной 20-битной константой" -#: config/tc-frv.c:471 -#, c-format -msgid "-mpic Mark generated file as using small position independent code\n" -msgstr "" +#: config/tc-ia64.c:3930 +msgid "First operand to .save.b must be a positive 5-bit constant" +msgstr "Первый операнд .save.b должен быть положительной 5-битной константой" -#: config/tc-frv.c:472 -#, c-format -msgid "-mPIC Mark generated file as using large position independent code\n" -msgstr "" +#: config/tc-ia64.c:3943 +msgid "Second operand to .save.b must be a general register" +msgstr "Второй операнд .save.b должен быть обычным регистром" -#: config/tc-frv.c:473 +#: config/tc-ia64.c:3948 #, c-format -msgid "-mlibrary-pic Mark generated file as using position indepedent code for libraries\n" -msgstr "" +msgid "Second operand to .save.b must be the first of %d general registers" +msgstr "Второй операнд .save.b должен быть первым из %d обычных регистров" -#: config/tc-frv.c:474 -#, c-format -msgid "-mfdpic Assemble for the FDPIC ABI\n" -msgstr "" +#: config/tc-ia64.c:3974 +msgid "First operand to .save.gf must be a non-negative 4-bit constant" +msgstr "Первый операнд .save.gf должен быть неотрицательной 4-битной константой" -#: config/tc-frv.c:475 -#, c-format -msgid "-mnopic Disable -mpic, -mPIC, -mlibrary-pic and -mfdpic\n" -msgstr "" +#: config/tc-ia64.c:3982 +msgid "Second operand to .save.gf must be a non-negative 20-bit constant" +msgstr "Второй операнд .save.gf должен быть неотрицательной 20-битной константой" -#: config/tc-frv.c:476 -#, c-format -msgid "-mcpu={fr500|fr550|fr400|fr405|fr450|fr300|frv|simple|tomcat}\n" -msgstr "" +#: config/tc-ia64.c:3990 +msgid "Operands to .save.gf may not be both zero" +msgstr "Операнды .save.gf не могут быть одновременно равны нулю" -#: config/tc-frv.c:477 -#, c-format -msgid " Record the cpu type\n" -msgstr "" +#: config/tc-ia64.c:4007 +msgid "Operand to .spill must be a constant" +msgstr "Операнд .spill должен быть константой" -#: config/tc-frv.c:478 +#: config/tc-ia64.c:4076 #, c-format -msgid "-mtomcat-stats Print out stats for tomcat workarounds\n" -msgstr "" +msgid "Operand %d to .%s must be a constant" +msgstr "Операнд .%d в .%s должен быть константой" -#: config/tc-frv.c:479 +#: config/tc-ia64.c:4097 #, c-format -msgid "-mtomcat-debug Debug tomcat workarounds\n" -msgstr "" +msgid "Missing .label_state %ld" +msgstr "Отсутствует .label_state %ld" -#: config/tc-frv.c:1163 -msgid "VLIW packing used for -mno-pack" -msgstr "" +#: config/tc-ia64.c:4151 +msgid "Operand to .label_state must be a constant" +msgstr "Операнд .label_state должен быть константой" -#: config/tc-frv.c:1173 -msgid "Instruction not supported by this architecture" -msgstr "" +#: config/tc-ia64.c:4170 +msgid "Operand to .copy_state must be a constant" +msgstr "Операнд .copy_state должен быть константой" -#: config/tc-frv.c:1183 -msgid "VLIW packing constraint violation" -msgstr "" +#: config/tc-ia64.c:4193 +msgid "First operand to .unwabi must be a constant" +msgstr "Первый операнд в .unwabi должен быть константой" -#: config/tc-frv.c:1774 -#, c-format -msgid "Relocation %s is not safe for %s" -msgstr "" +#: config/tc-ia64.c:4199 +msgid "Second operand to .unwabi must be a constant" +msgstr "Второй операнд .unwabi должен быть константой" -#: config/tc-h8300.c:396 config/tc-h8300.c:404 -msgid "Reg not valid for H8/300" -msgstr "" +#: config/tc-ia64.c:4234 +msgid "Missing .endp after previous .proc" +msgstr "Отсутствует .endp после предыдущего .proc" -#: config/tc-h8300.c:485 -msgid "invalid operand size requested" -msgstr "" +#: config/tc-ia64.c:4252 +msgid "Empty argument of .proc" +msgstr "Пустой аргумент .proc" -#: config/tc-h8300.c:584 -msgid "Invalid register list for ldm/stm\n" -msgstr "" +#: config/tc-ia64.c:4257 +#, c-format +msgid "`%s' was already defined" +msgstr "«%s» уже определена" + +#: config/tc-ia64.c:4300 +msgid "Initial .body should precede any instructions" +msgstr "До инструкций должна быть указана .body" -#: config/tc-h8300.c:610 config/tc-h8300.c:615 config/tc-h8300.c:622 -msgid "mismatch between register and suffix" -msgstr "" +#: config/tc-ia64.c:4319 +msgid ".prologue within prologue" +msgstr ".prologue внутри пролога" -#: config/tc-h8300.c:627 -msgid "invalid suffix after register." -msgstr "" +#: config/tc-ia64.c:4324 +msgid "Initial .prologue should precede any instructions" +msgstr "До инструкций должна быть указана .prologue" -#: config/tc-h8300.c:649 -msgid "address too high for vector table jmp/jsr" -msgstr "" +#: config/tc-ia64.c:4334 +msgid "First operand to .prologue must be a positive 4-bit constant" +msgstr "Первый операнд .prologue должен быть положительной 4-битной константой" -#: config/tc-h8300.c:676 config/tc-h8300.c:788 config/tc-h8300.c:798 -msgid "Wrong size pointer register for architecture." -msgstr "" +#: config/tc-ia64.c:4336 +msgid "Pointless use of zero first operand to .prologue" +msgstr "Бесцельное использование нулевого первом операнда .prologue" -#: config/tc-h8300.c:735 config/tc-h8300.c:743 config/tc-h8300.c:772 -msgid "expected @(exp, reg16)" -msgstr "" +#: config/tc-ia64.c:4352 +msgid "Using a constant as second operand to .prologue is deprecated" +msgstr "Использование константы во втором операнде .prologue устарело" -#: config/tc-h8300.c:761 -msgid "expected .L, .W or .B for register in indexed addressing mode" -msgstr "" +#: config/tc-ia64.c:4358 +msgid "Second operand to .prologue must be a general register" +msgstr "Второй операнд .prologue должен быть обычным регистром" -#: config/tc-h8300.c:955 -msgid "expected valid addressing mode for mova: \"@(disp, ea.sz),ERn\"" -msgstr "" +#: config/tc-ia64.c:4363 +#, c-format +msgid "Second operand to .prologue must be the first of %d general registers" +msgstr "Второй операнд .prologue должен быть первым из %d обычных регистров" -#: config/tc-h8300.c:973 config/tc-h8300.c:982 -msgid "expected register" -msgstr "" +#: config/tc-ia64.c:4475 +#, c-format +msgid "`%s' was not defined within procedure" +msgstr "«%s» не определена внутри процедуры" -#: config/tc-h8300.c:998 -msgid "expected closing paren" -msgstr "" +#: config/tc-ia64.c:4511 +msgid "Empty argument of .endp" +msgstr "Пустой аргумент .endp" -#: config/tc-h8300.c:1057 +#: config/tc-ia64.c:4525 #, c-format -msgid "can't use high part of register in operand %d" -msgstr "" +msgid "`%s' was not specified with previous .proc" +msgstr "«%s» не указана с предыдущим .proc" -#: config/tc-h8300.c:1214 +#: config/tc-ia64.c:4540 #, c-format -msgid "Opcode `%s' with these operand types not available in %s mode" -msgstr "" +msgid "`%s' should be an operand to this .endp" +msgstr "«%s» должна быть операндом этого .endp" -#: config/tc-h8300.c:1223 -msgid "mismatch between opcode size and operand size" -msgstr "" +#: config/tc-ia64.c:4581 config/tc-ia64.c:4902 config/tc-ia64.c:5211 +msgid "Comma expected" +msgstr "Ожидается запятая" -#: config/tc-h8300.c:1259 -#, c-format -msgid "operand %s0x%lx out of range." -msgstr "" +#: config/tc-ia64.c:4621 +msgid "Expected '['" +msgstr "Ожидается «[»" -#: config/tc-h8300.c:1366 -msgid "Can't work out size of operand.\n" -msgstr "" +#: config/tc-ia64.c:4630 config/tc-ia64.c:7744 +msgid "Expected ']'" +msgstr "Ожидается «]»" + +#: config/tc-ia64.c:4635 +msgid "Number of elements must be positive" +msgstr "Количество элементов должно быть положительным" -#: config/tc-h8300.c:1415 +#: config/tc-ia64.c:4646 #, c-format -msgid "Opcode `%s' with these operand types not available in H8/300 mode" -msgstr "" +msgid "Used more than the declared %d rotating registers" +msgstr "Используется больше оборачивающихся регистров чем объявлено (%d)" + +#: config/tc-ia64.c:4654 +msgid "Used more than the available 96 rotating registers" +msgstr "Используется больше 96 доступных оборачивающихся регистров" -#: config/tc-h8300.c:1420 +#: config/tc-ia64.c:4661 +msgid "Used more than the available 48 rotating registers" +msgstr "Используется больше 48 доступных оборачивающихся регистров" + +#: config/tc-ia64.c:4689 #, c-format -msgid "Opcode `%s' with these operand types not available in H8/300H mode" -msgstr "" +msgid "Attempt to redefine register set `%s'" +msgstr "Попытка переопределить набор регистров «%s»" -#: config/tc-h8300.c:1426 +#: config/tc-ia64.c:4754 #, c-format -msgid "Opcode `%s' with these operand types not available in H8/300S mode" -msgstr "" +msgid "Unknown psr option `%s'" +msgstr "Неизвестный параметр psr «%s»" -#: config/tc-h8300.c:1487 config/tc-h8300.c:1507 -msgid "Need #1 or #2 here" -msgstr "" +#: config/tc-ia64.c:4788 +msgid "Missing section name" +msgstr "Отсутствует имя раздела" -#: config/tc-h8300.c:1502 -msgid "#4 not valid on H8/300." -msgstr "" +#: config/tc-ia64.c:4797 +msgid "Comma expected after section name" +msgstr "Ожидается «,» после имени раздела" -#: config/tc-h8300.c:1610 config/tc-h8300.c:1692 -#, c-format -msgid "branch operand has odd offset (%lx)\n" -msgstr "" +#: config/tc-ia64.c:4808 +msgid "Creating sections with .xdataN/.xrealN/.xstringZ is deprecated." +msgstr "Создание разделов с .xdataN/.xrealN/.xstringZ устарело." -#: config/tc-h8300.c:1730 -msgid "destination operand must be 16 bit register" -msgstr "" +#: config/tc-ia64.c:4897 +msgid "Register name expected" +msgstr "Ожидается имя регистра" -#: config/tc-h8300.c:1739 -msgid "source operand must be 8 bit register" -msgstr "" +#: config/tc-ia64.c:4910 +msgid "Register value annotation ignored" +msgstr "Пояснение к значению регистра игнорируется" -#: config/tc-h8300.c:1747 -msgid "destination operand must be 16bit absolute address" -msgstr "" +#: config/tc-ia64.c:4949 +msgid "Directive invalid within a bundle" +msgstr "Неправильная директива внутри комплекта" -#: config/tc-h8300.c:1754 -msgid "destination operand must be 8 bit register" -msgstr "" +#: config/tc-ia64.c:5043 +msgid "Missing predicate relation type" +msgstr "Отсутствует тип отношения предиката" -#: config/tc-h8300.c:1762 -msgid "source operand must be 16bit absolute address" -msgstr "" +#: config/tc-ia64.c:5049 +msgid "Unrecognized predicate relation type" +msgstr "Не распознан тип отношения предиката" -#. This seems more sane than saying "too many operands". We'll -#. get here only if the trailing trash starts with a comma. -#. Types or values of args don't match. -#: config/tc-h8300.c:1770 config/tc-mmix.c:472 config/tc-mmix.c:484 -#: config/tc-mmix.c:2500 config/tc-mmix.c:2524 config/tc-mmix.c:2797 -#: config/tc-or32.c:529 -msgid "invalid operands" -msgstr "" +#: config/tc-ia64.c:5095 +msgid "Bad register range" +msgstr "Неверный диапазон регистров" -#: config/tc-h8300.c:1801 -msgid "operand/size mis-match" -msgstr "" +#: config/tc-ia64.c:5104 config/tc-ia64.c:7690 +msgid "Predicate register expected" +msgstr "Ожидается предикатный регистр" -#: config/tc-h8300.c:1902 config/tc-mips.c:10156 config/tc-sh.c:2925 -#: config/tc-sh64.c:2795 config/tc-z8k.c:1226 -msgid "unknown opcode" -msgstr "" +#: config/tc-ia64.c:5109 +msgid "Duplicate predicate register ignored" +msgstr "Повторный предикатный регистр игнорируется" -#: config/tc-h8300.c:1935 -msgid "invalid operand in ldm" -msgstr "" +#: config/tc-ia64.c:5125 +msgid "Predicate source and target required" +msgstr "Требуется предикат источника и назначения" -#: config/tc-h8300.c:1944 -msgid "invalid operand in stm" -msgstr "" +#: config/tc-ia64.c:5127 config/tc-ia64.c:5139 +msgid "Use of p0 is not valid in this context" +msgstr "Использование p0 недопустимо в этом контексте" -#: config/tc-h8300.c:2070 -#, c-format -msgid "call to tc_aout_fix_to_chars \n" -msgstr "" +#: config/tc-ia64.c:5134 +msgid "At least two PR arguments expected" +msgstr "Ожидается не менее двух аргументов PR" -#: config/tc-h8300.c:2079 config/tc-xc16x.c:340 -#, c-format -msgid "call to md_convert_frag \n" -msgstr "" +#: config/tc-ia64.c:5148 +msgid "At least one PR argument expected" +msgstr "Ожидается, как минимум, один аргумент PR" -#: config/tc-h8300.c:2130 config/tc-xc16x.c:244 +#: config/tc-ia64.c:5182 #, c-format -msgid "call to md_estimate_size_before_relax \n" -msgstr "" +msgid "Inserting \"%s\" into entry hint table failed: %s" +msgstr "Не удалось вставить «%s» в таблицу входных подсказок: %s" -#: config/tc-h8300.c:2159 config/tc-xc16x.c:285 -msgid "Difference of symbols in different sections is not supported" -msgstr "" +#. FIXME -- need 62-bit relocation type +#: config/tc-ia64.c:5662 +msgid "62-bit relocation not yet implemented" +msgstr "62-битное перемещение пока не реализовано" -#: config/tc-h8300.c:2181 config/tc-mcore.c:2199 config/tc-microblaze.c:2295 -#: config/tc-pj.c:488 config/tc-sh.c:4377 config/tc-xc16x.c:308 -#, c-format -msgid "Cannot represent relocation type %s" -msgstr "" +#. XXX technically, this is wrong: we should not be issuing warning +#. messages until we're sure this instruction pattern is going to +#. be used! +#: config/tc-ia64.c:5748 +msgid "lower 16 bits of mask ignored" +msgstr "младшие 16 бит маски игнорируются" -#. Simple range checking for FIELD against HIGH and LOW bounds. -#. IGNORE is used to suppress the error message. -#. Variant of CHECK_FIELD for use in md_apply_fix and other places where -#. the current file and line number are not valid. -#: config/tc-hppa.c:1028 config/tc-hppa.c:1042 -#, c-format -msgid "Field out of range [%d..%d] (%d)." -msgstr "" +#: config/tc-ia64.c:5979 +msgid "stride must be a multiple of 64; lower 6 bits ignored" +msgstr "шаг должен быть кратен 64; младшие 6 бит игнорируются" -#. Simple alignment checking for FIELD against ALIGN (a power of two). -#. IGNORE is used to suppress the error message. -#: config/tc-hppa.c:1056 -#, c-format -msgid "Field not properly aligned [%d] (%d)." -msgstr "" +#: config/tc-ia64.c:6097 +msgid "Expected separator `='" +msgstr "Ожидается разделитель «=»" -#: config/tc-hppa.c:1109 -msgid "Missing .exit\n" -msgstr "" +#: config/tc-ia64.c:6131 +msgid "Duplicate equal sign (=) in instruction" +msgstr "Повторный знак равенства (=) в инструкции" -#: config/tc-hppa.c:1112 -msgid "Missing .procend\n" -msgstr "" +#: config/tc-ia64.c:6138 +#, c-format +msgid "Illegal operand separator `%c'" +msgstr "Неверный разделитель операндов «%c»" -#: config/tc-hppa.c:1297 +#: config/tc-ia64.c:6253 #, c-format -msgid "Invalid field selector. Assuming F%%." -msgstr "" +msgid "Operand %u of `%s' should be %s" +msgstr "Операнд %u в «%s» должен быть %s" -#: config/tc-hppa.c:1324 -msgid "Bad segment in expression." -msgstr "" +#: config/tc-ia64.c:6257 +msgid "Wrong number of output operands" +msgstr "Неправильное количество выходных операндов" -#: config/tc-hppa.c:1349 -#, c-format -msgid "Invalid Nullification: (%c)" -msgstr "" +#: config/tc-ia64.c:6259 +msgid "Wrong number of input operands" +msgstr "Неправильное количество входных операндов" -#: config/tc-hppa.c:1419 -msgid "Cannot handle fixup" -msgstr "" +#: config/tc-ia64.c:6261 +msgid "Operand mismatch" +msgstr "Несоответствие операнда" -#: config/tc-hppa.c:1717 +#: config/tc-ia64.c:6343 #, c-format -msgid " -Q ignored\n" -msgstr "" +msgid "Invalid use of `%c%d' as output operand" +msgstr "Некорректное использование «%c%d» как выходного операнда" -#: config/tc-hppa.c:1721 +#: config/tc-ia64.c:6346 #, c-format -msgid " -c print a warning if a comment is found\n" -msgstr "" +msgid "Invalid use of `r%d' as base update address operand" +msgstr "Некорректное использование «r%d» как базового адреса операнда обновления" -#: config/tc-hppa.c:1787 +#: config/tc-ia64.c:6370 #, c-format -msgid "no hppa_fixup entry for fixup type 0x%x" -msgstr "" - -#: config/tc-hppa.c:1966 -msgid "Unknown relocation encountered in md_apply_fix." -msgstr "" +msgid "Invalid duplicate use of `%c%d'" +msgstr "Неверное повторное использование «%c%d»" -#: config/tc-hppa.c:2154 config/tc-hppa.c:2179 +#: config/tc-ia64.c:6377 #, c-format -msgid "Undefined register: '%s'." -msgstr "" +msgid "Invalid simultaneous use of `f%d' and `f%d'" +msgstr "Неправильное одновременное использование «f%d» и «f%d»" -#: config/tc-hppa.c:2213 +#: config/tc-ia64.c:6383 #, c-format -msgid "Non-absolute symbol: '%s'." -msgstr "" +msgid "Dangerous simultaneous use of `f%d' and `f%d'" +msgstr "Опасное одновременное использование «f%d» и «f%d»" -#: config/tc-hppa.c:2228 +#: config/tc-ia64.c:6427 +msgid "Value truncated to 62 bits" +msgstr "Значение обрезается до 62 бит" + +#: config/tc-ia64.c:6495 #, c-format -msgid "Undefined absolute constant: '%s'." -msgstr "" +msgid "Bad operand value: %s" +msgstr "Некорректное значение операнда: %s" -#: config/tc-hppa.c:2259 config/tc-hppa.c:5689 -msgid "could not update architecture and machine" -msgstr "" +#. Give an error if a frag containing code is not aligned to a 16 byte +#. boundary. +#: config/tc-ia64.c:6570 config/tc-ia64.h:177 +msgid "instruction address is not a multiple of 16" +msgstr "Адрес инструкции не кратен 16" -#: config/tc-hppa.c:2297 +#: config/tc-ia64.c:6638 #, c-format -msgid "Invalid FP Compare Condition: %s" -msgstr "" +msgid "`%s' must be last in bundle" +msgstr "«%s» должно быть последним в комплекте" -#: config/tc-hppa.c:2352 +#: config/tc-ia64.c:6670 #, c-format -msgid "Invalid FTEST completer: %s" -msgstr "" +msgid "Internal error: don't know how to force %s to end of instruction group" +msgstr "Внутренняя ошибка: непонятно как добавить %s в конец группы инструкций" -#: config/tc-hppa.c:2418 config/tc-hppa.c:2455 +#: config/tc-ia64.c:6683 #, c-format -msgid "Invalid FP Operand Format: %3s" -msgstr "" - -#: config/tc-hppa.c:2590 -msgid "Bad segment (should be absolute)." -msgstr "" +msgid "`%s' must be last in instruction group" +msgstr "«%s» должна быть последней в группе инструкций" -#: config/tc-hppa.c:2616 -#, c-format -msgid "Invalid argument location: %s\n" -msgstr "" +#: config/tc-ia64.c:6713 +msgid "Label must be first in a bundle" +msgstr "Метка должна быть первой в комплекте" -#: config/tc-hppa.c:2645 -#, c-format -msgid "Invalid argument description: %d" -msgstr "" +#: config/tc-ia64.c:6790 +msgid "hint in B unit may be treated as nop" +msgstr "подсказка в модуле B может восприниматься как nop" -#: config/tc-hppa.c:3473 -msgid "Invalid Indexed Load Completer." -msgstr "" +#: config/tc-ia64.c:6801 +msgid "hint in B unit can't be used" +msgstr "подсказку в модуле B нельзя использовать" -#: config/tc-hppa.c:3478 -msgid "Invalid Indexed Load Completer Syntax." -msgstr "" +#: config/tc-ia64.c:6815 +msgid "emit_one_bundle: unexpected dynamic op" +msgstr "emit_one_bundle: неожиданный динамический операнд" -#: config/tc-hppa.c:3512 -msgid "Invalid Short Load/Store Completer." -msgstr "" +#: config/tc-ia64.c:6940 +#, c-format +msgid "`%s' does not fit into %s template" +msgstr "«%s» не помещается в шаблон %s" -#: config/tc-hppa.c:3572 config/tc-hppa.c:3577 -msgid "Invalid Store Bytes Short Completer" -msgstr "" +#: config/tc-ia64.c:6955 +#, c-format +msgid "`%s' does not fit into bundle" +msgstr "«%s» не помещается в комплект" -#: config/tc-hppa.c:3888 config/tc-hppa.c:3894 -msgid "Invalid left/right combination completer" -msgstr "" +#: config/tc-ia64.c:6967 +#, c-format +msgid "`%s' can't go in %s of %s template" +msgstr "«%s» не может входить в %s шаблона %s" -#: config/tc-hppa.c:3943 config/tc-hppa.c:3950 -msgid "Invalid permutation completer" -msgstr "" +#: config/tc-ia64.c:6973 +msgid "Missing '}' at end of file" +msgstr "Отсутствует «}» в конце файла" -#: config/tc-hppa.c:4050 +#: config/tc-ia64.c:7120 #, c-format -msgid "Invalid Add Condition: %s" +msgid "Unrecognized option '-x%s'" +msgstr "Нераспознанный параметр «-x%s»" + +#: config/tc-ia64.c:7147 +msgid "" +"IA-64 options:\n" +" --mconstant-gp\t mark output file as using the constant-GP model\n" +"\t\t\t (sets ELF header flag EF_IA_64_CONS_GP)\n" +" --mauto-pic\t\t mark output file as using the constant-GP model\n" +"\t\t\t without function descriptors (sets ELF header flag\n" +"\t\t\t EF_IA_64_NOFUNCDESC_CONS_GP)\n" +" -milp32|-milp64|-mlp64|-mp64\tselect data model (default -mlp64)\n" +" -mle | -mbe\t\t select little- or big-endian byte order (default -mle)\n" +" -mtune=[itanium1|itanium2]\n" +"\t\t\t tune for a specific CPU (default -mtune=itanium2)\n" +" -munwind-check=[warning|error]\n" +"\t\t\t unwind directive check (default -munwind-check=warning)\n" +" -mhint.b=[ok|warning|error]\n" +"\t\t\t hint.b check (default -mhint.b=error)\n" +" -x | -xexplicit\t turn on dependency violation checking\n" msgstr "" +"Параметры IA-64:\n" +" --mconstant-gp\t помечать выходной файл как использующий\n" +"\t\t\t модель константный-GP\n" +"\t\t\t (устанавливается флаг EF_IA_64_CONS_GP в заголовке ELF)\n" +" --mauto-pic\t\t помечать выходной файл как использующий\n" +"\t\t\t модель константный-GP\n" +"\t\t\t без функциональных дескрипторов (устанавливается\n" +"\t\t\t флаг EF_IA_64_NOFUNCDESC_CONS_GP в заголовке ELF)\n" +" -milp32|-milp64|-mlp64|-mp64\tзадать модель данных (по умолчанию -mlp64)\n" +" -mle | -mbe\t\t задать обратный- или прямой- порядок байт\n" +"\t\t\t (по умолчанию -mle)\n" +" -mtune=[itanium1|itanium2]\n" +"\t\t\t настройка по конкретный ЦП (по умолчанию -mtune=itanium2)\n" +" -munwind-check=[warning|error]\n" +"\t\t\t раскрывать проверку директив (по умолчанию -munwind-check=warning)\n" +" -mhint.b=[ok|warning|error]\n" +"\t\t\t проверка hint.b (по умолчанию -mhint.b=error)\n" +" -x | -xexplicit\t включить проверку нарушений зависимостей\n" -#: config/tc-hppa.c:4061 config/tc-hppa.c:4071 -msgid "Invalid Add and Branch Condition" +#. Note for translators: "automagically" can be translated as "automatically" here. +#: config/tc-ia64.c:7164 +msgid "" +" -xauto\t\t automagically remove dependency violations (default)\n" +" -xnone\t\t turn off dependency violation checking\n" +" -xdebug\t\t debug dependency violation checker\n" +" -xdebugn\t\t debug dependency violation checker but turn off\n" +"\t\t\t dependency violation checking\n" +" -xdebugx\t\t debug dependency violation checker and turn on\n" +"\t\t\t dependency violation checking\n" msgstr "" +" -xauto\t\t автоматически удалять нарушения зависимостей (по умолчанию)\n" +" -xnone\t\t выключить проверку нарушений зависимостей\n" +" -xdebug\t\t отладка проверяльщика нарушений зависимостей\n" +" -xdebugn\t\t отладка проверяльщика нарушений зависимостей, выключить\n" +"\t\t\t проверку нарушений зависимостей\n" +" -xdebugx\t\t отладка проверяльщика нарушений зависимостей, но включить\n" +"\t\t\t проверку нарушений зависимостей\n" -#: config/tc-hppa.c:4092 config/tc-hppa.c:4229 -msgid "Invalid Compare/Subtract Condition" -msgstr "" +#: config/tc-ia64.c:7179 +msgid "--gstabs is not supported for ia64" +msgstr "--gstabs не поддерживается для ia64" -#: config/tc-hppa.c:4132 +#: config/tc-ia64.c:7417 #, c-format -msgid "Invalid Bit Branch Condition: %c" -msgstr "" +msgid "ia64.md_begin: can't hash `%s': %s" +msgstr "ia64.md_begin: невозможно получить хеш «%s»: %s" -#: config/tc-hppa.c:4217 +#: config/tc-ia64.c:7481 #, c-format -msgid "Invalid Compare/Subtract Condition: %s" -msgstr "" - -#: config/tc-hppa.c:4244 -msgid "Invalid Compare and Branch Condition" -msgstr "" +msgid "Inserting \"%s\" into constant hash table failed: %s" +msgstr "Не удалось вставить «%s» в таблицу хешей констант: %s" -#: config/tc-hppa.c:4340 -msgid "Invalid Logical Instruction Condition." -msgstr "" +#: config/tc-ia64.c:7493 config/tc-riscv.c:609 config/tc-tilegx.c:263 +msgid "Could not set architecture and machine" +msgstr "Не задана архитектура и машина" -#: config/tc-hppa.c:4398 -msgid "Invalid Shift/Extract/Deposit Condition." -msgstr "" +#: config/tc-ia64.c:7625 +msgid "Explicit stops are ignored in auto mode" +msgstr "Явные остановки игнорируются в автоматическом режиме" -#: config/tc-hppa.c:4510 -msgid "Invalid Unit Instruction Condition." -msgstr "" +#: config/tc-ia64.c:7634 +msgid "Found '{' when manual bundling is already turned on" +msgstr "Найдена «{», но уже включено ручное комплектование" -#: config/tc-hppa.c:4985 config/tc-hppa.c:5017 config/tc-hppa.c:5048 -#: config/tc-hppa.c:5078 -msgid "Branch to unaligned address" -msgstr "" +#: config/tc-ia64.c:7647 +msgid "Found '{' after explicit switch to automatic mode" +msgstr "Найдена «{», после явного переключения в автоматический режим" -#: config/tc-hppa.c:5262 -msgid "Invalid SFU identifier" -msgstr "" +#: config/tc-ia64.c:7653 +msgid "Found '}' when manual bundling is off" +msgstr "Найдена «}», но уже выключено ручное комплектование" -#: config/tc-hppa.c:5312 -msgid "Invalid COPR identifier" -msgstr "" +#: config/tc-ia64.c:7680 +msgid "Expected ')'" +msgstr "Ожидается «)»" -#: config/tc-hppa.c:5441 -msgid "Invalid Floating Point Operand Format." -msgstr "" +#: config/tc-ia64.c:7685 +msgid "Qualifying predicate expected" +msgstr "Ожидается уточняющий предикат" -#: config/tc-hppa.c:5558 config/tc-hppa.c:5578 config/tc-hppa.c:5598 -#: config/tc-hppa.c:5618 config/tc-hppa.c:5638 -msgid "Invalid register for single precision fmpyadd or fmpysub" -msgstr "" +#: config/tc-ia64.c:7704 +msgid "Tag must come before qualifying predicate." +msgstr "Метка должна указываться до уточняющего предиката." -#: config/tc-hppa.c:5706 -#, c-format -msgid "Invalid operands %s" -msgstr "" +#: config/tc-ia64.c:7733 +msgid "Expected ':'" +msgstr "Ожидается «:»" -#: config/tc-hppa.c:5716 -#, c-format -msgid "Immediates %d and %d will give undefined behavior." -msgstr "" +#: config/tc-ia64.c:7749 +msgid "Tag name expected" +msgstr "Ожидается имя метки" -#: config/tc-hppa.c:5768 config/tc-hppa.c:6956 config/tc-hppa.c:7011 -msgid "Missing function name for .PROC (corrupted label chain)" -msgstr "" +#: config/tc-ia64.c:7850 +msgid "Rotating register index must be a non-negative constant" +msgstr "Индекс оборачивающегося регистра должен быть неотрицательной константой" -#: config/tc-hppa.c:5771 config/tc-hppa.c:7014 -msgid "Missing function name for .PROC" -msgstr "" +#: config/tc-ia64.c:7855 +#, c-format +msgid "Index out of range 0..%u" +msgstr "Индекс вне диапазона 0..%u" -#: config/tc-hppa.c:5830 -msgid "Argument to .BLOCK/.BLOCKZ must be between 0 and 0x3fffffff" -msgstr "" +#: config/tc-ia64.c:7867 +msgid "Indirect register index must be a general register" +msgstr "Индекс неявного регистра должен быть обычным регистром" -#: config/tc-hppa.c:5926 -#, c-format -msgid "Invalid .CALL argument: %s" -msgstr "" +#: config/tc-ia64.c:7876 +msgid "Index can only be applied to rotating or indirect registers" +msgstr "Индекс может применяться только к оборачивающимся или неявным регистрам" -#: config/tc-hppa.c:6042 -msgid ".callinfo is not within a procedure definition" -msgstr "" +#: config/tc-ia64.c:7912 config/tc-xstormy16.c:145 +msgid "Expected '('" +msgstr "Ожидается «(»" -#: config/tc-hppa.c:6062 -#, c-format -msgid "FRAME parameter must be a multiple of 8: %d\n" -msgstr "" +#: config/tc-ia64.c:7920 config/tc-pdp11.c:445 config/tc-pdp11.c:509 +#: config/tc-pdp11.c:543 config/tc-tilegx.c:1047 config/tc-tilepro.c:938 +#: config/tc-xstormy16.c:154 +msgid "Missing ')'" +msgstr "Отсутствует «)»" -#: config/tc-hppa.c:6081 -msgid "Value for ENTRY_GR must be in the range 3..18\n" -msgstr "" +#: config/tc-ia64.c:7938 config/tc-xstormy16.c:161 +msgid "Not a symbolic expression" +msgstr "Не является символическим выражением" -#: config/tc-hppa.c:6093 -msgid "Value for ENTRY_FR must be in the range 12..21\n" -msgstr "" +#: config/tc-ia64.c:7943 config/tc-ia64.c:7957 +msgid "Illegal combination of relocation functions" +msgstr "Неправильная комбинация перемещаемых функций" -#: config/tc-hppa.c:6103 -msgid "Value for ENTRY_SR must be 3\n" -msgstr "" +#: config/tc-ia64.c:8046 +msgid "No current frame" +msgstr "Нет текущего фрейма" -#: config/tc-hppa.c:6159 +#: config/tc-ia64.c:8048 #, c-format -msgid "Invalid .CALLINFO argument: %s" -msgstr "" +msgid "Register number out of range 0..%u" +msgstr "Номер регистра вне диапазона 0..%u" -#: config/tc-hppa.c:6269 -msgid "The .ENTER pseudo-op is not supported" -msgstr "" +#: config/tc-ia64.c:8087 +msgid "Standalone `#' is illegal" +msgstr "Самостоятельный «#» недопустим" -#: config/tc-hppa.c:6285 -msgid "Misplaced .entry. Ignored." -msgstr "" +#: config/tc-ia64.c:8090 +msgid "Redundant `#' suffix operators" +msgstr "Избыточные суффиксы операторов «#»" -#: config/tc-hppa.c:6289 -msgid "Missing .callinfo." -msgstr "" +#: config/tc-ia64.c:8248 +#, c-format +msgid "Unhandled dependency %s for %s (%s), note %d" +msgstr "Необработанная зависимость %s для %s (%s), упоминается %d" -#: config/tc-hppa.c:6353 -msgid ".REG expression must be a register" -msgstr "" +#: config/tc-ia64.c:9561 +#, c-format +msgid "Unrecognized dependency specifier %d\n" +msgstr "Нераспознанный определитель зависимости %d\n" -#: config/tc-hppa.c:6369 -msgid "bad or irreducible absolute expression; zero assumed" -msgstr "" +#: config/tc-ia64.c:10431 +msgid "Only the first path encountering the conflict is reported" +msgstr "Сообщается только о первом пути обнаруженного конфликта" -#: config/tc-hppa.c:6380 -msgid ".REG must use a label" -msgstr "" +#: config/tc-ia64.c:10433 +msgid "This is the location of the conflicting usage" +msgstr "Вот расположение конфликтного использования" -#: config/tc-hppa.c:6382 -msgid ".EQU must use a label" -msgstr "" +#: config/tc-ia64.c:10695 +#, c-format +msgid "Unknown opcode `%s'" +msgstr "Неизвестный код операции «%s»" -#: config/tc-hppa.c:6444 +#: config/tc-ia64.c:10773 #, c-format -msgid "Symbol '%s' could not be created." -msgstr "" +msgid "AR %d can only be accessed by %c-unit" +msgstr "AR %d доступен только из %c-модуля" -#: config/tc-hppa.c:6448 -msgid "No memory for symbol name." -msgstr "" +#: config/tc-ia64.c:10785 +msgid "hint.b may be treated as nop" +msgstr "hint.b может восприниматься как nop" -#: config/tc-hppa.c:6497 -msgid ".EXIT must appear within a procedure" -msgstr "" +#: config/tc-ia64.c:10788 +msgid "hint.b shouldn't be used" +msgstr "hint.b не должен использоваться" -#: config/tc-hppa.c:6501 -msgid "Missing .callinfo" -msgstr "" +#: config/tc-ia64.c:10827 +#, c-format +msgid "`%s' cannot be predicated" +msgstr "у «%s» не может быть предиката" -#: config/tc-hppa.c:6505 -msgid "No .ENTRY for this .EXIT" -msgstr "" +#: config/tc-ia64.c:10899 +msgid "Closing bracket missing" +msgstr "Отсутствует закрывающая квадратная скобка" -#: config/tc-hppa.c:6545 -#, c-format -msgid "Using ENTRY rather than CODE in export directive for %s" -msgstr "" +#: config/tc-ia64.c:10908 +msgid "Index must be a general register" +msgstr "Индекс должен быть обычным регистром" -#: config/tc-hppa.c:6662 +#: config/tc-ia64.c:11073 #, c-format -msgid "Undefined .EXPORT/.IMPORT argument (ignored): %s" -msgstr "" +msgid "Unsupported fixup size %d" +msgstr "Неподдерживаемый размер местоположения %d" -#: config/tc-hppa.c:6686 +#. This should be an error, but since previously there wasn't any +#. diagnostic here, don't make it fail because of this for now. +#: config/tc-ia64.c:11345 #, c-format -msgid "Cannot define export symbol: %s\n" -msgstr "" - -#: config/tc-hppa.c:6783 -msgid "Missing label name on .LABEL" -msgstr "" - -#: config/tc-hppa.c:6788 -msgid "extra .LABEL arguments ignored." -msgstr "" +msgid "Cannot express %s%d%s relocation" +msgstr "Невозможно выразить перемещение %s%d%s" -#: config/tc-hppa.c:6804 -msgid "The .LEAVE pseudo-op is not supported" -msgstr "" +#: config/tc-ia64.c:11364 +msgid "No addend allowed in @fptr() relocation" +msgstr "Дополнение недопустимо в перемещении @fptr()" -#: config/tc-hppa.c:6842 -msgid "Unrecognized .LEVEL argument\n" -msgstr "" +#: config/tc-ia64.c:11403 +msgid "integer operand out of range" +msgstr "Операнд целого вне диапазона" -#: config/tc-hppa.c:6876 +#: config/tc-ia64.c:11470 #, c-format -msgid "Cannot define static symbol: %s\n" -msgstr "" - -#: config/tc-hppa.c:6910 -msgid "Nested procedures" -msgstr "" - -#: config/tc-hppa.c:6920 -msgid "Cannot allocate unwind descriptor\n" -msgstr "" +msgid "%s must have a constant value" +msgstr "%s должен быть константным значением" -#: config/tc-hppa.c:7018 -msgid "misplaced .procend" -msgstr "" +#: config/tc-ia64.c:11490 +msgid "cannot resolve @slotcount parameter" +msgstr "невозможно определить параметр @slotcount" -#: config/tc-hppa.c:7021 -msgid "Missing .callinfo for this procedure" -msgstr "" +#: config/tc-ia64.c:11523 +msgid "invalid @slotcount value" +msgstr "недопустимое значение @slotcount" -#: config/tc-hppa.c:7024 -msgid "Missing .EXIT for a .ENTRY" -msgstr "" +#: config/tc-ia64.c:11560 config/tc-z8k.c:1378 +#, c-format +msgid "Cannot represent %s relocation in object file" +msgstr "Невозможно представить перемещение %s в объектном файле" -#: config/tc-hppa.c:7061 -msgid "Not in a space.\n" -msgstr "" +#: config/tc-ia64.c:11671 +msgid "Can't add stop bit to mark end of instruction group" +msgstr "Невозможно добавить бит остановки для отметки конца группы инструкций" -#: config/tc-hppa.c:7064 -msgid "Not in a subspace.\n" -msgstr "" +#: config/tc-ia64.c:11780 read.c:2599 read.c:3308 read.c:3660 stabs.c:464 +#, c-format +msgid "expected comma after \"%s\"" +msgstr "ожидается запятая после «%s»" -#: config/tc-hppa.c:7153 -msgid "Invalid .SPACE argument" -msgstr "" +#: config/tc-ia64.c:11822 +#, c-format +msgid "`%s' is already the alias of %s `%s'" +msgstr "«%s» уже является псевдонимом %s «%s»" -#: config/tc-hppa.c:7199 -msgid "Can't change spaces within a procedure definition. Ignored" -msgstr "" +#: config/tc-ia64.c:11832 +#, c-format +msgid "%s `%s' already has an alias `%s'" +msgstr "%s «%s» уже имеет псевдоним «%s»" -#: config/tc-hppa.c:7327 +#: config/tc-ia64.c:11843 #, c-format -msgid "Undefined space: '%s' Assuming space number = 0." -msgstr "" +msgid "inserting \"%s\" into %s alias hash table failed: %s" +msgstr "не удалось вставить «%s» в таблицу хешей псевдонимов %s: %s" -#: config/tc-hppa.c:7350 -msgid "Must be in a space before changing or declaring subspaces.\n" -msgstr "" +#: config/tc-ia64.c:11851 +#, c-format +msgid "inserting \"%s\" into %s name hash table failed: %s" +msgstr "не удалось вставить «%s» в таблицу хешей имён %s: %s" -#: config/tc-hppa.c:7354 -msgid "Can't change subspaces within a procedure definition. Ignored" -msgstr "" +#: config/tc-ia64.c:11877 +#, c-format +msgid "symbol `%s' aliased to `%s' is not used" +msgstr "символ «%s», являющийся псевдонимом «%s», не используется" -#: config/tc-hppa.c:7390 -msgid "Parameters of an existing subspace can't be modified" -msgstr "" +#: config/tc-ia64.c:11900 +#, c-format +msgid "section `%s' aliased to `%s' is not used" +msgstr "раздел «%s», являющийся псевдонимом «%s», не используется" -#: config/tc-hppa.c:7442 -msgid "Alignment must be a power of 2" -msgstr "" +#: config/tc-ip2k.c:139 +#, c-format +msgid "IP2K specific command line options:\n" +msgstr "Специализированные параметры командной строки для IP2K:\n" -#: config/tc-hppa.c:7489 -msgid "FIRST not supported as a .SUBSPACE argument" -msgstr "" +#: config/tc-ip2k.c:140 +#, c-format +msgid " -mip2022 restrict to IP2022 insns \n" +msgstr " -mip2022 ограничиться инструкциями IP2022\n" -#: config/tc-hppa.c:7491 -msgid "Invalid .SUBSPACE argument" -msgstr "" +#: config/tc-ip2k.c:141 +#, c-format +msgid " -mip2022ext permit extended IP2022 insn\n" +msgstr " -mip2022ext разрешить расширенные инструкции IP2022\n" -#: config/tc-hppa.c:7680 +#: config/tc-iq2000.c:362 #, c-format -msgid "Internal error: Unable to find containing space for %s." -msgstr "" +msgid "the yielding instruction %s may not be in a delay slot." +msgstr "Инструкция вызова %s может не допускаться в слоте задержки." -#: config/tc-hppa.c:7718 +#: config/tc-iq2000.c:370 #, c-format -msgid "Out of memory: could not allocate new space chain entry: %s\n" -msgstr "" +msgid "Register number (R%ld) for double word access must be even." +msgstr "Номер регистра (R%ld) для доступа к двойному слову должен быть чётным." -#: config/tc-hppa.c:7806 +#: config/tc-iq2000.c:379 config/tc-iq2000.c:384 config/tc-iq2000.c:389 +#: config/tc-iq2000.c:406 config/tc-mt.c:244 config/tc-mt.c:249 #, c-format -msgid "Out of memory: could not allocate new subspace chain entry: %s\n" -msgstr "" +msgid "operand references R%ld of previous load." +msgstr "операнд ссылается не R%ld предыдущей загрузки." -#: config/tc-hppa.c:8251 -msgid "-R option not supported on this target." -msgstr "" +#: config/tc-iq2000.c:394 +msgid "instruction implicitly accesses R31 of previous load." +msgstr "инструкция неявно обращается к R31 предыдущей загрузки." -#: config/tc-hppa.c:8268 config/tc-sparc.c:815 config/tc-sparc.c:852 -#, c-format -msgid "Internal error: can't hash `%s': %s\n" -msgstr "" +#: config/tc-iq2000.c:649 config/tc-mep.c:2008 +msgid "Unmatched high relocation" +msgstr "Непарное верхнее перемещение" -#: config/tc-hppa.c:8277 config/tc-i860.c:236 -#, c-format -msgid "internal error: losing opcode: `%s' \"%s\"\n" -msgstr "" +#: config/tc-iq2000.c:826 config/tc-mips.c:19372 config/tc-score.c:5814 +msgid ".end not in text section" +msgstr ".end указана не в текстовом разделе" -#: config/tc-i370.c:419 config/tc-ppc.c:1141 config/tc-s390.c:404 -#: config/tc-s390.c:411 -#, c-format -msgid "invalid switch -m%s" -msgstr "" +#: config/tc-iq2000.c:830 config/tc-score.c:5817 +msgid ".end directive without a preceding .ent directive." +msgstr "Директива .end без предшествующей директивы .ent." -#: config/tc-i370.c:516 config/tc-s390.c:510 -#, c-format -msgid "Internal assembler error for instruction %s" -msgstr "" +#: config/tc-iq2000.c:839 config/tc-score.c:5825 +msgid ".end symbol does not match .ent symbol." +msgstr "Символ .end не совпадает с соответствующим символом .ent." + +#: config/tc-iq2000.c:842 config/tc-mips.c:19392 config/tc-score.c:5830 +msgid ".end directive missing or unknown symbol" +msgstr "Отсутствует директива .end или символ неизвестен" + +#: config/tc-iq2000.c:860 +msgid "Expected simple number." +msgstr "Ожидается простое число." -#: config/tc-i370.c:535 +#: config/tc-iq2000.c:889 config/tc-mips.c:19297 config/tc-score.c:5666 #, c-format -msgid "Internal assembler error for macro %s" -msgstr "" +msgid " *input_line_pointer == '%c' 0x%02x\n" +msgstr " *input_line_pointer == «%c» 0x%02x\n" -#: config/tc-i370.c:630 config/tc-ppc.c:1839 -msgid "identifier+constant@got means identifier@got+constant" -msgstr "" +#: config/tc-iq2000.c:891 +msgid "Invalid number" +msgstr "Неверный номер" + +#: config/tc-iq2000.c:925 config/tc-score.c:5704 +msgid ".ent or .aent not in text section." +msgstr ".ent или .aent не в текстовом разделе." -#: config/tc-i370.c:684 config/tc-m68k.c:8030 config/tc-ppc.c:1928 +#: config/tc-iq2000.c:928 +msgid "missing `.end'" +msgstr "отсутствует «.end»" + +#: config/tc-m32c.c:142 #, c-format -msgid "%s relocations do not fit in %d bytes\n" -msgstr "" +msgid " M32C specific command line options:\n" +msgstr " Специализированные параметры командной строки для M32C:\n" -#: config/tc-i370.c:925 config/tc-i370.c:969 -msgid "unsupported DC type" +#. Pretend that we do not recognise this option. +#: config/tc-m32r.c:330 +msgid "Unrecognised option: -hidden" msgstr "" -#: config/tc-i370.c:939 config/tc-i370.c:951 config/tc-i370.c:1532 -#: config/tc-i370.c:1542 -msgid "missing end-quote" +#: config/tc-m32r.c:357 config/tc-sparc.c:651 +msgid "Unrecognized option following -K" msgstr "" -#: config/tc-i370.c:999 -msgid "unsupported alignment" +#: config/tc-m32r.c:372 +#, c-format +msgid " M32R specific command line options:\n" +msgstr " Специализированные параметры командной строки для M32R:\n" + +#: config/tc-m32r.c:374 +#, c-format +msgid " -m32r disable support for the m32rx instruction set\n" msgstr "" -#: config/tc-i370.c:1006 -msgid "this DS form not yet supported" +#: config/tc-m32r.c:376 +#, c-format +msgid " -m32rx support the extended m32rx instruction set\n" msgstr "" -#: config/tc-i370.c:1049 config/tc-m32r.c:1493 config/tc-microblaze.c:179 -#: config/tc-ppc.c:1992 config/tc-ppc.c:4596 -msgid "Expected comma after symbol-name: rest of line ignored." +#: config/tc-m32r.c:378 +#, c-format +msgid " -m32r2 support the extended m32r2 instruction set\n" msgstr "" -#: config/tc-i370.c:1072 config/tc-m32r.c:1517 config/tc-microblaze.c:201 -#: config/tc-ppc.c:2014 config/tc-ppc.c:3215 config/tc-ppc.c:4620 -msgid "ignoring bad alignment" +#: config/tc-m32r.c:380 +#, c-format +msgid " -EL,-little produce little endian code and data\n" msgstr "" -#: config/tc-i370.c:1083 config/tc-m32r.c:1544 config/tc-microblaze.c:212 -#: config/tc-ppc.c:2025 config/tc-ppc.c:4632 +#: config/tc-m32r.c:382 #, c-format -msgid "Ignoring attempt to re-define symbol `%s'." +msgid " -EB,-big produce big endian code and data\n" msgstr "" -#: config/tc-i370.c:1091 config/tc-microblaze.c:220 config/tc-ppc.c:2033 +#: config/tc-m32r.c:384 #, c-format -msgid "Length of .lcomm \"%s\" is already %ld. Not changed to %ld." +msgid " -parallel try to combine instructions in parallel\n" msgstr "" -#: config/tc-i370.c:1110 config/tc-m32r.c:1529 config/tc-microblaze.c:238 -#: config/tc-ppc.c:2051 config/tc-v850.c:322 -msgid "Common alignment not a power of 2" +#: config/tc-m32r.c:386 +#, c-format +msgid " -no-parallel disable -parallel\n" msgstr "" -#: config/tc-i370.c:1248 -msgid "Missing or bad .using directive" +#: config/tc-m32r.c:388 +#, c-format +msgid " -no-bitinst disallow the M32R2's extended bit-field instructions\n" msgstr "" -#: config/tc-i370.c:1293 -msgid "Literal Pool Overflow" +#: config/tc-m32r.c:390 +#, c-format +msgid " -O try to optimize code. Implies -parallel\n" msgstr "" -#: config/tc-i370.c:1589 -msgid "expression not a constant" +#: config/tc-m32r.c:393 +#, c-format +msgid " -warn-explicit-parallel-conflicts warn when parallel instructions\n" msgstr "" -#: config/tc-i370.c:1596 -msgid "Unknown/unsupported address literal type" -msgstr "" +#: config/tc-m32r.c:395 +#, fuzzy, c-format +#| msgid " emulate output (default %s)\n" +msgid " might violate constraints\n" +msgstr " эмулировать вывод (по умолчанию %s)\n" -#: config/tc-i370.c:1619 +#: config/tc-m32r.c:397 #, c-format -msgid ".ltorg without prior .using in section %s" +msgid " -no-warn-explicit-parallel-conflicts do not warn when parallel\n" msgstr "" -#: config/tc-i370.c:1623 +#: config/tc-m32r.c:399 +#, fuzzy, c-format +#| msgid " -R fold data section into text section\n" +msgid " instructions might violate constraints\n" +msgstr " -R поместить раздел данных в раздел текста\n" + +#: config/tc-m32r.c:401 #, c-format -msgid ".ltorg in section %s paired to .using in section %s" +msgid " -Wp synonym for -warn-explicit-parallel-conflicts\n" msgstr "" -#: config/tc-i370.c:1646 +#: config/tc-m32r.c:403 #, c-format -msgid "bad alignment of %d bytes in literal pool" +msgid " -Wnp synonym for -no-warn-explicit-parallel-conflicts\n" msgstr "" -#: config/tc-i370.c:1670 -msgid "bad literal size\n" +#: config/tc-m32r.c:405 +#, c-format +msgid " -ignore-parallel-conflicts do not check parallel instructions\n" msgstr "" -#: config/tc-i370.c:1744 -msgid ".using: base address expression illegal or too complex" -msgstr "" +#: config/tc-m32r.c:407 +#, fuzzy, c-format +#| msgid " -R fold data section into text section\n" +msgid " for constraint violations\n" +msgstr " -R поместить раздел данных в раздел текста\n" -#: config/tc-i370.c:1779 config/tc-i370.c:1788 +#: config/tc-m32r.c:409 #, c-format -msgid "droping register %d in section %s does not match using register %d" +msgid " -no-ignore-parallel-conflicts check parallel instructions for\n" msgstr "" -#: config/tc-i370.c:1792 +#: config/tc-m32r.c:411 +#, fuzzy, c-format +#| msgid " -R fold data section into text section\n" +msgid " constraint violations\n" +msgstr " -R поместить раздел данных в раздел текста\n" + +#: config/tc-m32r.c:413 #, c-format -msgid "droping register %d in section %s previously used in section %s" +msgid " -Ip synonym for -ignore-parallel-conflicts\n" msgstr "" -#: config/tc-i370.c:1848 config/tc-ppc.c:3030 -msgid "wrong number of operands" +#: config/tc-m32r.c:415 +#, c-format +msgid " -nIp synonym for -no-ignore-parallel-conflicts\n" msgstr "" -#: config/tc-i370.c:1930 config/tc-mn10200.c:898 config/tc-mn10300.c:1249 -#: config/tc-ppc.c:2349 config/tc-s390.c:1544 config/tc-v850.c:1604 +#: config/tc-m32r.c:418 #, c-format -msgid "Unrecognized opcode: `%s'" +msgid " -warn-unmatched-high warn when an (s)high reloc has no matching low reloc\n" msgstr "" -#: config/tc-i370.c:2075 -msgid "not using any base register" +#: config/tc-m32r.c:420 +#, c-format +msgid " -no-warn-unmatched-high do not warn about missing low relocs\n" msgstr "" -#: config/tc-i370.c:2105 +#: config/tc-m32r.c:422 #, c-format -msgid "expecting a register for operand %d" +msgid " -Wuh synonym for -warn-unmatched-high\n" msgstr "" -#. Not used --- don't have any 8 byte instructions. -#: config/tc-i370.c:2226 -msgid "Internal Error: bad instruction length" +#: config/tc-m32r.c:424 +#, c-format +msgid " -Wnuh synonym for -no-warn-unmatched-high\n" msgstr "" -#: config/tc-i386.c:1776 +#: config/tc-m32r.c:427 #, c-format -msgid "%s shortened to %s" +msgid " -KPIC generate PIC\n" msgstr "" -#: config/tc-i386.c:1846 -msgid "same type of prefix used twice" +#: config/tc-m32r.c:846 +msgid "instructions write to the same destination register." msgstr "" -#: config/tc-i386.c:1867 -msgid "64bit mode not supported on this CPU." +#: config/tc-m32r.c:854 +msgid "Instructions do not use parallel execution pipelines." msgstr "" -#: config/tc-i386.c:1871 -msgid "32bit mode not supported on this CPU." +#: config/tc-m32r.c:862 +msgid "Instructions share the same execution pipeline" msgstr "" -#: config/tc-i386.c:1904 -msgid "bad argument to syntax directive." +#: config/tc-m32r.c:927 config/tc-m32r.c:1041 +#, c-format +msgid "not a 16 bit instruction '%s'" msgstr "" -#: config/tc-i386.c:1953 -msgid "bad argument to sse_check directive." +#: config/tc-m32r.c:939 config/tc-m32r.c:1053 config/tc-m32r.c:1237 +#, c-format +msgid "instruction '%s' is for the M32R2 only" msgstr "" -#: config/tc-i386.c:1957 -msgid "missing argument for sse_check directive" +#: config/tc-m32r.c:952 config/tc-m32r.c:1066 config/tc-m32r.c:1250 +#, c-format +msgid "unknown instruction '%s'" msgstr "" -#: config/tc-i386.c:1987 +#: config/tc-m32r.c:961 config/tc-m32r.c:1073 config/tc-m32r.c:1257 #, c-format -msgid "`%s' is not supported on `%s'" +msgid "instruction '%s' is for the M32RX only" msgstr "" -#: config/tc-i386.c:2060 +#: config/tc-m32r.c:970 config/tc-m32r.c:1082 #, c-format -msgid "no such architecture: `%s'" +msgid "instruction '%s' cannot be executed in parallel." msgstr "" -#: config/tc-i386.c:2065 -msgid "missing cpu architecture" +#: config/tc-m32r.c:1025 config/tc-m32r.c:1107 config/tc-m32r.c:1314 +msgid "internal error: lookup/get operands failed" msgstr "" -#: config/tc-i386.c:2079 +#: config/tc-m32r.c:1092 #, c-format -msgid "no such architecture modifier: `%s'" +msgid "'%s': only the NOP instruction can be issued in parallel on the m32r" msgstr "" -#: config/tc-i386.c:2094 config/tc-i386.c:2109 -msgid "Intel L1OM is 64bit ELF only" +#: config/tc-m32r.c:1121 +#, c-format +msgid "%s: output of 1st instruction is the same as an input to 2nd instruction - is this intentional ?" msgstr "" -#: config/tc-i386.c:2118 config/tc-i386.c:8084 config/tc-maxq.c:223 -msgid "Unknown architecture" +#: config/tc-m32r.c:1125 +#, c-format +msgid "%s: output of 2nd instruction is the same as an input to 1st instruction - is this intentional ?" msgstr "" -#: config/tc-i386.c:2464 +#: config/tc-m32r.c:1498 #, c-format -msgid "unknown relocation (%u)" +msgid ".SCOMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-i386.c:2466 +#: config/tc-m32r.c:1548 #, c-format -msgid "%u-byte relocation cannot be applied to %u-byte field" +msgid "Length of .scomm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-i386.c:2470 -msgid "non-pc-relative relocation for pc-relative field" +#: config/tc-m32r.c:1925 config/tc-m32r.c:1978 config/tc-nds32.c:4185 +#: config/tc-nds32.c:4221 config/tc-sh.c:774 config/tc-sh.c:2457 +msgid "Invalid PIC expression." msgstr "" -#: config/tc-i386.c:2475 -msgid "relocated field and relocation type differ in signedness" +#: config/tc-m32r.c:2069 +msgid "Unmatched high/shigh reloc" msgstr "" -#: config/tc-i386.c:2484 -msgid "there are no unsigned pc-relative relocations" +#: config/tc-m68hc11.c:416 +#, c-format +msgid "" +"Motorola 68HC11/68HC12/68HCS12 options:\n" +" -m68hc11 | -m68hc12 |\n" +" -m68hcs12 | -mm9s12x |\n" +" -mm9s12xg specify the processor [default %s]\n" +" -mshort use 16-bit int ABI (default)\n" +" -mlong use 32-bit int ABI\n" +" -mshort-double use 32-bit double ABI\n" +" -mlong-double use 64-bit double ABI (default)\n" +" --force-long-branches always turn relative branches into absolute ones\n" +" -S,--short-branches do not turn relative branches into absolute ones\n" +" when the offset is out of range\n" +" --strict-direct-mode do not turn the direct mode into extended mode\n" +" when the instruction does not support direct mode\n" +" --print-insn-syntax print the syntax of instruction in case of error\n" +" --print-opcodes print the list of instructions with syntax\n" +" --xgate-ramoffset offset ram addresses by 0xc000\n" +" --generate-example generate an example of each instruction\n" +" (used for testing)\n" msgstr "" -#: config/tc-i386.c:2492 +#: config/tc-m68hc11.c:464 config/tc-xgate.c:284 #, c-format -msgid "cannot do %u byte pc-relative relocation" +msgid "Default target `%s' is not supported." msgstr "" -#: config/tc-i386.c:2509 +#. Dump the opcode statistics table. +#: config/tc-m68hc11.c:482 #, c-format -msgid "cannot do %s %u byte relocation" +msgid "Name # Modes Min ops Max ops Modes mask # Used\n" msgstr "" -#: config/tc-i386.c:2769 +#: config/tc-m68hc11.c:561 #, c-format -msgid "can't use register '%s%s' as operand %d in '%s'." +msgid "Option `%s' is not recognized." msgstr "" -#: config/tc-i386.c:2880 -#, c-format -msgid "SSE instruction `%s' is used" +#: config/tc-m68hc11.c:748 +msgid "imm3" msgstr "" -#: config/tc-i386.c:2894 config/tc-i386.c:4219 -#, c-format -msgid "ambiguous operand size for `%s'" +#: config/tc-m68hc11.c:756 +msgid "RD" msgstr "" -#. UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc. -#: config/tc-i386.c:2950 -#, c-format -msgid "translating to `%sp'" +#: config/tc-m68hc11.c:764 +msgid "RD,RS" msgstr "" -#: config/tc-i386.c:3001 -#, c-format -msgid "can't encode register '%s%s' in an instruction requiring REX prefix." +#: config/tc-m68hc11.c:772 +msgid "RI, #imm4" msgstr "" -#: config/tc-i386.c:3044 config/tc-i386.c:3168 config/tc-maxq.c:800 -#: config/tc-maxq.c:830 -#, c-format -msgid "no such instruction: `%s'" +#: config/tc-m68hc11.c:804 +msgid "RD, (RI,#offs5)" msgstr "" -#: config/tc-i386.c:3055 config/tc-i386.c:3201 config/tc-maxq.c:808 -#, c-format -msgid "invalid character %s in mnemonic" +#: config/tc-m68hc11.c:856 +msgid "#" msgstr "" -#: config/tc-i386.c:3062 -msgid "expecting prefix; got nothing" +#: config/tc-m68hc11.c:865 +msgid "#" msgstr "" -#: config/tc-i386.c:3064 -msgid "expecting mnemonic; got nothing" +#: config/tc-m68hc11.c:874 config/tc-m68hc11.c:883 +msgid ",X" msgstr "" -#: config/tc-i386.c:3079 config/tc-i386.c:3219 -#, c-format -msgid "`%s' is only supported in 64-bit mode" +#: config/tc-m68hc11.c:910 +msgid "*" msgstr "" -#: config/tc-i386.c:3080 config/tc-i386.c:3218 -#, c-format -msgid "`%s' is not supported in 64-bit mode" +#: config/tc-m68hc11.c:922 +msgid "#" msgstr "" -#: config/tc-i386.c:3092 +#: config/tc-m68hc11.c:932 #, c-format -msgid "redundant %s prefix" +msgid "symbol%d" msgstr "" -#: config/tc-i386.c:3225 -#, c-format -msgid "`%s' is not supported on `%s%s'" +#: config/tc-m68hc11.c:934 +msgid "" msgstr "" -#: config/tc-i386.c:3236 -msgid "use .code16 to ensure correct addressing mode" +#: config/tc-m68hc11.c:953 +msgid "