diff options
38 files changed, 314 insertions, 241 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 3fd9f28..1ed995b 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -53,6 +53,10 @@ static bfd_reloc_status_type ppc_elf_addr16_ha_reloc static bfd_reloc_status_type ppc_elf_unhandled_reloc (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) +#endif + /* Branch prediction bit for branch taken relocs. */ #define BRANCH_PREDICT_BIT 0x200000 /* Mask to set RA in memory instructions. */ @@ -702,13 +706,10 @@ ppc_elf_howto_init (void) { unsigned int i, type; - for (i = 0; - i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); - i++) + for (i = 0; i < ARRAY_SIZE (ppc_elf_howto_raw); i++) { type = ppc_elf_howto_raw[i].type; - if (type >= (sizeof (ppc_elf_howto_table) - / sizeof (ppc_elf_howto_table[0]))) + if (type >= ARRAY_SIZE (ppc_elf_howto_table)) abort (); ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i]; } @@ -870,9 +871,7 @@ ppc_elf_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, { unsigned int i; - for (i = 0; - i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); - i++) + for (i = 0; i < ARRAY_SIZE (ppc_elf_howto_raw); i++) if (ppc_elf_howto_raw[i].name != NULL && strcasecmp (ppc_elf_howto_raw[i].name, r_name) == 0) return &ppc_elf_howto_raw[i]; @@ -894,7 +893,8 @@ ppc_elf_info_to_howto (bfd *abfd, ppc_elf_howto_init (); r_type = ELF32_R_TYPE (dst->r_info); - if (r_type >= R_PPC_max) + if (r_type >= ARRAY_SIZE (ppc_elf_howto_table) + || ppc_elf_howto_table[r_type] == NULL) { /* xgettext:c-format */ _bfd_error_handler (_("%pB: unsupported relocation type %#x"), @@ -904,19 +904,6 @@ ppc_elf_info_to_howto (bfd *abfd, } 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 == 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; } @@ -7088,12 +7075,11 @@ ppc_elf_relocate_section (bfd *output_bfd, /* For relocs against symbols from removed linkonce sections, or sections discarded by a linker script, we just want the section contents zeroed. Avoid any special processing. */ - howto = NULL; - if (r_type < R_PPC_max) - howto = ppc_elf_howto_table[r_type]; - - _bfd_clear_contents (howto, input_bfd, input_section, - contents, rel->r_offset); + if (r_type < ARRAY_SIZE (ppc_elf_howto_table) + && ppc_elf_howto_table[r_type] != NULL) + _bfd_clear_contents (ppc_elf_howto_table[r_type], + input_bfd, input_section, + contents, rel->r_offset); wrel->r_offset = rel->r_offset; wrel->r_info = 0; wrel->r_addend = 0; @@ -7653,7 +7639,7 @@ ppc_elf_relocate_section (bfd *output_bfd, addend = rel->r_addend; save_unresolved_reloc = unresolved_reloc; howto = NULL; - if (r_type < R_PPC_max) + if (r_type < ARRAY_SIZE (ppc_elf_howto_table)) howto = ppc_elf_howto_table[r_type]; tls_type = 0; diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index e6c90a6..7868063 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -1379,7 +1379,8 @@ ppc64_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, ppc_howto_init (); type = ELF64_R_TYPE (dst->r_info); - if (type >= ARRAY_SIZE (ppc64_elf_howto_table)) + if (type >= ARRAY_SIZE (ppc64_elf_howto_table) + || ppc64_elf_howto_table[type] == NULL) { /* xgettext:c-format */ _bfd_error_handler (_("%pB: unsupported relocation type %#x"), @@ -1388,15 +1389,6 @@ ppc64_elf_info_to_howto (bfd *abfd, arelent *cache_ptr, 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; } @@ -5104,7 +5096,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) ppc_howto_init (); /* xgettext:c-format */ - info->callbacks->einfo (_("%H: %s reloc unsupported " + info->callbacks->einfo (_("%H: %s unsupported " "in shared libraries and PIEs\n"), abfd, sec, rel->r_offset, ppc64_elf_howto_table[r_type]->name); @@ -5274,7 +5266,7 @@ ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, if (ppc64_sec->sec_type != sec_toc || rel->r_offset % 8 != 0) { - info->callbacks->einfo (_("%H: %s reloc unsupported here\n"), + info->callbacks->einfo (_("%H: %s unsupported here\n"), abfd, sec, rel->r_offset, ppc64_elf_howto_table[r_type]->name); bfd_set_error (bfd_error_bad_value); @@ -15685,9 +15677,11 @@ ppc64_elf_relocate_section (bfd *output_bfd, if (sec != NULL && discarded_section (sec)) { - _bfd_clear_contents (ppc64_elf_howto_table[r_type], - input_bfd, input_section, - contents, rel->r_offset); + if (r_type < ARRAY_SIZE (ppc64_elf_howto_table) + && ppc64_elf_howto_table[r_type] != NULL) + _bfd_clear_contents (ppc64_elf_howto_table[r_type], + input_bfd, input_section, + contents, rel->r_offset); wrel->r_offset = rel->r_offset; wrel->r_info = 0; wrel->r_addend = 0; @@ -15750,6 +15744,8 @@ ppc64_elf_relocate_section (bfd *output_bfd, relocs are used with non-tls syms. */ if (r_symndx != STN_UNDEF && r_type != R_PPC64_NONE + && r_type < ARRAY_SIZE (ppc64_elf_howto_table) + && ppc64_elf_howto_table[r_type] != NULL && (h == NULL || h->elf.root.type == bfd_link_hash_defined || h->elf.root.type == bfd_link_hash_defweak) @@ -16865,9 +16861,15 @@ ppc64_elf_relocate_section (bfd *output_bfd, switch (r_type) { default: - /* xgettext:c-format */ - _bfd_error_handler (_("%pB: %s unsupported"), - input_bfd, ppc64_elf_howto_table[r_type]->name); + if (r_type < ARRAY_SIZE (ppc64_elf_howto_table) + && ppc64_elf_howto_table[r_type] != NULL) + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: %s unsupported"), + input_bfd, ppc64_elf_howto_table[r_type]->name); + else + /* xgettext:c-format */ + _bfd_error_handler (_("%pB: unsupported relocation type %#x"), + input_bfd, r_type); bfd_set_error (bfd_error_bad_value); ret = false; @@ -17909,7 +17911,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]; + howto = ppc64_elf_howto_table[r_type]; if (unresolved_reloc && !((input_section->flags & SEC_DEBUGGING) != 0 && h->elf.def_dynamic) diff --git a/bfd/version.h b/bfd/version.h index ca90452..c4f5e1b 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 20250725 +#define BFD_VERSION_DATE 20250729 #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/binutils/README-how-to-make-a-release b/binutils/README-how-to-make-a-release index 0604a56..7ab4c69 100644 --- a/binutils/README-how-to-make-a-release +++ b/binutils/README-how-to-make-a-release @@ -232,6 +232,10 @@ If this is an ODD numbered release: For the next few weeks, monitor the mailing list for new translations and respond to any requests to have patches applied to the branch. +Also - expect to receive lots of new/updated translations from the +Translation Project. These all need to be checked in to both the +mainline and the branch. + ============================================================================== ============================================================================== @@ -253,7 +257,7 @@ How to create the release. 21. a. 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.44.90" becomes "2.45". NB/ Not: "2.45.00" + value. Eg "2.45.90" becomes "2.46". NB/ Not: "2.46.00" b. Change bfd/development.sh to set all values to "false". @@ -280,11 +284,10 @@ How to create the release. to exist in the master repository, and that the GDB project would need to agree to have it there. - e. Add ChangeLog entries for all of the updates and add a - "this-is-the-2.43-release" comment and commit. + e. Commit. git add . - git commit -m "This is the 2.45 release" + git commit -m "This is the 2.46 release" git push 22. Check that your file creation mask will create the @@ -311,17 +314,15 @@ How to create the release. If this is an EVEN numbered release: - ./src-release.sh -b -g -l -x -z binutils_with_gold + ./src-release.sh -b -g -l -x -z \ + -r `git log -1 --format=%cd --date=format:%F bfd/version.m4` \ + binutils_with_gold If this is an ODD numbered release: - ./src-release.sh -b -g -l -x -z binutils - - OR ... for a more reproducible tarball: - ./src-release.sh -b -g -l -x -z \ -r `git log -1 --format=%cd --date=format:%F bfd/version.m4` \ - [binutils | binutils_with_gold] + binutils 24. Check that the files in the tarballs have the correct permissions. @@ -330,7 +331,7 @@ How to create the release. Also check that the man files are not empty. (cf PR 28144). - tar tvf binutils-*.tar | grep -e "\.1" + tar tvf binutils-*.tar | grep -e "\.1" (look for zero sized files) 25. Sanity check the release on x86_64-pc-linux-gnu by building and running the testsuites (gas, gold, binutils and ld). @@ -365,21 +366,23 @@ How to create the release. popd 26. Tag the branch with the new release number: - [optional: add "-u XXXXX" to sign with a gpg key] - enter a tag message such as: "Official GNU Binutils 2.4x release" + [Optional: add "-u XXXXX" to sign with a gpg key. + Note: This may require changing the setting of [gpg] in your .gitconfig file] + + Enter a tag message such as: "Official GNU Binutils 2.4x release" git tag -a <TAG> -u <Your Key> eg: - git tag -a binutils-2_44 -u DD9E3C4F <=== Be careful to get the tag right + git tag -a binutils-2_46 -u DD9E3C4F <=== Be careful to get the tag right or: - git tag -a binutils-2_44 -u DD9E3C4F -m "Official GNU Binutils 2.44 release" + git tag -a binutils-2_46 -u DD9E3C4F -m "Official GNU Binutils 2.46 release" NB/ If you do sign the binaries make sure to use a key that has been published with the FSF. Then push the release: - git push origin binutils-2_44 + git push origin binutils-2_46 If you get an error message along the lines of: "Invalid revision range ..." @@ -387,11 +390,11 @@ How to create the release. 27. Upload the tarballs to ftp.gnu.org. - gnupload --to ftp.gnu.org:binutils binutils-2.44.tar.* + gnupload --to ftp.gnu.org:binutils binutils-2.46.tar.* Be prepared to provide the password for the key, if you signed the binaries. - + The gnupload script is in the build-aux/ directory of the gnulib project's srouces. It uses the ncftp package for transmitting the files. @@ -420,8 +423,8 @@ How to create the release. Create a new docs sub-directory and move into it: cd binutils-htdocs - mkdir docs-2.45 - cd docs-2.45 + mkdir docs-2.46 + cd docs-2.46 Copy the index.html from the previous release @@ -457,8 +460,8 @@ How to create the release. cp <build-dir>/ld/ld.pdf . [NB/ Path not like others] [NB/ The gprofng documentation does not have a node-per-page selection] - cp <build-dir>/gprofng/doc/gprof.html . - cp <build-dir>/gprofng/doc/gprof.pdf . + cp <build-dir>/gprofng/gprof.html . + cp <build-dir>/gprofng/gprof.pdf . cp <build-dir>/libctf/doc/ctf-spec.html . cp <build-dir>/libctf/doc/ctf-spec.pdf . @@ -470,19 +473,20 @@ How to create the release. cd .. [Should now be in be in binutils-htdocs/ ] rm docs - ln -s docs-2.45 docs + ln -s docs-2.46 docs Edit index.html file to change the links to point to the new release, mention any new features, update dates and so on. - Check that the new web page is correct: + Check that the new web page is correct by opening it in a browser: file:///<path-to-binutils-htdocs>/index.html Add the new directories and files, commit and push the changes: + get add docs-2.46 git add . - git commit -m"Update documenation for the 2.45 release" + git commit -m"Update documenation for the 2.46 release" git push @@ -56,6 +56,14 @@ Changes in 2.45: * For LoongArch, warn about negative right-shift amounts and division/modulus-by-zero when evaluating expressions. +* Add support for most Armv9.6 extensions, enabled by the option + `-march=armv9.6-a' and extensions '+cmpbr', '+f8f16mm', '+f8f32mm', + '+fprcvt', '+lsfe', '+lsui', '+occmo', '+pops', '+sme2p2', '+ssve-aes', + '+sve-aes', '+sve-aes2', '+sve-bfscale', '+sve-f16f32mm' and '+sve2p2'. + +* AArch64 system registers can now be assembled without restriction. The + previous behavior can be enabled with '-menable-sysreg-checking'. + Changes in 2.44: * Add support for the x86 Intel Diamond Rapids AMX instructions, including @@ -1042,14 +1042,14 @@ This program has absolutely no warranty.\n")); if (optarg) { if (strcasecmp (optarg, "no") == 0) - flag_gen_sframe = 0; + flag_gen_sframe = GEN_SFRAME_DISABLED; else if (strcasecmp (optarg, "yes") == 0) - flag_gen_sframe = 1; + flag_gen_sframe = GEN_SFRAME_ENABLED; else as_fatal (_("Invalid --gsframe option: `%s'"), optarg); } else - flag_gen_sframe = 1; + flag_gen_sframe = GEN_SFRAME_ENABLED; break; #endif /* OBJ_ELF */ @@ -355,8 +355,30 @@ COMMON int flag_execstack; /* TRUE if .note.GNU-stack section with SEC_CODE should be created */ COMMON int flag_noexecstack; -/* TRUE if .sframe section should be created. */ -COMMON int flag_gen_sframe; +/* PR gas/33175. + Add enumerators to disambiguate between configure-time + enablement (or not) vs user-specficied enablement/disablement (the latter + via command line). The expected usage of these states is: + - user-specified command line takes precedence over configure-time + setting and .cfi_sections directive usage. + - .cfi_sections usage takes precedence over configure-time setting. */ +enum gen_sframe_option +{ + /* Default. SFrame generation not enabled at configure time. GNU as will + not generate SFrame sections by default, unless enabled by user via + command line. */ + GEN_SFRAME_DEFAULT_NONE, + /* SFrame generation enabled at configure time. GNU as will generate SFrame + sections for all objects, unless disabled by user via command line. */ + GEN_SFRAME_CONFIG_ENABLED, + /* User specified disablement via --gsframe=no. */ + GEN_SFRAME_DISABLED, + /* User specified enablement via --gsframe or --gsframe=yes. */ + GEN_SFRAME_ENABLED, +}; + +/* State of the setting for SFrame section creation. */ +COMMON enum gen_sframe_option flag_gen_sframe; /* name of emitted object file */ COMMON const char *out_file_name; diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index cd9ae58..96bfe74 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -10869,8 +10869,8 @@ static const struct aarch64_option_cpu_value_table aarch64_features[] = { {"sme-b16b16", AARCH64_FEATURE (SME_B16B16), AARCH64_FEATURES (2, SVE_B16B16, SME2)}, {"pops", AARCH64_FEATURE (PoPS), AARCH64_NO_FEATURES}, - {"sve2p2", AARCH64_FEATURE (SVE2p2), AARCH64_FEATURE (SVE2)}, - {"sme2p2", AARCH64_FEATURE (SME2p2), AARCH64_FEATURE (SME2)}, + {"sve2p2", AARCH64_FEATURE (SVE2p2), AARCH64_FEATURE (SVE2p1)}, + {"sme2p2", AARCH64_FEATURE (SME2p2), AARCH64_FEATURE (SME2p1)}, {NULL, AARCH64_NO_FEATURES, AARCH64_NO_FEATURES}, }; diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h index 145d955..65470f0 100644 --- a/gas/config/tc-arc.h +++ b/gas/config/tc-arc.h @@ -271,4 +271,4 @@ struct arc_relax_type extern void arc_md_end (void); #define md_end arc_md_end -#endif +#endif /* TC_ARC */ diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index aa5f117..4148a6f 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -20,6 +20,7 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef TC_ARM #define TC_ARM 1 #ifndef TARGET_BYTES_BIG_ENDIAN @@ -377,3 +378,5 @@ extern bool arm_tc_equal_in_insn (int, char *); #define TC_LARGEST_EXPONENT_IS_NORMAL(PRECISION) \ arm_is_largest_exponent_ok ((PRECISION)) int arm_is_largest_exponent_ok (int precision); + +#endif /* TC_ARM */ diff --git a/gas/config/tc-csky.h b/gas/config/tc-csky.h index 7e32347..d391084 100644 --- a/gas/config/tc-csky.h +++ b/gas/config/tc-csky.h @@ -106,4 +106,4 @@ extern long csky_relax_frag (segT, fragS *, long); const char * elf32_csky_target_format (void); #endif -#endif +#endif /* TC_CSKY */ diff --git a/gas/config/tc-msp430.h b/gas/config/tc-msp430.h index 47da4aa..fc39a59 100644 --- a/gas/config/tc-msp430.h +++ b/gas/config/tc-msp430.h @@ -20,6 +20,7 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef TC_MSP430 #define TC_MSP430 /* By convention, you should define this macro in the `.h' file. For example, `tc-m68k.h' defines `TC_M68K'. You might have to use this @@ -172,3 +173,5 @@ extern bool msp430_allow_local_subtract (expressionS *, expressionS *, segT); #define TC_LINKRELAX_FIXUP(seg) ((seg->flags & SEC_CODE) || (seg->flags & SEC_DEBUGGING)) #define DWARF2_ADDR_SIZE(bfd) 4 + +#endif /* TC_MSP430 */ diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index 97e2f4e..e568c42 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -19,6 +19,7 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef TC_PPC #define TC_PPC #include "opcode/ppc.h" @@ -367,3 +368,5 @@ extern int ppc_dwarf2_line_min_insn_length; #define DWARF2_DEFAULT_RETURN_COLUMN 0x41 #define DWARF2_CIE_DATA_ALIGNMENT ppc_cie_data_alignment #define EH_FRAME_ALIGNMENT 2 + +#endif /* TC_PPC */ diff --git a/gas/config/tc-s390.h b/gas/config/tc-s390.h index c92769e..0c62125 100644 --- a/gas/config/tc-s390.h +++ b/gas/config/tc-s390.h @@ -19,6 +19,7 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef TC_S390 #define TC_S390 struct fix; @@ -129,3 +130,5 @@ extern offsetT s390_sframe_cfa_ra_offset (void); /* The abi/arch identifier for SFrame. */ unsigned char s390_sframe_get_abi_arch (void); #define sframe_get_abi_arch s390_sframe_get_abi_arch + +#endif /* TC_S390 */ diff --git a/gas/config/tc-sparc.h b/gas/config/tc-sparc.h index d569fe7..cfb89e0 100644 --- a/gas/config/tc-sparc.h +++ b/gas/config/tc-sparc.h @@ -178,4 +178,4 @@ extern int sparc_cie_data_alignment; this, BFD_RELOC_32_PCREL will be emitted directly instead. */ #define CFI_DIFF_EXPR_OK 0 -#endif +#endif /* TC_SPARC */ diff --git a/gas/config/tc-tic6x.h b/gas/config/tc-tic6x.h index 55f2b2c..5859333 100644 --- a/gas/config/tc-tic6x.h +++ b/gas/config/tc-tic6x.h @@ -18,7 +18,9 @@ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifndef TC_TIC6X #define TC_TIC6X 1 + #define TARGET_BYTES_BIG_ENDIAN 0 #define WORKING_DOT_WORD #define DOUBLEBAR_PARALLEL @@ -225,3 +227,5 @@ struct fde_entry; void tic6x_cfi_endproc (struct fde_entry *fde); #define tc_cfi_section_name ".c6xabi.exidx" + +#endif /* TC_TIC6X */ diff --git a/gas/doc/c-aarch64.texi b/gas/doc/c-aarch64.texi index dc64e09..8f5702f 100644 --- a/gas/doc/c-aarch64.texi +++ b/gas/doc/c-aarch64.texi @@ -197,6 +197,8 @@ automatically cause those extensions to be disabled. @tab Enable 8-bit floating-point matrix multiply-accumulate to half-precision instructions. @item @code{f8f32mm} @tab @code{simd} @code{fp} @tab Enable 8-bit floating-point matrix multiply-accumulate to single-precision instructions. +@item @code{faminmax} @tab @code{simd} + @tab Enable the famin and famax instructions. @item @code{fcma} @tab @code{fp16}, @code{simd} @tab Enable the complex number SIMD extensions. @item @code{flagm} @tab @@ -243,7 +245,7 @@ automatically cause those extensions to be disabled. @tab Enable Large System Float Extension. @item @code{lsui} @tab @tab Enable Unprivileged Load/Store instructions. -@item @code{lut} @tab +@item @code{lut} @tab @code{simd} @tab Enable the Lookup Table (LUT) extension. @item @code{memtag} @tab @tab Enable Armv8.5-A Memory Tagging Extensions. @@ -258,9 +260,9 @@ automatically cause those extensions to be disabled. @item @code{pops} @tab @tab Enable Point of Physical Storage. @item @code{predres} @tab - @tab Enable the Execution and Data and Prediction instructions. + @tab Enable execution and data prediction restriction instructions. @item @code{predres2} @tab @code{predres} - @tab Enable Prediction instructions. + @tab Enable additional prediction restriction instructions. @item @code{profile} @tab @tab Enable statistical profiling extensions. @item @code{ras} @tab @@ -297,6 +299,8 @@ automatically cause those extensions to be disabled. @tab Enable the SME F8F16 Extension. @item @code{sme-f8f32} @tab @code{sme2}, @code{fp8} @tab Enable the SME F8F32 Extension. +@item @code{sme-f16f16} @tab @code{sme2} + @tab Enable the SME2 F16F16 Extension. @item @code{sme-f64f64} @tab @code{sme} @tab Enable SME F64F64 Extension. @item @code{sme-i16i64} @tab @code{sme} @@ -311,10 +315,10 @@ automatically cause those extensions to be disabled. @tab Enable SME2.2. @item @code{ssbs} @tab @tab Enable Speculative Store Bypassing Safe state read and write. -@item @code{ssve-fp8dot2} @tab @code{sme2}, @code{fp8} - @tab Enable the Streaming SVE FP8 2-way dot product instructions. @item @code{ssve-aes} @tab @code{sme2}, @code{sve-aes} @tab Enable SVE AES instructions in streaming mode. +@item @code{ssve-fp8dot2} @tab @code{sme2}, @code{fp8} + @tab Enable the Streaming SVE FP8 2-way dot product instructions. @item @code{ssve-fp8dot4} @tab @code{sme2}, @code{fp8} @tab Enable the Streaming SVE FP8 4-way dot product instructions. @item @code{ssve-fp8fma} @tab @code{sme2}, @code{fp8} @@ -322,7 +326,7 @@ automatically cause those extensions to be disabled. @item @code{sve} @tab @code{fcma} @tab Enable the Scalable Vector Extension. @item @code{sve-aes} @tab @code{aes} - @tab Enable the SVE PMULL128 instructions. + @tab Enable the SVE2 AES and PMULL Extensions. @item @code{sve-aes2} @tab @tab Enable the SVE-AES2 extension. @item @code{sve-b16b16} @tab @@ -333,7 +337,7 @@ automatically cause those extensions to be disabled. @tab Enable the SVE_F16F32MM extension. @item @code{sve2} @tab @code{sve} @tab Enable SVE2. -@item @code{sve2-aes} @tab @code{sve2}, @code{aes} +@item @code{sve2-aes} @tab @code{sve2}, @code{sve-aes} @tab Enable the SVE2 AES and PMULL Extensions. @item @code{sve2-bitperm} @tab @code{sve2} @tab Enable the SVE2 BITPERM Extension. @@ -353,8 +357,6 @@ automatically cause those extensions to be disabled. @tab Enable @code{wfet} and @code{wfit} instructions. @item @code{xs} @tab @tab Enable the XS memory attribute extension. -@item @code{sme-f16f16} @tab - @tab Enable the SME2 F16F16 Extension. @end multitable @multitable @columnfractions .20 .80 diff --git a/gas/dw2gencfi.c b/gas/dw2gencfi.c index 57fffab..c28856c 100644 --- a/gas/dw2gencfi.c +++ b/gas/dw2gencfi.c @@ -2596,10 +2596,13 @@ cfi_finish (void) flag_traditional_format = save_flag_traditional_format; } - /* Generate SFrame section if the user specifies: - - the command line option to gas, or - - .sframe in the .cfi_sections directive. */ - if (flag_gen_sframe || (all_cfi_sections & CFI_EMIT_sframe) != 0) + /* Generate SFrame section if the user: + - enables via the command line option, or + - specifies .sframe in the .cfi_sections directive and does not disable + via the command line. */ + if (flag_gen_sframe == GEN_SFRAME_ENABLED + || ((all_cfi_sections & CFI_EMIT_sframe) != 0 + && flag_gen_sframe != GEN_SFRAME_DISABLED)) { #ifdef support_sframe_p if (support_sframe_p () && !SUPPORT_FRAME_LINKONCE) diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d index 8c74680..9c341b4 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1.d @@ -1,4 +1,4 @@ -#as: --gsframe +#as: #objdump: --sframe=.sframe #name: SFrame generation using CFI directive .cfi_sections #... diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1c.d b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1c.d new file mode 100644 index 0000000..3493d58 --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1c.d @@ -0,0 +1,5 @@ +#as: --gsframe=no +#readelf: -S +#name: No SFrame section with explicit --gsframe=no +#failif +[ ]*\[.*\][ ]+\.sframe[ ]+GNU_SFRAME.* diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1c.s b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1c.s new file mode 100644 index 0000000..ac9c6ca --- /dev/null +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe-common-1c.s @@ -0,0 +1,3 @@ + .cfi_sections .sframe + .cfi_startproc + .cfi_endproc diff --git a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp index 82669cd..9380c98 100644 --- a/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp +++ b/gas/testsuite/gas/cfi-sframe/cfi-sframe.exp @@ -36,6 +36,7 @@ if { ([istarget "x86_64-*-*"] || [istarget "aarch64*-*-*"] run_dump_test "cfi-sframe-common-1" run_dump_test "cfi-sframe-common-1b" + run_dump_test "cfi-sframe-common-1c" run_dump_test "cfi-sframe-common-2" run_dump_test "cfi-sframe-common-3" run_dump_test "cfi-sframe-common-4" diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 5e887f5..a15a04a 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -51,6 +51,7 @@ #include "cli/cli-cmds.h" #include "cli/cli-style.h" #include "cli/cli-utils.h" +#include "terminal.h" #include "extension.h" #include "gdbsupport/pathstuff.h" @@ -949,6 +950,9 @@ shell_escape (const char *arg, int from_tty) static void shell_command (const char *arg, int from_tty) { + scoped_gdb_ttystate save_restore_gdb_ttystate; + restore_initial_gdb_ttystate (); + shell_escape (arg, from_tty); } @@ -2898,6 +2902,7 @@ This can be changed using \"set listsize\", and the current value\n\ can be shown using \"show listsize\".")); add_com_alias ("l", list_cmd, class_files, 1); + set_cmd_completer(list_cmd, location_completer); c = add_com ("disassemble", class_vars, disassemble_command, _("\ Disassemble a specified section of memory.\n\ diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 5e18e45..634d67a 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9918,33 +9918,37 @@ static void handle_member_location (struct die_info *die, struct dwarf2_cu *cu, struct field *field) { - struct attribute *attr; + const auto data_member_location_attr + = dwarf2_attr (die, DW_AT_data_member_location, cu); - attr = dwarf2_attr (die, DW_AT_data_member_location, cu); - if (attr != NULL) + if (data_member_location_attr != nullptr) { bool has_bit_offset = false; LONGEST bit_offset = 0; LONGEST anonymous_size = 0; + const auto bit_offset_attr = dwarf2_attr (die, DW_AT_bit_offset, cu); - attribute *attr2 = dwarf2_attr (die, DW_AT_bit_offset, cu); - if (attr2 != nullptr && attr2->form_is_constant ()) + if (bit_offset_attr != nullptr && bit_offset_attr->form_is_constant ()) { has_bit_offset = true; - bit_offset = attr2->confused_constant ().value_or (0); - attr2 = dwarf2_attr (die, DW_AT_byte_size, cu); - if (attr2 != nullptr && attr2->form_is_constant ()) + bit_offset = bit_offset_attr->confused_constant ().value_or (0); + + const auto byte_size_attr = dwarf2_attr (die, DW_AT_byte_size, cu); + + if (byte_size_attr != nullptr && byte_size_attr->form_is_constant ()) { /* The size of the anonymous object containing the bit field is explicit, so use the indicated size (in bytes). */ - anonymous_size = attr2->unsigned_constant ().value_or (0); + anonymous_size + = byte_size_attr->unsigned_constant ().value_or (0); } } - if (attr->form_is_constant ()) + if (data_member_location_attr->form_is_constant ()) { - LONGEST offset = attr->confused_constant ().value_or (0); + LONGEST offset + = data_member_location_attr->confused_constant ().value_or (0); /* Work around this GCC 11 bug, where it would erroneously use -1 data member locations, instead of 0: @@ -9962,11 +9966,17 @@ handle_member_location (struct die_info *die, struct dwarf2_cu *cu, if (has_bit_offset) apply_bit_offset_to_field (*field, bit_offset, anonymous_size); } - else if (attr->form_is_block ()) + else if (data_member_location_attr->form_is_block ()) { CORE_ADDR offset; - if (decode_locdesc (attr->as_block (), cu, &offset)) - field->set_loc_bitpos (offset * bits_per_byte); + if (decode_locdesc (data_member_location_attr->as_block (), cu, + &offset)) + { + field->set_loc_bitpos (offset * bits_per_byte); + + if (has_bit_offset) + apply_bit_offset_to_field (*field, bit_offset, anonymous_size); + } else { dwarf2_per_objfile *per_objfile = cu->per_objfile; @@ -9985,8 +9995,8 @@ handle_member_location (struct die_info *die, struct dwarf2_cu *cu, else dlbaton = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct dwarf2_locexpr_baton); - dlbaton->data = attr->as_block ()->data; - dlbaton->size = attr->as_block ()->size; + dlbaton->data = data_member_location_attr->as_block ()->data; + dlbaton->size = data_member_location_attr->as_block ()->size; /* When using this baton, we want to compute the address of the field, not the value. This is why is_reference is set to false here. */ @@ -9999,16 +10009,19 @@ handle_member_location (struct die_info *die, struct dwarf2_cu *cu, } else complaint (_("Unsupported form %s for DW_AT_data_member_location"), - dwarf_form_name (attr->form)); + dwarf_form_name (data_member_location_attr->form)); } else { - attr = dwarf2_attr (die, DW_AT_data_bit_offset, cu); - if (attr != nullptr) + const auto data_bit_offset_attr + = dwarf2_attr (die, DW_AT_data_bit_offset, cu); + + if (data_bit_offset_attr != nullptr) { - if (attr->form_is_constant ()) - field->set_loc_bitpos (attr->unsigned_constant ().value_or (0)); - else if (attr->form_is_block ()) + if (data_bit_offset_attr->form_is_constant ()) + field->set_loc_bitpos (data_bit_offset_attr->unsigned_constant () + .value_or (0)); + else if (data_bit_offset_attr->form_is_block ()) { /* This is a DWARF extension. See https://dwarfstd.org/issues/250501.1.html. */ @@ -10016,8 +10029,8 @@ handle_member_location (struct die_info *die, struct dwarf2_cu *cu, dwarf2_locexpr_baton *dlbaton = OBSTACK_ZALLOC (&per_objfile->objfile->objfile_obstack, dwarf2_locexpr_baton); - dlbaton->data = attr->as_block ()->data; - dlbaton->size = attr->as_block ()->size; + dlbaton->data = data_bit_offset_attr->as_block ()->data; + dlbaton->size = data_bit_offset_attr->as_block ()->size; dlbaton->per_objfile = per_objfile; dlbaton->per_cu = cu->per_cu; @@ -10025,7 +10038,7 @@ handle_member_location (struct die_info *die, struct dwarf2_cu *cu, } else complaint (_("Unsupported form %s for DW_AT_data_bit_offset"), - dwarf_form_name (attr->form)); + dwarf_form_name (data_bit_offset_attr->form)); } } } diff --git a/gdb/inflow.c b/gdb/inflow.c index 31e1565..4f1c8ef 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -55,6 +55,20 @@ static void child_terminal_ours_1 (target_terminal_state); static struct serial *stdin_serial; +/* See terminal.h. */ + +scoped_gdb_ttystate::scoped_gdb_ttystate () +{ + m_ttystate = serial_get_tty_state (stdin_serial); +} + +/* See terminal.h. */ + +scoped_gdb_ttystate::~scoped_gdb_ttystate () +{ + serial_set_tty_state (stdin_serial, m_ttystate); +} + /* Terminal related info we need to keep track of. Each inferior holds an instance of this structure --- we save it whenever the corresponding inferior stops, and restore it to the terminal when @@ -163,6 +177,15 @@ set_initial_gdb_ttystate (void) } } +/* See terminal.h. */ + +void +restore_initial_gdb_ttystate () +{ + if (initial_gdb_ttystate != nullptr) + serial_set_tty_state (stdin_serial, initial_gdb_ttystate); +} + /* Does GDB have a terminal (on stdin)? */ static int diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c index 481bd41..a4e9cf5 100644 --- a/gdb/mingw-hdep.c +++ b/gdb/mingw-hdep.c @@ -493,10 +493,7 @@ show_maint_console_translation_mode (struct ui_file *file, int from_tty, console_translation_mode.c_str ()); } -extern void _initialize_mingw_hdep (); - -void -_initialize_mingw_hdep () +INIT_GDB_FILE (mingw_hdep) { add_setshow_string_cmd ("console-translation-mode", class_maintenance, diff --git a/gdb/solib-frv.h b/gdb/solib-frv.h index 710a424..a2f3558 100644 --- a/gdb/solib-frv.h +++ b/gdb/solib-frv.h @@ -1,5 +1,5 @@ /* Handle FR-V (FDPIC) shared libraries for GDB, the GNU Debugger. - Copyright (C) 2024 Free Software Foundation, Inc. + Copyright (C) 2025 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/svr4-tls-tdep.c b/gdb/svr4-tls-tdep.c index 75d06a4..1f36d57 100644 --- a/gdb/svr4-tls-tdep.c +++ b/gdb/svr4-tls-tdep.c @@ -1,6 +1,6 @@ /* Target-dependent code for GNU/Linux, architecture independent. - Copyright (C) 2009-2024 Free Software Foundation, Inc. + Copyright (C) 2009-2025 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/terminal.h b/gdb/terminal.h index 54e5e98..720fd4a 100644 --- a/gdb/terminal.h +++ b/gdb/terminal.h @@ -19,6 +19,8 @@ #ifndef GDB_TERMINAL_H #define GDB_TERMINAL_H +#include "serial.h" + struct inferior; extern void new_tty_prefork (std::string ttyname); @@ -43,4 +45,17 @@ extern void gdb_save_tty_state (void); have had a chance to alter it. */ extern void set_initial_gdb_ttystate (void); +/* Restore initial tty state. */ +extern void restore_initial_gdb_ttystate (void); + +/* An RAII-based object that saves the tty state, and then restores it again + when this object is destroyed. */ +class scoped_gdb_ttystate +{ +public: + scoped_gdb_ttystate (); + ~scoped_gdb_ttystate (); +private: + serial_ttystate m_ttystate; +}; #endif /* GDB_TERMINAL_H */ diff --git a/gdb/testsuite/gdb.ada/operator_call.exp b/gdb/testsuite/gdb.ada/operator_call.exp index e96107b..dc7f679 100644 --- a/gdb/testsuite/gdb.ada/operator_call.exp +++ b/gdb/testsuite/gdb.ada/operator_call.exp @@ -71,6 +71,12 @@ proc test_with_menu {command result} { fail $command } } + "Argument to arithmetic operation not a number or boolean." { + fail $command + } + -re "No definition of \".*\" in current context." { + fail $command + } timeout { fail "$command (timeout)" } diff --git a/ld/ChangeLog b/ld/ChangeLog index 96960ab..7b03989 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,18 @@ +2025-07-29 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * testsuite/ld-elfweak/elfweak.exp: Enable on *-*-solaris2* rather + than sparc*-*-solaris2* only. + +2025-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * testsuite/ld-plugin/lto.exp (PR ld/28138 test): Raise fd limit + to 25. + +2025-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * testsuite/ld-elf/indirect.exp (Run with libpr19553c.so): + Skip on *-*-solaris2*. + 2025-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> PR ld/32580 diff --git a/ld/testsuite/ld-elf/indirect.exp b/ld/testsuite/ld-elf/indirect.exp index 9a0bcb2..3d9cc2a 100644 --- a/ld/testsuite/ld-elf/indirect.exp +++ b/ld/testsuite/ld-elf/indirect.exp @@ -189,14 +189,21 @@ set run_tests [list \ {check-ptr-eq.c} "pr18720d" "pr18720.out"] \ [list "Run with libpr19553b.so" \ "-Wl,--no-as-needed tmpdir/libpr19553b.so tmpdir/libpr19553d.so -Wl,-rpath-link,." "" \ - {pr19553a.c} "pr19553b" "pr19553b.out"] \ + {pr19553a.c} "pr19553b" "pr19553b.out"] +] + +# This test relies on versioned symbols, which Solaris ld.so.1 doesn't support. +if { ![istarget *-*-solaris2*] } { + lappend run_tests \ [list "Run with libpr19553c.so" \ "-Wl,--no-as-needed tmpdir/libpr19553c.so tmpdir/libpr19553b.so tmpdir/libpr19553d.so" "" \ - {pr19553a.c} "pr19553c" "pr19553c.out"] \ + {pr19553a.c} "pr19553c" "pr19553c.out"] +} + +lappend run_tests \ [list "Run with libpr19553d.so" \ "-Wl,--no-as-needed tmpdir/libpr19553d.so tmpdir/libpr19553b.so -Wl,-rpath-link,." "" \ - {pr19553a.c} "pr19553d" "pr19553d.out"] \ -] + {pr19553a.c} "pr19553d" "pr19553d.out"] run_ld_link_exec_tests $run_tests diff --git a/ld/testsuite/ld-elfweak/elfweak.exp b/ld/testsuite/ld-elfweak/elfweak.exp index aa6c29a..4e5ac42 100644 --- a/ld/testsuite/ld-elfweak/elfweak.exp +++ b/ld/testsuite/ld-elfweak/elfweak.exp @@ -35,7 +35,8 @@ if { ![check_shared_lib_support] } { # This test can only be run on a couple of ELF platforms. # Square bracket expressions seem to confuse istarget. # This is similar to the test that is used in ld-shared, BTW. -if { ![istarget alpha*-*-linux*] +if { ![istarget *-*-solaris2*] + && ![istarget alpha*-*-linux*] && ![istarget arm*-*-linux*] && ![istarget hppa*64*-*-hpux*] && ![istarget hppa*-*-linux*] @@ -52,7 +53,6 @@ if { ![istarget alpha*-*-linux*] && ![istarget powerpc*-*-sysv4*] && ![istarget sh\[34\]*-*-linux*] && ![istarget sparc*-*-elf] - && ![istarget sparc*-*-solaris2*] && ![istarget sparc*-*-linux*] && ![istarget x86_64-*-linux*] } { return diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index d68e5f4..9ac3cf6 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -1009,7 +1009,7 @@ run_cc_link_tests [list \ set board_flags [get_board_flags] set exec_output [run_host_cmd "sh" \ - "-c \"ulimit -n 20; \ + "-c \"ulimit -n 25; \ $CC_FOR_TARGET $gcc_B_opt $CFLAGS_FOR_TARGET \ $board_flags $ld_L_opt -o tmpdir/pr28138 \ tmpdir/pr28138.o tmpdir/pr28138.a\""] diff --git a/ld/testsuite/ld-powerpc/elfv2-2so.d b/ld/testsuite/ld-powerpc/elfv2-2so.d index 56b1434..18bc87f 100644 --- a/ld/testsuite/ld-powerpc/elfv2-2so.d +++ b/ld/testsuite/ld-powerpc/elfv2-2so.d @@ -2,4 +2,4 @@ #source: elfv2-2b.s #as: -a64 #ld: -melf64ppc -shared -e f1 -#error: .* R_PPC64_ADDR64_LOCAL reloc unsupported in shared libraries and PIEs.* +#error: .* R_PPC64_ADDR64_LOCAL unsupported in shared libraries and PIEs.* diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c index 2d4401d..524ed7e 100644 --- a/libctf/ctf-link.c +++ b/libctf/ctf-link.c @@ -20,10 +20,6 @@ #include <ctf-impl.h> #include <string.h> -#if defined (PIC) -#pragma weak ctf_open -#endif - /* CTF linking consists of adding CTF archives full of content to be merged into this one to the current file (which must be writable) by calling ctf_link_add_ctf. Once this is done, a call to ctf_link will merge the type @@ -145,56 +141,33 @@ ctf_link_add_ctf_internal (ctf_dict_t *fp, ctf_archive_t *ctf, return ctf_set_errno (fp, ENOMEM); } -/* Add a file, memory buffer, or unopened file (by name) to a link. - - You can call this with: - - CTF and NAME: link the passed ctf_archive_t, with the given NAME. - NAME alone: open NAME as a CTF file when needed. - BUF and NAME: open the BUF (of length N) as CTF, with the given NAME. (Not - yet implemented.) +/* Add an opened CTF archive or unopened file (by name) to a link. + If CTF is NULL and NAME is non-null, an unopened file is meant: + otherwise, the specified archive is assumed to have the given NAME. - Passed in CTF args are owned by the dictionary and will be freed by it. - The BUF arg is *not* owned by the dictionary, and the user should not free - its referent until the link is done. + If CTF is NULL, the NAME is only opened when needed, and is closed when no + longer needed, so that large cu-mapped links will only use memory for their + cu-mapped inputs briefly (compensating for the memory usage of the + smushed-together cu-mapped verion). - The order of calls to this function influences the order of types in the - final link output, but otherwise is not important. + Passed in CTF args are owned by the dictionary and will be freed by it. - Repeated additions of the same NAME have no effect; repeated additions of - different dicts with the same NAME add all the dicts with unique NAMEs - derived from NAME. + The order of calls to this function influences the order of types in the + final link output, but otherwise is not important. - Private for now, but may in time become public once support for BUF is - implemented. */ + Repeated additions of the same NAME have no effect; repeated additions of + different dicts with the same NAME add all the dicts with unique NAMEs + derived from NAME. */ -static int -ctf_link_add (ctf_dict_t *fp, ctf_archive_t *ctf, const char *name, - void *buf _libctf_unused_, size_t n _libctf_unused_) +int +ctf_link_add_ctf (ctf_dict_t *fp, ctf_archive_t *ctf, const char *name) { - if (buf) - return (ctf_set_errno (fp, ECTF_NOTYET)); - - if (!((ctf && name && !buf) - || (name && !buf && !ctf) - || (buf && name && !ctf))) + if (!name) return (ctf_set_errno (fp, EINVAL)); - /* We can only lazily open files if libctf.so is in use rather than - libctf-nobfd.so. This is a little tricky: in shared libraries, we can use - a weak symbol so that -lctf -lctf-nobfd works, but in static libraries we - must distinguish between the two libraries explicitly. */ - -#if defined (PIC) - if (!buf && !ctf && name && !ctf_open) - return (ctf_set_errno (fp, ECTF_NEEDSBFD)); -#elif NOBFD - if (!buf && !ctf && name) - return (ctf_set_errno (fp, ECTF_NEEDSBFD)); -#endif - if (fp->ctf_link_outputs) return (ctf_set_errno (fp, ECTF_LINKADDEDLATE)); + if (fp->ctf_link_inputs == NULL) fp->ctf_link_inputs = ctf_dynhash_create (ctf_hash_string, ctf_hash_eq_string, free, @@ -203,22 +176,15 @@ ctf_link_add (ctf_dict_t *fp, ctf_archive_t *ctf, const char *name, if (fp->ctf_link_inputs == NULL) return (ctf_set_errno (fp, ENOMEM)); - return ctf_link_add_ctf_internal (fp, ctf, NULL, name); -} - -/* Add an opened CTF archive or unopened file (by name) to a link. - If CTF is NULL and NAME is non-null, an unopened file is meant: - otherwise, the specified archive is assumed to have the given NAME. - - Passed in CTF args are owned by the dictionary and will be freed by it. + /* We can only lazily open files if libctf.so is in use rather than + libctf-nobfd.so. */ - The order of calls to this function influences the order of types in the - final link output, but otherwise is not important. */ +#if NOBFD + if (!ctf) + return (ctf_set_errno (fp, ECTF_NEEDSBFD)); +#endif -int -ctf_link_add_ctf (ctf_dict_t *fp, ctf_archive_t *ctf, const char *name) -{ - return ctf_link_add (fp, ctf, name, NULL, 0); + return ctf_link_add_ctf_internal (fp, ctf, NULL, name); } /* Lazily open a CTF archive for linking, if not already open. @@ -238,12 +204,12 @@ ctf_link_lazy_open (ctf_dict_t *fp, ctf_link_input_t *input) return 1; /* See ctf_link_add_ctf. */ -#if defined (PIC) || !NOBFD - input->clin_arc = ctf_open (input->clin_filename, NULL, &err); -#else +#if NOBFD ctf_err_warn (fp, 0, ECTF_NEEDSBFD, _("cannot open %s lazily"), input->clin_filename); return ctf_set_errno (fp, ECTF_NEEDSBFD); +#else + input->clin_arc = ctf_open (input->clin_filename, NULL, &err); #endif /* Having no CTF sections is not an error. We just don't need to do diff --git a/libsframe/doc/sframe-spec.texi b/libsframe/doc/sframe-spec.texi index 7307789..f25791e 100644 --- a/libsframe/doc/sframe-spec.texi +++ b/libsframe/doc/sframe-spec.texi @@ -20,7 +20,7 @@ License''. @titlepage @title The SFrame Format -@subtitle Version 2 +@subtitle Version 2 (Errata 1) @sp 15 @center @today{} @author Indu Bhagat @@ -35,9 +35,9 @@ License''. @node Top @top The SFrame format -This manual describes version 2 of the SFrame file format. SFrame stands for -Simple Frame. The SFrame format keeps track of the minimal necessary -information needed for generating stack traces: +This manual describes version 2 (errata 1) of the SFrame file format. SFrame +stands for Simple Frame. The SFrame format keeps track of the minimal +necessary information needed for generating stack traces: @itemize @minus @item @@ -130,9 +130,9 @@ the data structure. The above two imply that each SFrame function descriptor entry has a fixed size of 20 bytes instead of its size of 17 bytes in SFrame format version 1. @item -Add a new flag SFRAME_F_FDE_FUNC_START_PCREL, as an erratum to SFrame -Version 2, to indicate the encoding of the SFrame FDE function start address -field: +[Errata 1] Add a new flag SFRAME_F_FDE_FUNC_START_PCREL, as an erratum to +SFrame Version 2, to indicate the encoding of the SFrame FDE function start +address field: @itemize @minus @item if set, @code{sfde_func_start_address} field contains the offset in bytes to the start PC of the associated function from the field itself. @@ -141,8 +141,8 @@ bytes to the start PC of the associated function from the start of the SFrame section. @end itemize @item -Add a new ABI/arch identifier SFRAME_ABI_S390X_ENDIAN_BIG for the s390 -architecture (64-bit) s390x ABI. Other s390x-specific backward compatible +[Errata 1] Add a new ABI/arch identifier SFRAME_ABI_S390X_ENDIAN_BIG for the +s390 architecture (64-bit) s390x ABI. Other s390x-specific backward compatible changes including the following helper definitions have been incrementally added to SFrame version 2 only: @itemize @minus @@ -165,6 +165,8 @@ CFA offset adjustment and then scale down by CFA offset alignment factor). @item SFRAME_V2_S390X_CFA_OFFSET_DECODE: Decode CFA offset (i.e., scale up by CFA offset alignment factor and then revert CFA offset adjustment). @end itemize +@item +[Errata 1] An ELF SFrame section has the type SHT_GNU_SFRAME. @end itemize SFrame version 1 is now obsolete and should not be used. diff --git a/opcodes/sparc-dis.c b/opcodes/sparc-dis.c index 1138136..f935783 100644 --- a/opcodes/sparc-dis.c +++ b/opcodes/sparc-dis.c @@ -387,40 +387,12 @@ compare_opcodes (const void * a, const void * b) return length_diff; } - /* Put 1+i before i+1. */ - { - char *p0 = (char *) strchr (op0->args, '+'); - char *p1 = (char *) strchr (op1->args, '+'); - - if (p0 && p1) - { - /* There is a plus in both operands. Note that a plus - sign cannot be the first character in args, - so the following [-1]'s are valid. */ - if (p0[-1] == 'i' && p1[1] == 'i') - /* op0 is i+1 and op1 is 1+i, so op1 goes first. */ - return 1; - if (p0[1] == 'i' && p1[-1] == 'i') - /* op0 is 1+i and op1 is i+1, so op0 goes first. */ - return -1; - } - } - - /* Put 1,i before i,1. */ - { - int i0 = strncmp (op0->args, "i,1", 3) == 0; - int i1 = strncmp (op1->args, "i,1", 3) == 0; - - if (i0 ^ i1) - return i0 - i1; - } - - /* They are, as far as we can tell, identical. - Since qsort may have rearranged the table partially, there is - no way to tell which one was first in the opcode table as - written, so just say there are equal. */ - /* ??? This is no longer true now that we sort a vector of pointers, - not the table itself. */ + /* They are, as far as we can tell, identical. Keep the order in + the sparc_opcodes table. */ + if (op0 < op1) + return -1; + if (op0 > op1) + return 1; return 0; } |