This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR gas/12409: --compress-debug-sections doesn't work on empty DWARF sections


On Tue, Jan 18, 2011 at 10:57 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Hi,
>
> We shouldn't compress empty DWARF sections. ?I checked in this patch as
> an obvious fix.
>
>
> H.J.
> ---
> gas/
>
> 2011-01-18 ?H.J. Lu ?<hongjiu.lu@intel.com>
>
> ? ? ? ?PR gas/12409
> ? ? ? ?* write.c (compress_debug): Return if section size is 0.
>


Should I apply this patch? Since the compression header is 12 byte,
if the section is smaller than 12 bytes, compressed section will be
bigger.

H.J.
---
diff --git a/gas/write.c b/gas/write.c
index aabb96d..9e4d6f4 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1359,7 +1359,7 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIB
UTE_UNUSED)
   flagword flags = bfd_get_section_flags (abfd, sec);

   if (seginfo == NULL
-      || sec->size == 0
+      || sec->size < 12
       || (flags & (SEC_ALLOC | SEC_HAS_CONTENTS)) == SEC_ALLOC)
     return;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]