diff options
36 files changed, 600 insertions, 146 deletions
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index b013ef9..2ff3e93 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -2903,8 +2903,15 @@ bool generic_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd); /* Extracted from format.c. */ +bool bfd_check_format_lto (bfd *abfd, bfd_format format, + bool lto_sections_removed); + bool bfd_check_format (bfd *abfd, bfd_format format); +bool bfd_check_format_matches_lto + (bfd *abfd, bfd_format format, char ***matching, + bool lto_sections_removed); + bool bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching); diff --git a/bfd/coffcode.h b/bfd/coffcode.h index b81195d..a2ee036 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -909,7 +909,9 @@ fill_comdat_hash (bfd *abfd) if (! _bfd_coff_get_external_symbols (abfd)) return true; - esymstart = esym = (bfd_byte *) obj_coff_external_syms (abfd); + esymstart = esym = obj_coff_external_syms (abfd); + if (esym == NULL) + return true; esymend = esym + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd); for (struct internal_syment isym; diff --git a/bfd/format.c b/bfd/format.c index a909b70..f3a0774 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -56,16 +56,19 @@ extern const size_t _bfd_target_vector_entries; /* FUNCTION - bfd_check_format + bfd_check_format_lto SYNOPSIS - bool bfd_check_format (bfd *abfd, bfd_format format); + bool bfd_check_format_lto (bfd *abfd, bfd_format format, + bool lto_sections_removed); DESCRIPTION Verify if the file attached to the BFD @var{abfd} is compatible with the format @var{format} (i.e., one of <<bfd_object>>, <<bfd_archive>> or <<bfd_core>>). + If LTO_SECTION_REMOVED is true, ignore plugin target. + If the BFD has been set to a specific target before the call, only the named target and format combination is checked. If the target has not been set, or has been set to @@ -100,9 +103,30 @@ DESCRIPTION */ bool +bfd_check_format_lto (bfd *abfd, bfd_format format, + bool lto_sections_removed) +{ + return bfd_check_format_matches_lto (abfd, format, NULL, + lto_sections_removed); +} + + +/* +FUNCTION + bfd_check_format + +SYNOPSIS + bool bfd_check_format (bfd *abfd, bfd_format format); + +DESCRIPTION + Similar to bfd_check_format_plugin, except plugin target isn't + ignored. +*/ + +bool bfd_check_format (bfd *abfd, bfd_format format) { - return bfd_check_format_matches (abfd, format, NULL); + return bfd_check_format_matches_lto (abfd, format, NULL, false); } struct bfd_preserve @@ -407,11 +431,12 @@ bfd_set_lto_type (bfd *abfd ATTRIBUTE_UNUSED) /* FUNCTION - bfd_check_format_matches + bfd_check_format_matches_lto SYNOPSIS - bool bfd_check_format_matches - (bfd *abfd, bfd_format format, char ***matching); + bool bfd_check_format_matches_lto + (bfd *abfd, bfd_format format, char ***matching, + bool lto_sections_removed); DESCRIPTION Like <<bfd_check_format>>, except when it returns FALSE with @@ -423,10 +448,14 @@ DESCRIPTION When done with the list that @var{matching} points to, the caller should free it. + + If LTO_SECTION_REMOVED is true, ignore plugin target. */ bool -bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) +bfd_check_format_matches_lto (bfd *abfd, bfd_format format, + char ***matching, + bool lto_sections_removed ATTRIBUTE_UNUSED) { extern const bfd_target binary_vec; const bfd_target * const *target; @@ -495,8 +524,13 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) if (!bfd_preserve_save (abfd, &preserve, NULL)) goto err_ret; - /* If the target type was explicitly specified, just check that target. */ - if (!abfd->target_defaulted) + /* If the target type was explicitly specified, just check that target. + If LTO_SECTION_REMOVED is true, don't match the plugin target. */ + if (!abfd->target_defaulted +#if BFD_SUPPORTS_PLUGINS + && (!lto_sections_removed || !bfd_plugin_target_p (abfd->xvec)) +#endif + ) { if (bfd_seek (abfd, 0, SEEK_SET) != 0) /* rewind! */ goto err_ret; @@ -540,10 +574,12 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) searching. Don't match the plugin target if we have another alternative since we want to properly set the input format before allowing a plugin to claim the file. Also, don't - check the default target twice. */ + check the default target twice. If LTO_SECTION_REMOVED is + true, don't match the plugin target. */ if (*target == &binary_vec #if BFD_SUPPORTS_PLUGINS - || (match_count != 0 && bfd_plugin_target_p (*target)) + || ((lto_sections_removed || match_count != 0) + && bfd_plugin_target_p (*target)) #endif || (!abfd->target_defaulted && *target == save_targ)) continue; @@ -797,6 +833,32 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) /* FUNCTION + bfd_check_format_matches + +SYNOPSIS + bool bfd_check_format_matches + (bfd *abfd, bfd_format format, char ***matching); + +DESCRIPTION + Like <<bfd_check_format>>, except when it returns FALSE with + <<bfd_errno>> set to <<bfd_error_file_ambiguously_recognized>>. In that + case, if @var{matching} is not NULL, it will be filled in with + a NULL-terminated list of the names of the formats that matched, + allocated with <<malloc>>. + Then the user may choose a format and try again. + + When done with the list that @var{matching} points to, the caller + should free it. +*/ + +bool +bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) +{ + return bfd_check_format_matches_lto (abfd, format, matching, false); +} + +/* +FUNCTION bfd_set_format SYNOPSIS diff --git a/bfd/version.h b/bfd/version.h index 7573409..864ebe4 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 20250724 +#define BFD_VERSION_DATE 20250728 #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 diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 2ca04e8..905ce91 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -3741,10 +3741,13 @@ copy_archive (bfd *ibfd, bfd *obfd, const char *output_target, l->obfd = NULL; list = l; +#if BFD_SUPPORTS_PLUGINS + /* Ignore plugin target if all LTO sections should be removed. */ + ok_object = bfd_check_format_lto (this_element, bfd_object, + lto_sections_removed); +#else ok_object = bfd_check_format (this_element, bfd_object); - if (!ok_object) - bfd_nonfatal_message (NULL, this_element, NULL, - _("Unable to recognise the format of file")); +#endif /* PR binutils/3110: Cope with archives containing multiple target types. */ @@ -3880,9 +3883,8 @@ copy_file (const char *input_filename, const char *output_filename, int ofd, } #if BFD_SUPPORTS_PLUGINS - /* Enable LTO plugin in strip unless all LTO sections should be - removed. */ - if (is_strip && !target && !lto_sections_removed) + /* Enable LTO plugin in strip. */ + if (is_strip && !target) target = "plugin"; #endif @@ -3980,7 +3982,21 @@ copy_file (const char *input_filename, const char *output_filename, int ofd, input_arch)) status = 1; } - else if (bfd_check_format_matches (ibfd, bfd_object, &obj_matching)) + else if ( +#if BFD_SUPPORTS_PLUGINS + /* Ignore plugin target first if all LTO sections should be + removed. Try with plugin target next if ignoring plugin + target fails to match the format. */ + bfd_check_format_matches_lto (ibfd, bfd_object, &obj_matching, + lto_sections_removed) + || (lto_sections_removed + && bfd_check_format_matches_lto (ibfd, bfd_object, + &obj_matching, false)) +#else + bfd_check_format_matches_lto (ibfd, bfd_object, &obj_matching, + false) +#endif + ) { bfd *obfd; do_copy: @@ -5036,9 +5052,13 @@ strip_main (int argc, char *argv[]) #if BFD_SUPPORTS_PLUGINS /* Check if all GCC LTO sections should be removed, assuming all LTO sections will be removed with -R .gnu.lto_.*. * Remove .gnu.lto_.* - sections will also remove .gnu.debuglto_. sections. */ - lto_sections_removed = !!find_section_list (".gnu.lto_.*", false, - SECTION_CONTEXT_REMOVE); + sections will also remove .gnu.debuglto_. sections. LLVM IR + bitcode is stored in .llvm.lto section which will be removed with + -R .llvm.lto. */ + lto_sections_removed = (!!find_section_list (".gnu.lto_.*", false, + SECTION_CONTEXT_REMOVE) + || !!find_section_list (".llvm.lto", false, + SECTION_CONTEXT_REMOVE)); #endif i = optind; diff --git a/binutils/objdump.c b/binutils/objdump.c index 98d3049..0bea4d0 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -4498,6 +4498,9 @@ dump_dwarf_section (bfd *abfd, asection *section, else match = name; + if (elf_section_type (section) == SHT_GNU_SFRAME) + match = ".sframe"; + for (i = 0; i < max; i++) if ((strcmp (debug_displays [i].section.uncompressed_name, match) == 0 || strcmp (debug_displays [i].section.compressed_name, match) == 0 @@ -4999,6 +5002,18 @@ dump_sframe_section (bfd *abfd, const char *sect_name, bool is_mainfile) printf (_("No %s section present\n\n"), sanitize_string (sect_name)); return; } + /* Starting with Binutils 2.45, SFrame sections have section type + SHT_GNU_SFRAME. For SFrame sections from Binutils 2.44 or earlier, + check explcitly for SFrame sections of type SHT_PROGBITS and name + ".sframe" to allow them. */ + else if (elf_section_type (sec) != SHT_GNU_SFRAME + && !(elf_section_type (sec) == SHT_PROGBITS + && strcmp (sect_name, ".sframe") == 0)) + { + printf (_("Section %s does not contain SFrame data\n\n"), + sanitize_string (sect_name)); + return; + } } dump_dwarf (abfd, is_mainfile); } @@ -6332,8 +6347,10 @@ main (int argc, char **argv) if (optarg) dump_sframe_section_name = xstrdup (optarg); + else + dump_sframe_section_name = ".sframe"; - /* Error checking for user-provided section name is done in + /* Error checking for dump_sframe_section_name is done in dump_sframe_section (). Initialize for now with the default internal name: "sframe-internal-only". */ dwarf_select_sections_by_names ("sframe-internal-only"); diff --git a/binutils/readelf.c b/binutils/readelf.c index 686a16c..bb81c82 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -17493,6 +17493,7 @@ display_debug_section (int shndx, Elf_Internal_Shdr * section, Filedata * fileda if (streq (sec->uncompressed_name, name) || (id == line && startswith (name, ".debug_line.")) + || (id == sframe && section->sh_type == SHT_GNU_SFRAME) || streq (sec->compressed_name, name)) { bool secondary = (section != find_section (filedata, name)); @@ -17502,6 +17503,8 @@ display_debug_section (int shndx, Elf_Internal_Shdr * section, Filedata * fileda if (i == line && startswith (name, ".debug_line.")) sec->name = name; + else if (id == sframe && section->sh_type == SHT_GNU_SFRAME) + sec->name = name; else if (streq (sec->uncompressed_name, name)) sec->name = sec->uncompressed_name; else diff --git a/binutils/testsuite/binutils-all/x86-64/objdump-sframe-01.d b/binutils/testsuite/binutils-all/x86-64/objdump-sframe-01.d new file mode 100644 index 0000000..cca83cb --- /dev/null +++ b/binutils/testsuite/binutils-all/x86-64/objdump-sframe-01.d @@ -0,0 +1,18 @@ +#PROG:objcopy +#name: objdump dump SFrame section .sframe2 +#source: sframe-func.s +#as: --gsframe +#objcopy: --rename-section .sframe=.sframe2 +#objdump: --sframe=.sframe2 +#target: x86_64-*-* +#xfail: ![gas_sframe_check] + +#... + Header : + + Version: SFRAME_VERSION_2 + Flags: SFRAME_F_FDE_FUNC_START_PCREL + CFA fixed RA offset: -8 + Num FDEs: 1 + Num FREs: 4 +#pass diff --git a/binutils/testsuite/binutils-all/x86-64/pr33198.c b/binutils/testsuite/binutils-all/x86-64/pr33198.c new file mode 100644 index 0000000..cd0130c --- /dev/null +++ b/binutils/testsuite/binutils-all/x86-64/pr33198.c @@ -0,0 +1,4 @@ +void +foo (void) +{ +} diff --git a/binutils/testsuite/binutils-all/x86-64/readelf-sframe-01.d b/binutils/testsuite/binutils-all/x86-64/readelf-sframe-01.d new file mode 100644 index 0000000..a6973d8 --- /dev/null +++ b/binutils/testsuite/binutils-all/x86-64/readelf-sframe-01.d @@ -0,0 +1,18 @@ +#PROG:objcopy +#name: readelf dump SFrame section .sframe2 +#source: sframe-func.s +#as: --gsframe +#objcopy: --rename-section .sframe=.sframe2 +#readelf: --sframe=.sframe2 +#target: x86_64-*-* +#xfail: ![gas_sframe_check] + +#... + Header : + + Version: SFRAME_VERSION_2 + Flags: SFRAME_F_FDE_FUNC_START_PCREL + CFA fixed RA offset: -8 + Num FDEs: 1 + Num FREs: 4 +#pass diff --git a/binutils/testsuite/binutils-all/x86-64/sframe-func.s b/binutils/testsuite/binutils-all/x86-64/sframe-func.s new file mode 100644 index 0000000..cbd83c3 --- /dev/null +++ b/binutils/testsuite/binutils-all/x86-64/sframe-func.s @@ -0,0 +1,11 @@ + .cfi_sections .sframe + .cfi_startproc + .long 8 + .cfi_def_cfa_offset 16 + .cfi_offset 6, -16 + .long 8 + .cfi_def_cfa_register 6 + .long 8 + .cfi_def_cfa 7, 8 + .long 8 + .cfi_endproc diff --git a/binutils/testsuite/binutils-all/x86-64/x86-64.exp b/binutils/testsuite/binutils-all/x86-64/x86-64.exp index 05c7304..ab1aa50 100644 --- a/binutils/testsuite/binutils-all/x86-64/x86-64.exp +++ b/binutils/testsuite/binutils-all/x86-64/x86-64.exp @@ -96,3 +96,161 @@ if {[catch "system \"bzip2 -dc $t > $tempfile\""] != 0} { } } } + +proc run_pr33198_test { fat strip_flags } { + global srcdir + global subdir + global llvm_plug_opt + global AR + global CLANG_FOR_TARGET + global NM + global READELF + global STRIP + + set test pr33198 + set testname "${test}${fat} with $strip_flags" + + if { [istarget "x86_64-*-linux*-gnux32"] \ + || ![info exists CLANG_FOR_TARGET] + || [string match "" $llvm_plug_opt] } then { + untested $testname + return + } + + set src $srcdir/$subdir/${test}.c + set obj tmpdir/${test}${fat}.o + set archive tmpdir/${test}${fat}.a + set CLANG_CFLAGS "-c -O2 -flto" + if { "$fat" == "-fat" } { + append CLANG_CFLAGS " -ffat-lto-objects" + } + + append strip_flags " --strip-unneeded $llvm_plug_opt" + + set cmd "$CLANG_FOR_TARGET $CLANG_CFLAGS -o $obj $src" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname ($obj)" + return + } + + set cmd "$NM $llvm_plug_opt $obj\n" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![regexp "0+ T foo" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname ($obj)" + return + } + + pass "$testname ($obj)" + + set cmd "$STRIP $strip_flags $obj -o ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + + set cmd "$NM $llvm_plug_opt ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![regexp "0+ T foo" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + + if { "$fat" == "-fat" } { + set cmd "$READELF -SW ${obj}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if [regexp "\.llvm\.lto *LLVM_LTO *" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $obj)" + return + } + } + + pass "$testname (strip $obj)" + + set cmd "$AR $llvm_plug_opt -s -r -c $archive $obj" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname ($archive)" + return + } + + set cmd "$NM $llvm_plug_opt $archive\n" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![regexp "0+ T foo" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname ($archive)" + return + } + + pass "$testname ($archive)" + + set cmd "$STRIP $strip_flags $archive -o ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![string match "" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + + set cmd "$NM $llvm_plug_opt ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if ![regexp "0+ T foo" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + + if { "$fat" == "-fat" } { + set cmd "$READELF -SW ${archive}.strip" + send_log "$cmd\n" + verbose "$cmd" 1 + catch "exec $cmd" got + if [regexp "\.llvm\.lto *LLVM_LTO *" $got] then { + send_log "$got\n" + verbose "$got" 1 + fail "$testname (strip $archive)" + return + } + } + + pass "$testname (strip $archive)" +} + +run_pr33198_test "" "-R .gnu.lto_* -R .gnu.debuglto_* -R .llvm.lto -N __gnu_lto_v1" +run_pr33198_test "-fat" "-R .gnu.lto_* -R .gnu.debuglto_* -R .llvm.lto -N __gnu_lto_v1" +run_pr33198_test "" "-R .llvm.lto" +run_pr33198_test "-fat" "-R .llvm.lto" diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp index b73b555..7297f6d 100644 --- a/binutils/testsuite/lib/binutils-common.exp +++ b/binutils/testsuite/lib/binutils-common.exp @@ -1811,3 +1811,30 @@ proc get_standard_section_names {} { } return } + +set llvm_plug_opt "" +if { [isnative] } then { + if ![info exists CLANG_FOR_TARGET] then { + catch "exec clang -v" got + if [regexp "clang version" $got] then { + set CLANG_FOR_TARGET clang + } + } + if [info exists CLANG_FOR_TARGET] then { + set llvm_plug_so [string trim [exec $CLANG_FOR_TARGET -print-file-name=LLVMgold.so]] + if { $llvm_plug_so ne "LLVMgold.so" } then { + set llvm_plug_opt "--plugin $llvm_plug_so" + } + + if { $llvm_plug_opt eq "" } then { + # If it is still blank, try llvm-config --libdir. Clang + # searches CLANG_INSTALL_LIBDIR_BASENAME which corresponds + # to this. + catch "exec llvm-config --libdir" got + if {[file isdirectory $got] \ + && [file isfile $got/LLVMgold.so]} then { + set llvm_plug_opt "--plugin $got/LLVMgold.so" + } + } + } +} @@ -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/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/ld/ChangeLog b/ld/ChangeLog index 52bbeda..96960ab 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2025-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR ld/32580 + * configure.ac <*-*-solaris2*>: Enforce SHELL=/bin/bash. + * configure: Regenerate. + 2025-07-13 Nick Clifton <nickc@redhat.com> * 2.45 Branch point. diff --git a/ld/configure b/ld/configure index 015666d..124b441 100755 --- a/ld/configure +++ b/ld/configure @@ -3362,6 +3362,19 @@ fi +case $target in + *-*-solaris2*) + case "$SHELL" in + *bash*) + ;; + *) + # PR 32580: Force use of bash to avoid corrupt linker scripts. + SHELL=/bin/bash + ;; + esac + ;; +esac + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -11501,7 +11514,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11504 "configure" +#line 11517 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11607,7 +11620,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11610 "configure" +#line 11623 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/ld/configure.ac b/ld/configure.ac index af065fe..e306c1d 100644 --- a/ld/configure.ac +++ b/ld/configure.ac @@ -28,6 +28,19 @@ AM_INIT_AUTOMAKE AM_SILENT_RULES([yes]) AM_MAINTAINER_MODE +case $target in + *-*-solaris2*) + case "$SHELL" in + *bash*) + ;; + *) + # PR 32580: Force use of bash to avoid corrupt linker scripts. + SHELL=/bin/bash + ;; + esac + ;; +esac + AC_PROG_CC AC_PROG_CXX AC_PROG_GREP 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; } |