bfd/
[deliverable/binutils-gdb.git] / bfd / compress.c
index 294bfd3e9df94ccf2d28479e7967885a386a6747..7f947817a173a1712f478c55e2c8c70902c5046c 100644 (file)
@@ -253,6 +253,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
This page took 0.023764 seconds and 4 git commands to generate.