aboutsummaryrefslogtreecommitdiff
path: root/bfd/simple.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-11-07 14:36:31 +0000
committerNick Clifton <nickc@redhat.com>2002-11-07 14:36:31 +0000
commitec4530b540c3e8ac595d1c65744ff8e6c8695c96 (patch)
tree162b8c4541dccc13aabea17714cb57b7ff05e70a /bfd/simple.c
parentbde78a07b9f30f173df10eb779ce51284ee275c9 (diff)
downloadgdb-ec4530b540c3e8ac595d1c65744ff8e6c8695c96.zip
gdb-ec4530b540c3e8ac595d1c65744ff8e6c8695c96.tar.gz
gdb-ec4530b540c3e8ac595d1c65744ff8e6c8695c96.tar.bz2
Use bfd_simple_get_relocated_section_contents() instead of bfd_get_section_contents().
Diffstat (limited to 'bfd/simple.c')
-rw-r--r--bfd/simple.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/bfd/simple.c b/bfd/simple.c
index 10178a4..f0f5ee6 100644
--- a/bfd/simple.c
+++ b/bfd/simple.c
@@ -138,6 +138,21 @@ bfd_simple_get_relocated_section_contents (abfd, sec, outbuf)
int storage_needed, number_of_symbols;
asymbol **symbol_table;
+ if (! (sec->flags & SEC_RELOC))
+ {
+ bfd_size_type size = bfd_section_size (abfd, sec);
+
+ if (outbuf == NULL)
+ contents = bfd_malloc (size);
+ else
+ contents = outbuf;
+
+ if (contents)
+ bfd_get_section_contents (abfd, sec, contents, 0, size);
+
+ return contents;
+ }
+
/* In order to use bfd_get_relocated_section_contents, we need
to forge some data structures that it expects. */