diff --git a/.gitignore b/.gitignore index 40bf3c3..571e5a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,66 @@ -binutils-2.*/ -i386 -i686 -x86_64 -/binutils-*.tar.bz2 -.build-* -*.src.rpm -*.log -HOWTO -build-sources +*.diff +*.patch +*.orig +*.rej -/binutils-2.29.tar.xz -/binutils-2.29.1.tar.xz +*~ +.#* +*# + +*.flt +*.gmo +*.info +*.la +*.lo +*.o +*.pyc +*.tmp +*.a + +.deps +.libs + +autom4te.cache +config.cache +config.h +config.intl +config.log +config.status +libtool +POTFILES +*-POTFILES + +TAGS +TAGS.sub + +.local.vimrc +.lvimrc + +.clang-format + +.gdbinit +.gdb_history + +perf.data +perf.data.old + +# ignore core files, but not java/net/protocol/core/ +core +!core/ + +lost+found + +# ignore ./contrib/gcc_update output +LAST_UPDATED +REVISION + +stamp-* +*.stamp + +# ignore in-tree prerequisites +/mpfr* +/mpc* +/gmp* +/isl* +/binutils-2.34.0-5dfc0c955dbe912cd328fc2688e5fceb3239ac2a.tar.xz /binutils-2.19.50.0.1-output-format.sed -/binutils-2.30.tar.xz -/binutils-2.30.90.tar.xz -/binutils-2.31.1.tar.xz -/binutils-special-sections-in-groups.patch -/binutils-2.32.tar.xz -/binutils-2.33.1.tar.xz -/binutils-2.34.tar.xz diff --git a/binutils-readelf-compression-header-size.patch b/binutils-readelf-compression-header-size.patch new file mode 100644 index 0000000..cd93dce --- /dev/null +++ b/binutils-readelf-compression-header-size.patch @@ -0,0 +1,127 @@ +diff --git a/binutils/readelf.c b/binutils/readelf.c +index 6b5bebe743..6246b16428 100644 +--- a/binutils/readelf.c ++++ b/binutils/readelf.c +@@ -6714,15 +6714,18 @@ process_section_headers (Filedata * filedata) + { + Elf_Internal_Chdr chdr; + +- (void) get_compression_header (&chdr, buf, sizeof (buf)); +- +- if (chdr.ch_type == ELFCOMPRESS_ZLIB) +- printf (" ZLIB, "); ++ if (get_compression_header (&chdr, buf, sizeof (buf)) == 0) ++ printf (_(" []\n")); + else +- printf (_(" [: 0x%x], "), +- chdr.ch_type); +- print_vma (chdr.ch_size, LONG_HEX); +- printf (", %lu\n", (unsigned long) chdr.ch_addralign); ++ { ++ if (chdr.ch_type == ELFCOMPRESS_ZLIB) ++ printf (" ZLIB, "); ++ else ++ printf (_(" [: 0x%x], "), ++ chdr.ch_type); ++ print_vma (chdr.ch_size, LONG_HEX); ++ printf (", %lu\n", (unsigned long) chdr.ch_addralign); ++ } + } + } + } +@@ -13658,11 +13661,16 @@ dump_section_as_strings (Elf_Internal_Shdr * section, Filedata * filedata) + = get_compression_header (& chdr, (unsigned char *) start, + num_bytes); + ++ if (compression_header_size == 0) ++ /* An error message will have already been generated ++ by get_compression_header. */ ++ goto error_out; ++ + if (chdr.ch_type != ELFCOMPRESS_ZLIB) + { + warn (_("section '%s' has unsupported compress type: %d\n"), + printable_section_name (filedata, section), chdr.ch_type); +- return FALSE; ++ goto error_out; + } + uncompressed_size = chdr.ch_size; + start += compression_header_size; +@@ -13694,7 +13702,7 @@ dump_section_as_strings (Elf_Internal_Shdr * section, Filedata * filedata) + { + error (_("Unable to decompress section %s\n"), + printable_section_name (filedata, section)); +- return FALSE; ++ goto error_out; + } + } + else +@@ -13764,6 +13772,10 @@ dump_section_as_strings (Elf_Internal_Shdr * section, Filedata * filedata) + + putchar ('\n'); + return TRUE; ++ ++ error_out: ++ free (real_start); ++ return FALSE; + } + + static bfd_boolean +@@ -13776,7 +13788,7 @@ dump_section_as_bytes (Elf_Internal_Shdr * section, + bfd_size_type section_size; + bfd_vma addr; + unsigned char * data; +- unsigned char * real_start; ++ unsigned char * real_start = NULL; + unsigned char * start; + + real_start = start = (unsigned char *) get_section_contents (section, filedata); +@@ -13799,11 +13811,16 @@ dump_section_as_bytes (Elf_Internal_Shdr * section, + unsigned int compression_header_size + = get_compression_header (& chdr, start, section_size); + ++ if (compression_header_size == 0) ++ /* An error message will have already been generated ++ by get_compression_header. */ ++ goto error_out; ++ + if (chdr.ch_type != ELFCOMPRESS_ZLIB) + { + warn (_("section '%s' has unsupported compress type: %d\n"), + printable_section_name (filedata, section), chdr.ch_type); +- return FALSE; ++ goto error_out; + } + uncompressed_size = chdr.ch_size; + start += compression_header_size; +@@ -13838,7 +13855,7 @@ dump_section_as_bytes (Elf_Internal_Shdr * section, + error (_("Unable to decompress section %s\n"), + printable_section_name (filedata, section)); + /* FIXME: Print the section anyway ? */ +- return FALSE; ++ goto error_out; + } + } + else +@@ -13918,6 +13935,10 @@ dump_section_as_bytes (Elf_Internal_Shdr * section, + + putchar ('\n'); + return TRUE; ++ ++ error_out: ++ free (real_start); ++ return FALSE; + } + + static ctf_sect_t * +@@ -14128,6 +14149,10 @@ load_specific_debug_section (enum dwarf_section_display_enum debug, + } + + compression_header_size = get_compression_header (&chdr, start, size); ++ if (compression_header_size == 0) ++ /* An error message will have already been generated ++ by get_compression_header. */ ++ return FALSE; + + if (chdr.ch_type != ELFCOMPRESS_ZLIB) + { diff --git a/binutils.spec b/binutils.spec index 37b75f5..fa6973a 100644 --- a/binutils.spec +++ b/binutils.spec @@ -1,8 +1,8 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} -Version: 2.34 -Release: 4%{?dist} +Version: 2.34.0 +Release: 5%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -13,13 +13,13 @@ URL: https://sourceware.org/binutils # --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils. # -# --with=bootstrap Build with minimal dependencies. -# --with=debug Build without optimizations and without splitting -# the debuginfo into a separate file. -# --without=docs Skip building documentation. -# --without=testsuite Do not run the testsuite. Default is to run it. -# --without=gold Disable building of the GOLD linker. -# --with=clang Build with the CLANG compiler. +# --with bootstrap Build with minimal dependencies. +# --with debug Build without optimizations and without splitting +# the debuginfo into a separate file. +# --without docs Skip building documentation. +# --without testsuite Do not run the testsuite. Default is to run it. +# --without gold Disable building of the GOLD linker. +# --with clang To force building with the CLANG. #---Start of Configure Options----------------------------------------------- @@ -106,7 +106,22 @@ URL: https://sourceware.org/binutils # too many controversial patches so we stick with the official FSF version # instead. -Source: https://ftp.gnu.org/gnu/binutils/binutils-%{version}.tar.xz +# The source for the binutils are normally retrieved from the official +# GNU repository. IE: +# Source: https://ftp.gnu.org/gnu/binutils/binutils-%%{version}.tar.xz +# +# But we have a need in this rawhide release to pull in the latest version +# on the 2.34 branch. So the tarball was created using the following +# commands: +# +# git clone git://sourceware.org/git/binutils-gdb.git -b binutils-2_34-branch +# git checkout 5dfc0c955dbe912cd328fc2688e5fceb3239ac2a +# ./src-release -x binutils +# mv binutils-2.34.0.tar.xz binutils-2.34.0-5dfc0c955dbe912cd328fc2688e5fceb3239ac2a.tar.xz +# +# FIXME: Undo this change once the next official binutils release is made. + +Source: binutils-2.34.0-5dfc0c955dbe912cd328fc2688e5fceb3239ac2a.tar.xz Source2: binutils-2.19.50.0.1-output-format.sed @@ -205,10 +220,9 @@ Patch14: binutils-gold-mismatched-section-flags.patch # Lifetime: Fixed in 2.35 (maybe) Patch15: binutils-CVE-2019-1010204.patch -# Purpose: Fix the LTO plugin so that it passes full symbol information -# to the linker. +# Purpose: Fix a potential use of an initialised field by readelf. # Lifetime: Fixed in 2.35 -Patch16: binutils-nm-lto-plugin.patch +Patch16: binutils-readelf-compression-header-size.patch # Purpose: Change the gold configuration script to only warn about # unsupported targets. This allows the binutils to be built with @@ -458,7 +472,7 @@ esac CARGS="$CARGS --enable-relro=no" %endif -%if 0%{?_with_debug:1} +%if %{with debug} export CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0" %define enable_shared 0 %endif @@ -777,6 +791,10 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Fri May 22 2020 Nick Clifton - 2.34-5 +- Rebase to tip of GNU Binutils 2.34 branch, brining in LTO fixes. +- Retire: binutils-nm-lto-plugin.patch + * Tue Apr 28 2020 Nick Clifton - 2.34-4 - Fix seg fault when loading plugins via symlinks. (#1828587) diff --git a/sources b/sources index bd5a1b6..d761d88 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (binutils-2.34.tar.xz) = 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd +SHA512 (binutils-2.34.0-5dfc0c955dbe912cd328fc2688e5fceb3239ac2a.tar.xz) = abeb5f35e17aa1705c7267d4a5c63c4697102422f1d1aeb0d06817eb293e119661ba437dd28315103f6f83cd8d2dc00d57b9aa2dbd6cb3ce67c0b517c9ae83aa SHA512 (binutils-2.19.50.0.1-output-format.sed) = 2f8686b0c8af13c98cda056824c2820416f6e2d003f70b78ccf5314525b9ee3684d421dfa83e638a2d42d06ea4d4bdaf5226b64d6ec26f7ff59c44ffb2a23dd2