* compress.c (bfd_cache_section_contents): New function.
	* bfd-in2.h: Regenerate.
binutils/
	* objdump.c (load_specific_debug_section): Use
	bfd_cache_section_contents.
This commit is contained in:
Alan Modra
2012-10-21 09:06:07 +00:00
parent 1e9d6fc263
commit 8a72cc6e7e
5 changed files with 37 additions and 7 deletions

View 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