From b1b97a35f25693bbf693255602b10e33c8fdcfea Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Apr 28 2014 15:48:25 +0000 Subject: Fix detection of uncompressed .debug_str sections. Resolves: #1082370 --- diff --git a/binutils-2.24-fake-zlib-sections.patch b/binutils-2.24-fake-zlib-sections.patch new file mode 100644 index 0000000..e02dd51 --- /dev/null +++ b/binutils-2.24-fake-zlib-sections.patch @@ -0,0 +1,30 @@ +*** ../binutils-2.24.orig/bfd/compress.c 2014-04-28 16:35:20.429816317 +0100 +--- bfd/compress.c 2014-04-28 16:36:06.450963028 +0100 +*************** +*** 25,30 **** +--- 25,31 ---- + #ifdef HAVE_ZLIB_H + #include + #endif ++ #include "safe-ctype.h" + + #ifdef HAVE_ZLIB_H + static bfd_boolean +*************** bfd_is_section_compressed (bfd *abfd, se +*** 304,309 **** +--- 305,319 ---- + compressed = (bfd_get_section_contents (abfd, sec, compressed_buffer, 0, 12) + && CONST_STRNEQ ((char*) compressed_buffer, "ZLIB")); + ++ /* Check for the pathalogical case of a debug string section that ++ contains the string ZLIB.... as the first entry. We assume that ++ no uncompressed .debug_str section would ever be big enough to ++ have the first byte of its (big-endian) size be non-zero. */ ++ if (compressed ++ && strcmp (sec->name, ".debug_str") == 0 ++ && ISPRINT (compressed_buffer[4])) ++ compressed = FALSE; ++ + /* Restore compress_status. */ + sec->compress_status = saved; + return compressed; diff --git a/binutils.spec b/binutils.spec index cd70e17..e6ee7b0 100644 --- a/binutils.spec +++ b/binutils.spec @@ -17,7 +17,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.24 -Release: 12%{?dist} +Release: 13%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -55,6 +55,8 @@ Patch15: binutils-2.24-elfnn-aarch64.patch Patch16: binutils-2.24-DW_FORM_ref_addr.patch # Fix compiling using gcc 4.9 Patch17: binutils-2.24-set-section-macros.patch +# Fix detections of uncompressed .debug_str sections that look like they have been compressed. +Patch18: binutils-2.24-fake-zlib-sections.patch Provides: bundled(libiberty) @@ -174,6 +176,7 @@ using libelf instead of BFD. %patch15 -p0 -b .elf-aarch64~ %patch16 -p0 -b .ref-addr~ %patch17 -p0 -b .sec-macros~ +%patch18 -p0 -b .fake-zlib~ # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -479,6 +482,9 @@ exit 0 %endif # %{isnative} %changelog +* Mon Apr 28 2014 Nick Clifton - 2.24-13 +- Fix detection of uncompressed .debug_str sections. (#1082370) + * Tue Apr 22 2014 Nick Clifton - 2.24-12 - Fix compiling using gcc 4.9 (#1087374)