diff options
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/NEWS | 2 | ||||
-rw-r--r-- | binutils/README-how-to-make-a-release | 65 | ||||
-rw-r--r-- | binutils/objcopy.c | 40 | ||||
-rw-r--r-- | binutils/objdump.c | 19 | ||||
-rw-r--r-- | binutils/readelf.c | 3 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/objdump-sframe-01.d | 18 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/pr33198.c | 4 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/readelf-sframe-01.d | 18 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/sframe-func.s | 11 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/x86-64/x86-64.exp | 158 | ||||
-rw-r--r-- | binutils/testsuite/lib/binutils-common.exp | 29 |
11 files changed, 318 insertions, 49 deletions
diff --git a/binutils/NEWS b/binutils/NEWS index 281de00..5038851 100644 --- a/binutils/NEWS +++ b/binutils/NEWS @@ -1,5 +1,7 @@ -*- text -*- +* NaCl target support is removed. + Changes in 2.45: * New versioned release of libsframe: libsframe.so.2. This release introduces diff --git a/binutils/README-how-to-make-a-release b/binutils/README-how-to-make-a-release index 6e19a8b..7ab4c69 100644 --- a/binutils/README-how-to-make-a-release +++ b/binutils/README-how-to-make-a-release @@ -136,17 +136,6 @@ Approx time to complete from here: 2 hours ... ./src-release.sh -x binutils - FIXME: Not sure if the following steps are needed... - - Add a .dirstamp file to the gas/doc subdirectory: - - touch -d `date +%Y-%m-%d` binutils-2.45.90/gas/doc/.dirstamp - tar rvf binutils-2.45.90.tar binutils-2.45.90/gas/doc/.dirstamp - rm binutils-2.45.90.tar.xz - xz -9 -k binutils-2.45.90.tar - - ...END OF FIXME - c. Build a test target using this tarball. cp binutils-*.tar.xz /dev/shm @@ -243,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. + ============================================================================== ============================================================================== @@ -264,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". @@ -291,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 @@ -322,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. @@ -341,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). @@ -376,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 ..." @@ -398,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. @@ -431,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 @@ -468,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 . @@ -481,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 2da7138..7297f6d 100644 --- a/binutils/testsuite/lib/binutils-common.exp +++ b/binutils/testsuite/lib/binutils-common.exp @@ -44,7 +44,6 @@ proc is_elf_format {} { && ![istarget kvx-*-*] && ![istarget *-*-*linux*] && ![istarget *-*-lynxos*] - && ![istarget *-*-nacl*] && ![istarget *-*-netbsd*] && ![istarget *-*-nto*] && ![istarget *-*-openbsd*] @@ -238,7 +237,6 @@ proc match_target { target } { proc supports_gnu_osabi {} { if { [istarget *-*-gnu*] || [istarget *-*-linux*] - || [istarget *-*-nacl*] || ( [istarget *-*-*bsd*] && ![istarget arm*-*-netbsd*] ) || [istarget *-*-lynxos] || ( [istarget *-*-nto*] && ![istarget arm*-*-*] ) @@ -1813,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" + } + } + } +} |