Always create PLT eh_frame section for i386/x86-64
[deliverable/binutils-gdb.git] / bfd / compress.c
index 669033c5ec54694c3ef6e90d11947ab9c2b0441c..52c884cd83d95745e512b4ce04caec23a94b496d 100644 (file)
@@ -1,5 +1,5 @@
 /* Compressed section support (intended for debug sections).
-   Copyright 2008, 2010
+   Copyright 2008, 2010, 2011, 2012
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -19,7 +19,6 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA.  */
 
-#include "config.h"
 #include "sysdep.h"
 #include "bfd.h"
 #include "libbfd.h"
@@ -158,7 +157,7 @@ DESCRIPTION
 bfd_boolean
 bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
 {
-  bfd_size_type sz = sec->rawsize ? sec->rawsize : sec->size;
+  bfd_size_type sz;
   bfd_byte *p = *ptr;
 #ifdef HAVE_ZLIB_H
   bfd_boolean ret;
@@ -169,6 +168,10 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
   bfd_byte *uncompressed_buffer;
 #endif
 
+  if (abfd->direction != write_direction && sec->rawsize != 0)
+    sz = sec->rawsize;
+  else
+    sz = sec->size;
   if (sz == 0)
     return TRUE;
 
This page took 0.024563 seconds and 4 git commands to generate.