aboutsummaryrefslogtreecommitdiff
path: root/bfd/binary.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-12-12 22:54:39 +0000
committerNick Clifton <nickc@redhat.com>2000-12-12 22:54:39 +0000
commit3a71aec8b4c34df68c74c4869c47a109ca7bcfb6 (patch)
tree1f8ceb3568e65480d7ec0c3061bf1f6248b28373 /bfd/binary.c
parent7ec229cebec3e99e605b67bbffdd32b90e4fd5f9 (diff)
downloadfsf-binutils-gdb-3a71aec8b4c34df68c74c4869c47a109ca7bcfb6.zip
fsf-binutils-gdb-3a71aec8b4c34df68c74c4869c47a109ca7bcfb6.tar.gz
fsf-binutils-gdb-3a71aec8b4c34df68c74c4869c47a109ca7bcfb6.tar.bz2
Ignore sections with zero size.
Diffstat (limited to 'bfd/binary.c')
-rw-r--r--bfd/binary.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bfd/binary.c b/bfd/binary.c
index fd68a8e..771e431 100644
--- a/bfd/binary.c
+++ b/bfd/binary.c
@@ -255,6 +255,9 @@ binary_set_section_contents (abfd, sec, data, offset, size)
file_ptr offset;
bfd_size_type size;
{
+ if (size == 0)
+ return true;
+
if (! abfd->output_has_begun)
{
boolean found_low;
@@ -270,6 +273,7 @@ binary_set_section_contents (abfd, sec, data, offset, size)
if (((s->flags
& (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_NEVER_LOAD))
== (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC))
+ && (s->_raw_size > 0)
&& (! found_low || s->lma < low))
{
low = s->lma;
@@ -284,7 +288,8 @@ binary_set_section_contents (abfd, sec, data, offset, size)
occupy file space. */
if ((s->flags
& (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_NEVER_LOAD))
- != (SEC_HAS_CONTENTS | SEC_ALLOC))
+ != (SEC_HAS_CONTENTS | SEC_ALLOC)
+ || (s->_raw_size == 0))
continue;
/* If attempting to generate a binary file from a bfd with