aboutsummaryrefslogtreecommitdiff
path: root/bfd/compress.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/compress.c')
-rw-r--r--bfd/compress.c36
1 files changed, 6 insertions, 30 deletions
diff --git a/bfd/compress.c b/bfd/compress.c
index 993a1d3..7e498fa 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -19,14 +19,11 @@
MA 02110-1301, USA. */
#include "sysdep.h"
+#include <zlib.h>
#include "bfd.h"
#include "libbfd.h"
-#ifdef HAVE_ZLIB_H
-#include <zlib.h>
-#endif
#include "safe-ctype.h"
-#ifdef HAVE_ZLIB_H
static bfd_boolean
decompress_contents (bfd_byte *compressed_buffer,
bfd_size_type compressed_size,
@@ -72,10 +69,9 @@ decompress_contents (bfd_byte *compressed_buffer,
successfully. */
static bfd_boolean
-bfd_compress_section_contents (bfd *abfd ATTRIBUTE_UNUSED,
- sec_ptr sec ATTRIBUTE_UNUSED,
- bfd_byte *uncompressed_buffer ATTRIBUTE_UNUSED,
- bfd_size_type uncompressed_size ATTRIBUTE_UNUSED)
+bfd_compress_section_contents (bfd *abfd ATTRIBUTE_UNUSED, sec_ptr sec,
+ bfd_byte *uncompressed_buffer,
+ bfd_size_type uncompressed_size)
{
uLong compressed_size;
bfd_byte *compressed_buffer;
@@ -127,7 +123,6 @@ bfd_compress_section_contents (bfd *abfd ATTRIBUTE_UNUSED,
return TRUE;
}
-#endif /* HAVE_ZLIB_H */
/*
FUNCTION
@@ -152,12 +147,10 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
{
bfd_size_type sz;
bfd_byte *p = *ptr;
-#ifdef HAVE_ZLIB_H
bfd_boolean ret;
bfd_size_type save_size;
bfd_size_type save_rawsize;
bfd_byte *compressed_buffer;
-#endif
if (abfd->direction != write_direction && sec->rawsize != 0)
sz = sec->rawsize;
@@ -189,10 +182,6 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
return TRUE;
case DECOMPRESS_SECTION_SIZED:
-#ifndef HAVE_ZLIB_H
- bfd_set_error (bfd_error_invalid_operation);
- return FALSE;
-#else
/* Read in the full compressed section contents. */
compressed_buffer = (bfd_byte *) bfd_malloc (sec->compressed_size);
if (compressed_buffer == NULL)
@@ -232,7 +221,6 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
free (compressed_buffer);
*ptr = p;
return TRUE;
-#endif
case COMPRESS_SECTION_DONE:
if (sec->contents == NULL)
@@ -337,13 +325,8 @@ DESCRIPTION
*/
bfd_boolean
-bfd_init_section_decompress_status (bfd *abfd ATTRIBUTE_UNUSED,
- sec_ptr sec ATTRIBUTE_UNUSED)
+bfd_init_section_decompress_status (bfd *abfd, sec_ptr sec)
{
-#ifndef HAVE_ZLIB_H
- bfd_set_error (bfd_error_invalid_operation);
- return FALSE;
-#else
bfd_byte compressed_buffer [12];
bfd_size_type uncompressed_size;
@@ -378,7 +361,6 @@ bfd_init_section_decompress_status (bfd *abfd ATTRIBUTE_UNUSED,
sec->compress_status = DECOMPRESS_SECTION_SIZED;
return TRUE;
-#endif
}
/*
@@ -399,13 +381,8 @@ DESCRIPTION
*/
bfd_boolean
-bfd_init_section_compress_status (bfd *abfd ATTRIBUTE_UNUSED,
- sec_ptr sec ATTRIBUTE_UNUSED)
+bfd_init_section_compress_status (bfd *abfd, sec_ptr sec)
{
-#ifndef HAVE_ZLIB_H
- bfd_set_error (bfd_error_invalid_operation);
- return FALSE;
-#else
bfd_size_type uncompressed_size;
bfd_byte *uncompressed_buffer;
bfd_boolean ret;
@@ -433,5 +410,4 @@ bfd_init_section_compress_status (bfd *abfd ATTRIBUTE_UNUSED,
uncompressed_size);
return ret;
-#endif
}