From 8a72cc6e7e9e329b50b18cdc62b281ee1a5473f1 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 21 Oct 2012 09:06:07 +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/ChangeLog | 5 +++++ bfd/bfd-in2.h | 3 +++ bfd/compress.c | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 78115e2..5c6f6da 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2012-10-21 Alan Modra + + * compress.c (bfd_cache_section_contents): New function. + * bfd-in2.h: Regenerate. + 2012-10-21 Hans-Peter Nilsson * linker.c (_bfd_generic_link_output_symbols): Handle a diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index c37c005..919f51a 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -6709,6 +6709,9 @@ bfd_boolean bfd_compress_section_contents bfd_boolean bfd_get_full_section_contents (bfd *abfd, asection *section, bfd_byte **ptr); +void bfd_cache_section_contents + (asection *sec, void *contents); + bfd_boolean bfd_is_section_compressed (bfd *abfd, asection *section); 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 -- cgit v1.1