aboutsummaryrefslogtreecommitdiff
path: root/bfd/aoutx.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-10-26 05:17:08 +0000
committerIan Lance Taylor <ian@airs.com>1994-10-26 05:17:08 +0000
commit875e471661f6f76cece50d09fd217cdca1cee2fe (patch)
tree917ebd29d2ae07cbe5096369268aa3d2b36b2542 /bfd/aoutx.h
parent7c71fc399dc446896c337130e5b811cf8a5254a1 (diff)
downloadgdb-875e471661f6f76cece50d09fd217cdca1cee2fe.zip
gdb-875e471661f6f76cece50d09fd217cdca1cee2fe.tar.gz
gdb-875e471661f6f76cece50d09fd217cdca1cee2fe.tar.bz2
* aoutx.h (aout_link_input_section): Don't bother to read or write
the relocs if there aren't any.
Diffstat (limited to 'bfd/aoutx.h')
-rw-r--r--bfd/aoutx.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 2923c80..c0d934e 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -4092,9 +4092,12 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr,
else
{
relocs = finfo->relocs;
- if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
- || bfd_read (relocs, 1, rel_size, input_bfd) != rel_size)
- return false;
+ if (rel_size > 0)
+ {
+ if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
+ || bfd_read (relocs, 1, rel_size, input_bfd) != rel_size)
+ return false;
+ }
}
/* Relocate the section contents. */
@@ -4123,7 +4126,7 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr,
/* If we are producing relocateable output, the relocs were
modified, and we now write them out. */
- if (finfo->info->relocateable)
+ if (finfo->info->relocateable && rel_size > 0)
{
if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0)
return false;