summaryrefslogtreecommitdiff
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
commit681aa0079fbf6d22e73a85d41de0c9d5d0d9fd4c (patch)
treea205ce572b00a52706dbd36c3f3da1f750894d54 /bfd/simple.c
parentb255e512260ab2b6e982c5aa13ecd83ff263c72b (diff)
downloadbinutils-redhat-681aa0079fbf6d22e73a85d41de0c9d5d0d9fd4c.tar.gz
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 10178a40ad..f0f5ee6412 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. */