aboutsummaryrefslogtreecommitdiff
path: root/bfd/compress.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/compress.c')
-rw-r--r--bfd/compress.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/bfd/compress.c b/bfd/compress.c
index 294bfd3..7f94781 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -255,6 +255,29 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
/*
FUNCTION
+ bfd_cache_section_contents
+
+SYNOPSIS
+ void bfd_cache_section_contents
+ (asection *sec, void *contents);
+
+DESCRIPTION
+ Stash @var(contents) so any following reads of @var(sec) do
+ not need to decompress again.
+*/
+
+void
+bfd_cache_section_contents (asection *sec, void *contents)
+{
+ if (sec->compress_status == DECOMPRESS_SECTION_SIZED)
+ sec->compress_status = COMPRESS_SECTION_DONE;
+ sec->contents = contents;
+ sec->flags |= SEC_IN_MEMORY;
+}
+
+
+/*
+FUNCTION
bfd_is_section_compressed
SYNOPSIS