summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2012-10-21 09:06:06 +0000
committerAlan Modra <amodra@bigpond.net.au>2012-10-21 09:06:06 +0000
commit4d7064fa6d0b8d7338211fcf29c1db7c5ebcf413 (patch)
tree422580b84e17481e367486cf6d4221f5bdc0cd43
parent56f6d4f2fd8a41daa14c70b7f7f9b485302cc168 (diff)
downloadgdb-4d7064fa6d0b8d7338211fcf29c1db7c5ebcf413.tar.gz
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.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/bfd-in2.h3
-rw-r--r--bfd/compress.c23
3 files changed, 31 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 78115e25255..5c6f6da9086 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-21 Alan Modra <amodra@gmail.com>
+
+ * compress.c (bfd_cache_section_contents): New function.
+ * bfd-in2.h: Regenerate.
+
2012-10-21 Hans-Peter Nilsson <hp@bitrange.com>
* linker.c (_bfd_generic_link_output_symbols): Handle a
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index c37c005d752..919f51a2e9f 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 294bfd3e9df..7f947817a17 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