This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] sanity check bfd_is_section_compressed header
- From: Cary Coutant <ccoutant at google dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 5 Jun 2013 13:40:18 -0700
- Subject: Re: [patch] sanity check bfd_is_section_compressed header
- References: <201306051918 dot r55JIjb5003882 at greed dot delorie dot com>
> Had a customer library where the first string in [non-compressed]
> .debug_str was "ZLIB_COMPRESS_ERROR". The linker tried to allocate a
> few hundred terabytes to decompress it, because it *only* checks for
> "ZLIB" as the signature. On ASCII systems, this sanity check assumes
> an uncompressed size greater than half a terabyte is unreasonable. Is
> this a reasonable sanity check? (if you answer "no" you get to come
> up with a better check ;)
Hmmm, the linker shouldn't even be looking for "ZLIB" unless the
section name is ".zdebug_str" (or, for the new gABI feature, unless
the SHF_COMPRESSED flag is set). Wouldn't that be a better check?
-cary