From 16bf045b1bea9ff86866e4bad2f896d33c85c23a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 21 Oct 2012 09:06:06 +0000 Subject: bfd/ * compress.c (bfd_cache_section_contents): New function. * bfd-in2.h: Regenerate. binutils/ * objdump.c (load_specific_debug_section): Use bfd_cache_section_contents. --- bfd/compress.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'bfd/compress.c') diff --git a/bfd/compress.c b/bfd/compress.c index 294bfd3e9d..7f947817a1 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -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 -- cgit v1.2.1