diff options
author | Alan Modra <amodra@gmail.com> | 2012-10-21 09:06:07 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2012-10-21 09:06:07 +0000 |
commit | 8a72cc6e7e9e329b50b18cdc62b281ee1a5473f1 (patch) | |
tree | 69a86b195310afc299537c9f0f8ec5b576705893 /bfd/compress.c | |
parent | 1e9d6fc2630d2b72281d58c3fb0807799513f3ff (diff) | |
download | gdb-8a72cc6e7e9e329b50b18cdc62b281ee1a5473f1.zip gdb-8a72cc6e7e9e329b50b18cdc62b281ee1a5473f1.tar.gz gdb-8a72cc6e7e9e329b50b18cdc62b281ee1a5473f1.tar.bz2 |
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.
Diffstat (limited to 'bfd/compress.c')
-rw-r--r-- | bfd/compress.c | 23 |
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 |