]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - binutils/patches/binutils-2.24-fake-zlib-sections.patch0
e02dd51e680b32a2298415ad11685a182de48184
[people/amarx/ipfire-3.x.git] / binutils / patches / binutils-2.24-fake-zlib-sections.patch0
1 *** ../binutils-2.24.orig/bfd/compress.c 2014-04-28 16:35:20.429816317 +0100
2 --- bfd/compress.c 2014-04-28 16:36:06.450963028 +0100
3 ***************
4 *** 25,30 ****
5 --- 25,31 ----
6 #ifdef HAVE_ZLIB_H
7 #include <zlib.h>
8 #endif
9 + #include "safe-ctype.h"
10
11 #ifdef HAVE_ZLIB_H
12 static bfd_boolean
13 *************** bfd_is_section_compressed (bfd *abfd, se
14 *** 304,309 ****
15 --- 305,319 ----
16 compressed = (bfd_get_section_contents (abfd, sec, compressed_buffer, 0, 12)
17 && CONST_STRNEQ ((char*) compressed_buffer, "ZLIB"));
18
19 + /* Check for the pathalogical case of a debug string section that
20 + contains the string ZLIB.... as the first entry. We assume that
21 + no uncompressed .debug_str section would ever be big enough to
22 + have the first byte of its (big-endian) size be non-zero. */
23 + if (compressed
24 + && strcmp (sec->name, ".debug_str") == 0
25 + && ISPRINT (compressed_buffer[4]))
26 + compressed = FALSE;
27 +
28 /* Restore compress_status. */
29 sec->compress_status = saved;
30 return compressed;